Skip to content

Commit

Permalink
Added KOKKOS_ENABLE_DEPRECATED_CODE guards
Browse files Browse the repository at this point in the history
  • Loading branch information
ldh4 committed Sep 17, 2024
1 parent 959bf66 commit 63d191e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
24 changes: 24 additions & 0 deletions simd/src/Kokkos_SIMD_AVX512.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3231,6 +3231,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
}
};

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION
std::int32_t
hmax(const_where_expression<
Expand All @@ -3240,6 +3241,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
static_cast<__mmask8>(x.impl_get_mask()),
_mm512_castsi256_si512(static_cast<__m256i>(x.impl_get_value())));
}
#endif

[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION std::int32_t reduce_max(
const_where_expression<
Expand All @@ -3250,6 +3252,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
_mm512_castsi256_si512(static_cast<__m256i>(x.impl_get_value())));
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION
std::int32_t
hmin(const_where_expression<
Expand All @@ -3259,6 +3262,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
static_cast<__mmask8>(x.impl_get_mask()),
_mm512_castsi256_si512(static_cast<__m256i>(x.impl_get_value())));
}
#endif

[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION std::int32_t reduce_min(
const_where_expression<
Expand All @@ -3285,6 +3289,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
static_cast<__m512i>(x.impl_get_value()));
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION
std::uint32_t
hmax(const_where_expression<
Expand All @@ -3294,6 +3299,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
static_cast<__mmask8>(x.impl_get_mask()),
_mm512_castsi256_si512(static_cast<__m256i>(x.impl_get_value())));
}
#endif

[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION std::uint32_t reduce_max(
const_where_expression<
Expand All @@ -3304,6 +3310,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
_mm512_castsi256_si512(static_cast<__m256i>(x.impl_get_value())));
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION
std::uint32_t
hmin(const_where_expression<
Expand All @@ -3313,6 +3320,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
static_cast<__mmask8>(x.impl_get_mask()),
_mm512_castsi256_si512(static_cast<__m256i>(x.impl_get_value())));
}
#endif

