Skip to content

Commit

Permalink
SYCL: Address deprecations after oneAPI 2023.2.0 (kokkos#6577)
Browse files Browse the repository at this point in the history
* Address deprecations in oneAPI 2023.2.0

* Define KOKKOS_IMPL_SYCL_GET_MULTI_PTR
  • Loading branch information
masterleinad committed Jan 4, 2024
1 parent 06de563 commit 9f5e38e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
3 changes: 2 additions & 1 deletion core/src/SYCL/Kokkos_SYCL_ParallelFor_Team.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class Kokkos::Impl::ParallelFor<FunctorType, Kokkos::TeamPolicy<Properties...>,

auto lambda = [=](sycl::nd_item<2> item) {
const member_type team_member(
team_scratch_memory_L0.get_pointer(), shmem_begin, scratch_size[0],
KOKKOS_IMPL_SYCL_GET_MULTI_PTR(team_scratch_memory_L0), shmem_begin,
scratch_size[0],
global_scratch_ptr + item.get_group(1) * scratch_size[1],
scratch_size[1], item, item.get_group_linear_id(),
item.get_group_range(1));
Expand Down
15 changes: 8 additions & 7 deletions core/src/SYCL/Kokkos_SYCL_ParallelReduce_Team.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ class Kokkos::Impl::ParallelReduce<CombinedFunctorReducerType,
reference_type update = reducer.init(results_ptr);
if (size == 1) {
const member_type team_member(
team_scratch_memory_L0.get_pointer(), shmem_begin,
scratch_size[0], global_scratch_ptr, scratch_size[1], item,
item.get_group_linear_id(), item.get_group_range(1));
KOKKOS_IMPL_SYCL_GET_MULTI_PTR(team_scratch_memory_L0),
shmem_begin, scratch_size[0], global_scratch_ptr,
scratch_size[1], item, item.get_group_linear_id(),
item.get_group_range(1));
if constexpr (std::is_void_v<WorkTag>)
functor(team_member, update);
else
Expand Down Expand Up @@ -200,8 +201,8 @@ class Kokkos::Impl::ParallelReduce<CombinedFunctorReducerType,
for (int league_rank = group_id; league_rank < league_size;
league_rank += n_wgroups) {
const member_type team_member(
team_scratch_memory_L0.get_pointer(), shmem_begin,
scratch_size[0],
KOKKOS_IMPL_SYCL_GET_MULTI_PTR(team_scratch_memory_L0),
shmem_begin, scratch_size[0],
global_scratch_ptr +
item.get_group(1) * scratch_size[1],
scratch_size[1], item, league_rank, league_size);
Expand Down Expand Up @@ -253,8 +254,8 @@ class Kokkos::Impl::ParallelReduce<CombinedFunctorReducerType,
for (int league_rank = group_id; league_rank < league_size;
league_rank += n_wgroups) {
const member_type team_member(
team_scratch_memory_L0.get_pointer(), shmem_begin,
scratch_size[0],
KOKKOS_IMPL_SYCL_GET_MULTI_PTR(team_scratch_memory_L0),
shmem_begin, scratch_size[0],
global_scratch_ptr +
item.get_group(1) * scratch_size[1],
scratch_size[1], item, league_rank, league_size);
Expand Down
7 changes: 7 additions & 0 deletions core/src/setup/Kokkos_Setup_SYCL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,11 @@
#include <CL/sycl.hpp>
#endif

#if defined(__INTEL_LLVM_COMPILER) && __INTEL_LLVM_COMPILER >= 20230200
#define KOKKOS_IMPL_SYCL_GET_MULTI_PTR(accessor) \
accessor.get_multi_ptr<sycl::access::decorated::yes>()
#else
#define KOKKOS_IMPL_SYCL_GET_MULTI_PTR(accessor) accessor.get_pointer()
#endif

#endif

0 comments on commit 9f5e38e

Please sign in to comment.