Skip to content

Commit

Permalink
SYCL: Use get_multi_ptr instead of get_pointer (#3630)
Browse files Browse the repository at this point in the history
The latter has been deprecated in SYCL 2020.
  • Loading branch information
WeiqunZhang committed Nov 15, 2023
1 parent af1e1be commit 15a0bb9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,9 @@ jobs:
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_EB=ON \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_FORTRAN=ON \
-DAMReX_FORTRAN=OFF \
-DCMAKE_C_COMPILER=$(which icc) \
-DCMAKE_CXX_COMPILER=$(which icpc) \
-DCMAKE_Fortran_COMPILER=$(which ifort) \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build build --parallel 2
cmake --build build --target install
Expand Down
10 changes: 5 additions & 5 deletions Src/Base/AMReX_GpuLaunchFunctsG.H
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void launch (int nblocks, int nthreads_per_block, std::size_t shared_mem_bytes,
[=] (sycl::nd_item<1> item)
[[sycl::reqd_sub_group_size(Gpu::Device::warp_size)]]
{
f(Gpu::Handler{&item,shared_data.get_pointer()});
f(Gpu::Handler{&item,shared_data.get_multi_ptr<sycl::access::decorated::yes>().get()});
});
});
} catch (sycl::exception const& ex) {
Expand Down Expand Up @@ -82,7 +82,7 @@ void launch (int nblocks, std::size_t shared_mem_bytes, gpuStream_t stream,
[[sycl::reqd_work_group_size(1,1,MT)]]
[[sycl::reqd_sub_group_size(Gpu::Device::warp_size)]]
{
f(Gpu::Handler{&item,shared_data.get_pointer()});
f(Gpu::Handler{&item,shared_data.get_multi_ptr<sycl::access::decorated::yes>().get()});
});
});
} catch (sycl::exception const& ex) {
Expand Down Expand Up @@ -210,7 +210,7 @@ void ParallelFor (Gpu::KernelInfo const& info, T n, L&& f) noexcept
i < n; i += stride) {
int n_active_threads = amrex::min(n-i+(T)item.get_local_id(0),
(T)item.get_local_range(0));
detail::call_f(f, i, Gpu::Handler{&item, shared_data.get_pointer(),
detail::call_f(f, i, Gpu::Handler{&item, shared_data.get_multi_ptr<sycl::access::decorated::yes>().get(),
n_active_threads});
}
});
Expand Down Expand Up @@ -269,7 +269,7 @@ void ParallelFor (Gpu::KernelInfo const& info, Box const& box, L&& f) noexcept
k += lo.z;
int n_active_threads = amrex::min(ncells-icell+(int)item.get_local_id(0),
(int)item.get_local_range(0));
detail::call_f(f, i, j, k, Gpu::Handler{&item, shared_data.get_pointer(),
detail::call_f(f, i, j, k, Gpu::Handler{&item, shared_data.get_multi_ptr<sycl::access::decorated::yes>().get(),
n_active_threads});
}
});
Expand Down Expand Up @@ -335,7 +335,7 @@ void ParallelFor (Gpu::KernelInfo const& info, Box const& box, T ncomp, L&& f) n
int n_active_threads = amrex::min(ncells-icell+(int)item.get_local_id(0),
(int)item.get_local_range(0));
detail::call_f(f, i, j, k, ncomp,
Gpu::Handler{&item, shared_data.get_pointer(),
Gpu::Handler{&item, shared_data.get_multi_ptr<sycl::access::decorated::yes>().get(),
n_active_threads});
}
});
Expand Down

0 comments on commit 15a0bb9

Please sign in to comment.