Skip to content

Commit 82eeea5

Browse files
Remove sycl::nd_item<1> from TagParallelFor interface (#4646)
This PR removes the `sycl::nd_item<1>` that `detail::ParallelFor_doit` passes into the function it was called with. As far as I can tell #4515 removed the last usage of the nd item.
1 parent 3b96137 commit 82eeea5

File tree

2 files changed

+5
-52
lines changed

2 files changed

+5
-52
lines changed

Src/Base/AMReX_FBI.H

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ fab_to_fab (Vector<Array4CopyTag<T0, T1> > const& copy_tags, int scomp, int dcom
5757

5858
detail::ParallelFor_doit(tv,
5959
[=] AMREX_GPU_DEVICE (
60-
#ifdef AMREX_USE_SYCL
61-
sycl::nd_item<1> const& /*item*/,
62-
#endif
6360
int icell, int ncells, int i, int j, int k, Array4CopyTag<T0, T1> const& tag) noexcept
6461
{
6562
if (icell < ncells) {
@@ -331,9 +328,6 @@ FabArray<FAB>::FB_local_copy_gpu (const FB& TheFB, int scomp, int ncomp)
331328

332329
detail::ParallelFor_doit(*tv,
333330
[=] AMREX_GPU_DEVICE (
334-
#ifdef AMREX_USE_SYCL
335-
sycl::nd_item<1> const& /*item*/,
336-
#endif
337331
int icell, int ncells, int i, int j, int k, TagType const& tag) noexcept
338332
{
339333
if (icell < ncells) {
@@ -868,9 +862,6 @@ FabArray<FAB>::pack_send_buffer_gpu (FabArray<FAB> const& src, int scomp, int nc
868862

869863
detail::ParallelFor_doit(*tv,
870864
[=] AMREX_GPU_DEVICE (
871-
#ifdef AMREX_USE_SYCL
872-
sycl::nd_item<1> const& /*item*/,
873-
#endif
874865
int icell, int ncells, int i, int j, int k, TagType const& tag) noexcept
875866
{
876867
if (icell < ncells) {
@@ -982,9 +973,6 @@ FabArray<FAB>::unpack_recv_buffer_gpu (FabArray<FAB>& dst, int dcomp, int ncomp,
982973
{
983974
detail::ParallelFor_doit(*tv,
984975
[=] AMREX_GPU_DEVICE (
985-
#ifdef AMREX_USE_SYCL
986-
sycl::nd_item<1> const& /*item*/,
987-
#endif
988976
int icell, int ncells, int i, int j, int k, TagType const& tag) noexcept
989977
{
990978
if (icell < ncells) {
@@ -1001,9 +989,6 @@ FabArray<FAB>::unpack_recv_buffer_gpu (FabArray<FAB>& dst, int dcomp, int ncomp,
1001989
if (is_thread_safe) {
1002990
detail::ParallelFor_doit(*tv,
1003991
[=] AMREX_GPU_DEVICE (
1004-
#ifdef AMREX_USE_SYCL
1005-
sycl::nd_item<1> const& /*item*/,
1006-
#endif
1007992
int icell, int ncells, int i, int j, int k, TagType const& tag) noexcept
1008993
{
1009994
if (icell < ncells) {
@@ -1018,9 +1003,6 @@ FabArray<FAB>::unpack_recv_buffer_gpu (FabArray<FAB>& dst, int dcomp, int ncomp,
10181003
if constexpr (amrex::HasAtomicAdd<value_type>::value) {
10191004
detail::ParallelFor_doit(*tv,
10201005
[=] AMREX_GPU_DEVICE (
1021-
#ifdef AMREX_USE_SYCL
1022-
sycl::nd_item<1> const& /*item*/,
1023-
#endif
10241006
int icell, int ncells, int i, int j, int k, TagType const& tag) noexcept
10251007
{
10261008
if (icell < ncells) {

Src/Base/AMReX_TagParallelFor.H

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,7 @@ namespace detail {
308308
template <typename T, typename F>
309309
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
310310
std::enable_if_t<std::is_same_v<std::decay_t<decltype(std::declval<T>().box())>, Box>, void>
311-
tagparfor_call_f (
312-
#ifdef AMREX_USE_SYCL
313-
sycl::nd_item<1> const& item,
314-
#endif
315-
int icell, T const& tag, F&& f) noexcept
311+
tagparfor_call_f (int icell, T const& tag, F&& f) noexcept
316312
{
317313
int ncells = tag.box().numPts();
318314
const auto len = amrex::length(tag.box());
@@ -323,28 +319,16 @@ tagparfor_call_f (
323319
i += lo.x;
324320
j += lo.y;
325321
k += lo.z;
326-
#ifdef AMREX_USE_SYCL
327-
f(item, icell, ncells, i, j, k, tag);
328-
#else
329-
f( icell, ncells, i, j, k, tag);
330-
#endif
322+
f(icell, ncells, i, j, k, tag);
331323
}
332324

333325
template <typename T, typename F>
334326
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
335327
std::enable_if_t<std::is_integral_v<std::decay_t<decltype(std::declval<T>().size())> >, void>
336-
tagparfor_call_f (
337-
#ifdef AMREX_USE_SYCL
338-
sycl::nd_item<1> const& item,
339-
#endif
340-
int i, T const& tag, F&& f) noexcept
328+
tagparfor_call_f (int i, T const& tag, F&& f) noexcept
341329
{
342330
int N = tag.size();
343-
#ifdef AMREX_USE_SYCL
344-
f(item, i, N, tag);
345-
#else
346-
f( i, N, tag);
347-
#endif
331+
f(i, N, tag);
348332
}
349333

350334
template <class TagType, class F>
@@ -388,11 +372,7 @@ ParallelFor_doit (TagVector<TagType> const& tv, F const& f)
388372
#endif
389373
int icell = b_wid*Gpu::Device::warp_size + lane;
390374

391-
#ifdef AMREX_USE_SYCL
392-
tagparfor_call_f(item, icell, d_tags[tag_id], f);
393-
#else
394-
tagparfor_call_f( icell, d_tags[tag_id], f);
395-
#endif
375+
tagparfor_call_f(icell, d_tags[tag_id], f);
396376
});
397377
}
398378

@@ -454,9 +434,6 @@ ParallelFor (TagVector<TagType> const& tv, int ncomp, F const& f)
454434
{
455435
detail::ParallelFor_doit(tv,
456436
[=] AMREX_GPU_DEVICE (
457-
#ifdef AMREX_USE_SYCL
458-
sycl::nd_item<1> const& /*item*/,
459-
#endif
460437
int icell, int ncells, int i, int j, int k, TagType const& tag) noexcept
461438
{
462439
if (icell < ncells) {
@@ -473,9 +450,6 @@ ParallelFor (TagVector<TagType> const& tv, F const& f)
473450
{
474451
detail::ParallelFor_doit(tv,
475452
[=] AMREX_GPU_DEVICE (
476-
#ifdef AMREX_USE_SYCL
477-
sycl::nd_item<1> const& /*item*/,
478-
#endif
479453
int icell, int ncells, int i, int j, int k, TagType const& tag) noexcept
480454
{
481455
if (icell < ncells) {
@@ -490,9 +464,6 @@ ParallelFor (TagVector<TagType> const& tv, F const& f)
490464
{
491465
detail::ParallelFor_doit(tv,
492466
[=] AMREX_GPU_DEVICE (
493-
#ifdef AMREX_USE_SYCL
494-
sycl::nd_item<1> const& /*item*/,
495-
#endif
496467
int icell, int ncells, TagType const& tag) noexcept
497468
{
498469
if (icell < ncells) {

0 commit comments

Comments
 (0)