Skip to content

Commit

Permalink
Removed ADPATIVECPP workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
lrpablo committed Aug 12, 2024
1 parent 478bbea commit 75d9eda
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 25 deletions.
10 changes: 0 additions & 10 deletions examples/rng/device/include/rng_example_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,12 @@ struct has_member_code_meta<T, std::void_t<decltype(std::declval<T>().get_multi_

template <typename T, typename std::enable_if<has_member_code_meta<T>::value>::type* = nullptr>
auto get_multi_ptr(T acc) {
// Workaround for AdaptiveCPP, as they do not yet support the get_multi_ptr function
#ifndef __ADAPTIVECPP__
return acc.get_multi_ptr();
#else
return acc.get_pointer();
#endif
};

template <typename T, typename std::enable_if<!has_member_code_meta<T>::value>::type* = nullptr>
auto get_multi_ptr(T acc) {
// Workaround for AdaptiveCPP, as they do not yet support the get_multi_ptr function
#ifndef __ADAPTIVECPP__
return acc.template get_multi_ptr<sycl::access::decorated::yes>();
#else
return acc.get_pointer();
#endif
};

#endif // _RNG_EXAMPLE_HELPER_HPP__
5 changes: 0 additions & 5 deletions include/oneapi/mkl/rng/device/detail/mcg31m1_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,7 @@ static inline sycl::vec<std::uint32_t, VecSize> generate(
engine_state<oneapi::mkl::rng::device::mcg31m1<VecSize>>& state) {
sycl::vec<std::uint64_t, VecSize> x(state.s);
sycl::vec<std::uint32_t, VecSize> res;
#ifndef __ADAPTIVECPP__
res = custom_mod(mcg31m1_vector_a<VecSize>::vector_a * x);
#else
// a workaround for AdaptiveCpp (hipSYCL)
res = custom_mod(select_vector_a_mcg31m1<VecSize>() * x);
#endif
state.s =
custom_mod<std::uint32_t>(mcg31m1_param::a * static_cast<std::uint64_t>(res[VecSize - 1]));
return res;
Expand Down
5 changes: 0 additions & 5 deletions include/oneapi/mkl/rng/device/detail/mcg59_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,7 @@ template <std::int32_t VecSize>
static inline sycl::vec<std::uint64_t, VecSize> generate(
engine_state<oneapi::mkl::rng::device::mcg59<VecSize>>& state) {
sycl::vec<std::uint64_t, VecSize> res(state.s);
#ifndef __ADAPTIVECPP__
res = custom_mod(mcg59_vector_a<VecSize>::vector_a * res);
#else
// a workaround for AdaptiveCpp (hipSYCL)
res = custom_mod(select_vector_a_mcg59<VecSize>() * res);
#endif
state.s = custom_mod(mcg59_param::a * res[VecSize - 1]);
return res;
}
Expand Down
5 changes: 0 additions & 5 deletions src/rng/backends/mklcpu/cpu_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,7 @@ class kernel_name_usm {};

template <typename Acc>
typename Acc::value_type *get_raw_ptr(Acc acc) {
// Workaround for AdaptiveCPP, as they do not yet support the get_multi_ptr function
#ifndef __ADAPTIVECPP__
return acc.template get_multi_ptr<sycl::access::decorated::no>().get_raw();
#else
return acc.get_pointer();
#endif
}

} // namespace mklcpu
Expand Down

0 comments on commit 75d9eda

Please sign in to comment.