diff --git a/examples/rng/device/include/rng_example_helper.hpp b/examples/rng/device/include/rng_example_helper.hpp index ad0fdea03..0bcf114b4 100644 --- a/examples/rng/device/include/rng_example_helper.hpp +++ b/examples/rng/device/include/rng_example_helper.hpp @@ -29,12 +29,22 @@ struct has_member_code_meta().get_multi_ template ::value>::type* = nullptr> auto get_multi_ptr(T acc) { +// Workaround for AdaptiveCPP, as they do not yet support the get_multi_ptr function +#ifndef __HIPSYCL__ return acc.get_multi_ptr(); +#else + return acc.get_pointer(); +#endif }; template ::value>::type* = nullptr> auto get_multi_ptr(T acc) { +// Workaround for AdaptiveCPP, as they do not yet support the get_multi_ptr function +#ifndef __HIPSYCL__ return acc.template get_multi_ptr(); +#else + return acc.get_pointer(); +#endif }; #endif // _RNG_EXAMPLE_HELPER_HPP__ diff --git a/src/rng/backends/mklcpu/cpu_common.hpp b/src/rng/backends/mklcpu/cpu_common.hpp index b5e10585c..cbd6cae59 100644 --- a/src/rng/backends/mklcpu/cpu_common.hpp +++ b/src/rng/backends/mklcpu/cpu_common.hpp @@ -56,9 +56,14 @@ class kernel_name {}; template class kernel_name_usm {}; -template -T *get_raw_ptr(sycl::accessor acc) { +template +typename Acc::value_type *get_raw_ptr(Acc acc) { +// Workaround for AdaptiveCPP, as they do not yet support the get_multi_ptr function +#ifndef __HIPSYCL__ return acc.template get_multi_ptr().get_raw(); +#else + return acc.get_pointer(); +#endif } } // namespace mklcpu diff --git a/tests/unit_tests/rng/device/include/rng_device_test_common.hpp b/tests/unit_tests/rng/device/include/rng_device_test_common.hpp index e6f2b5026..6b014f0ec 100644 --- a/tests/unit_tests/rng/device/include/rng_device_test_common.hpp +++ b/tests/unit_tests/rng/device/include/rng_device_test_common.hpp @@ -112,12 +112,20 @@ struct has_member_code_meta().get_multi_ template ::value>::type* = nullptr> auto get_multi_ptr(T acc) { +#ifndef __HIPSYCL__ return acc.get_multi_ptr(); +#else + return acc.get_pointer(); +#endif }; template ::value>::type* = nullptr> auto get_multi_ptr(T acc) { +#ifndef __HIPSYCL__ return acc.template get_multi_ptr(); +#else + return acc.get_pointer(); +#endif }; template