[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION std::uint32_t reduce_min(
const_where_expression<
Expand All @@ -3339,6 +3347,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
static_cast<__m512i>(x.impl_get_value()));
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION
std::int64_t
hmax(const_where_expression<
Expand All @@ -3347,6 +3356,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
return _mm512_mask_reduce_max_epi64(static_cast<__mmask8>(x.impl_get_mask()),
static_cast<__m512i>(x.impl_get_value()));
}
#endif

[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION std::int64_t reduce_max(
const_where_expression<
Expand All @@ -3356,6 +3366,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
static_cast<__m512i>(x.impl_get_value()));
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION
std::int64_t
hmin(const_where_expression<
Expand All @@ -3364,6 +3375,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
return _mm512_mask_reduce_min_epi64(static_cast<__mmask8>(x.impl_get_mask()),
static_cast<__m512i>(x.impl_get_value()));
}
#endif

[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION std::int64_t reduce_min(
const_where_expression<
Expand All @@ -3373,6 +3385,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
static_cast<__m512i>(x.impl_get_value()));
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION
std::uint64_t
hmax(const_where_expression<
Expand All @@ -3381,6 +3394,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
return _mm512_mask_reduce_max_epu64(static_cast<__mmask8>(x.impl_get_mask()),
static_cast<__m512i>(x.impl_get_value()));
}
#endif

[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION std::uint64_t reduce_max(
const_where_expression<
Expand All @@ -3390,6 +3404,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
static_cast<__m512i>(x.impl_get_value()));
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION
std::uint64_t
hmin(const_where_expression<
Expand All @@ -3398,6 +3413,7 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
return _mm512_mask_reduce_min_epu64(static_cast<__mmask8>(x.impl_get_mask()),
static_cast<__m512i>(x.impl_get_value()));
}
#endif

[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION std::uint64_t reduce_min(
const_where_expression<
Expand All @@ -3407,13 +3423,15 @@ class where_expression<simd_mask<std::uint64_t, simd_abi::avx512_fixed_size<8>>,
static_cast<__m512i>(x.impl_get_value()));
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION double
hmax(const_where_expression<simd_mask<double, simd_abi::avx512_fixed_size<8>>,
simd<double, simd_abi::avx512_fixed_size<8>>> const&
x) {
return _mm512_mask_reduce_max_pd(static_cast<__mmask8>(x.impl_get_mask()),
static_cast<__m512d>(x.impl_get_value()));
}
#endif

[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION double reduce_max(
const_where_expression<simd_mask<double, simd_abi::avx512_fixed_size<8>>,
Expand All @@ -3423,13 +3441,15 @@ hmax(const_where_expression<simd_mask<double, simd_abi::avx512_fixed_size<8>>,
static_cast<__m512d>(x.impl_get_value()));
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION double
hmin(const_where_expression<simd_mask<double, simd_abi::avx512_fixed_size<8>>,
simd<double, simd_abi::avx512_fixed_size<8>>> const&
x) {
return _mm512_mask_reduce_min_pd(static_cast<__mmask8>(x.impl_get_mask()),
static_cast<__m512d>(x.impl_get_value()));
}
#endif

[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION double reduce_min(
const_where_expression<simd_mask<double, simd_abi::avx512_fixed_size<8>>,
Expand All @@ -3439,6 +3459,7 @@ hmin(const_where_expression<simd_mask<double, simd_abi::avx512_fixed_size<8>>,
static_cast<__m512d>(x.impl_get_value()));
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION float
hmax(const_where_expression<simd_mask<float, simd_abi::avx512_fixed_size<8>>,
simd<float, simd_abi::avx512_fixed_size<8>>> const&
Expand All @@ -3447,6 +3468,7 @@ hmax(const_where_expression<simd_mask<float, simd_abi::avx512_fixed_size<8>>,
static_cast<__mmask8>(x.impl_get_mask()),
_mm512_castps256_ps512(static_cast<__m256>(x.impl_get_value())));
}
#endif

[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION float reduce_max(
const_where_expression<simd_mask<float, simd_abi::avx512_fixed_size<8>>,
Expand All @@ -3457,6 +3479,7 @@ hmax(const_where_expression<simd_mask<float, simd_abi::avx512_fixed_size<8>>,
_mm512_castps256_ps512(static_cast<__m256>(x.impl_get_value())));
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION float
hmin(const_where_expression<simd_mask<float, simd_abi::avx512_fixed_size<8>>,
simd<float, simd_abi::avx512_fixed_size<8>>> const&
Expand All @@ -3465,6 +3488,7 @@ hmin(const_where_expression<simd_mask<float, simd_abi::avx512_fixed_size<8>>,
static_cast<__mmask8>(x.impl_get_mask()),
_mm512_castps256_ps512(static_cast<__m256>(x.impl_get_value())));
}
#endif

[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION float reduce_min(
const_where_expression<simd_mask<float, simd_abi::avx512_fixed_size<8>>,
Expand Down
2 changes: 2 additions & 0 deletions simd/src/Kokkos_SIMD_Common_Math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class simd_mask;
template <class M, class T>
class const_where_expression;

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
template <typename T, typename Abi>
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION T
hmin(const_where_expression<simd_mask<T, Abi>, simd<T, Abi>> const& x) {
Expand All @@ -55,6 +56,7 @@ hmax(const_where_expression<simd_mask<T, Abi>, simd<T, Abi>> const& x) {
}
return result;
}
#endif

template <typename T, typename Abi>
[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION T
Expand Down
4 changes: 4 additions & 0 deletions simd/src/Kokkos_SIMD_Scalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ reduce(const_where_expression<simd_mask<T, simd_abi::scalar>,
: identity_element;
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
template <class T>
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_FORCEINLINE_FUNCTION T
hmax(const_where_expression<simd_mask<T, simd_abi::scalar>,
Expand All @@ -434,6 +435,7 @@ hmax(const_where_expression<simd_mask<T, simd_abi::scalar>,
? static_cast<T>(x.impl_get_value())
: Kokkos::reduction_identity<T>::max();
}
#endif

template <class T>
[[nodiscard]] KOKKOS_FORCEINLINE_FUNCTION T
Expand All @@ -444,6 +446,7 @@ reduce_max(const_where_expression<simd_mask<T, simd_abi::scalar>,
: Kokkos::reduction_identity<T>::max();
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
template <class T>
[[nodiscard]] KOKKOS_DEPRECATED KOKKOS_FORCEINLINE_FUNCTION T
hmin(const_where_expression<simd_mask<T, simd_abi::scalar>,
Expand All @@ -452,6 +455,7 @@ hmin(const_where_expression<simd_mask<T, simd_abi::scalar>,
? static_cast<T>(x.impl_get_value())
: Kokkos::reduction_identity<T>::min();
}
#endif

template <class T>
[[nodiscard]] KOKKOS_FORCEINLINE_FUNCTION T
Expand Down
16 changes: 8 additions & 8 deletions simd/unit_tests/include/SIMDTesting_Ops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,12 @@ template <typename BinaryOperation = std::plus<>>
class reduce_where_expr {
public:
template <typename T, typename MaskType>
KOKKOS_INLINE_FUNCTION auto on_host(T const& a, MaskType mask) const {
auto on_host(T const& a, MaskType mask) const {
auto w = Kokkos::Experimental::where(mask, a);
return Kokkos::Experimental::reduce(w, BinaryOperation());
}
template <typename T, typename MaskType>
KOKKOS_INLINE_FUNCTION auto on_host_serial(T const& a, MaskType mask) const {
auto on_host_serial(T const& a, MaskType mask) const {
auto w = Kokkos::Experimental::where(mask, a);
auto const& v = w.impl_get_value();
auto const& m = w.impl_get_mask();
Expand Down Expand Up @@ -373,11 +373,11 @@ class reduce_where_expr {
class reduce_min {
public:
template <typename T, typename MaskType>
KOKKOS_INLINE_FUNCTION auto on_host(T const& a, MaskType mask) const {
auto on_host(T const& a, MaskType mask) const {
return Kokkos::Experimental::reduce_min(a, mask);
}
template <typename T, typename MaskType>
KOKKOS_INLINE_FUNCTION auto on_host_serial(T const& a, MaskType mask) const {
auto on_host_serial(T const& a, MaskType mask) const {
auto w = Kokkos::Experimental::where(mask, a);
auto const& v = w.impl_get_value();
auto const& m = w.impl_get_mask();
Expand Down Expand Up @@ -409,11 +409,11 @@ class reduce_min {
class reduce_max {
public:
template <typename T, typename MaskType>
KOKKOS_INLINE_FUNCTION auto on_host(T const& a, MaskType mask) const {
auto on_host(T const& a, MaskType mask) const {
return Kokkos::Experimental::reduce_max(a, mask);
}
template <typename T, typename MaskType>
KOKKOS_INLINE_FUNCTION auto on_host_serial(T const& a, MaskType mask) const {
auto on_host_serial(T const& a, MaskType mask) const {
auto w = Kokkos::Experimental::where(mask, a);
auto const& v = w.impl_get_value();
auto const& m = w.impl_get_mask();
Expand Down Expand Up @@ -446,11 +446,11 @@ template <typename BinaryOperation = std::plus<>>
class reduce {
public:
template <typename T, typename MaskType>
KOKKOS_INLINE_FUNCTION auto on_host(T const& a, MaskType mask) const {
auto on_host(T const& a, MaskType mask) const {
return Kokkos::Experimental::reduce(a, mask, BinaryOperation());
}
template <typename T, typename MaskType>
KOKKOS_INLINE_FUNCTION auto on_host_serial(T const& a, MaskType mask) const {
auto on_host_serial(T const& a, MaskType mask) const {
return reduce_where_expr<BinaryOperation>().on_host_serial(a, mask);
}

Expand Down

0 comments on commit 63d191e

Please sign in to comment.