Skip to content

Commit

Permalink
Merge pull request #1277 from LLNL/task/white238/raja_deprecated
Browse files Browse the repository at this point in the history
Remove use of deprecated RAJA::loop_*
  • Loading branch information
white238 committed Feb 14, 2024
2 parents 4aded6c + 2de402b commit e7fad6a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/axom/core/execution/internal/seq_exec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ template <>
struct execution_space<SEQ_EXEC>
{
#ifdef AXOM_USE_RAJA
#if RAJA_VERSION_MAJOR > 2022
using loop_policy = RAJA::seq_exec;
using reduce_policy = RAJA::seq_reduce;
using atomic_policy = RAJA::seq_atomic;
#else
using loop_policy = RAJA::loop_exec;

using reduce_policy = RAJA::loop_reduce;
using atomic_policy = RAJA::loop_atomic;
#endif
#else
using loop_policy = void;
using reduce_policy = void;
Expand Down
6 changes: 6 additions & 0 deletions src/axom/core/tests/core_execution_space.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,15 @@ TEST(core_execution_space, check_seq_exec)

int allocator_id = axom::getUmpireResourceAllocatorID(umpire::resource::Host);
check_execution_mappings<axom::SEQ_EXEC,
#if RAJA_VERSION_MAJOR > 2022
RAJA::seq_exec,
RAJA::seq_reduce,
RAJA::seq_atomic,
#else
RAJA::loop_exec,
RAJA::loop_reduce,
RAJA::loop_atomic,
#endif
void>(allocator_id, IS_ASYNC, ON_DEVICE);
}

Expand Down
20 changes: 20 additions & 0 deletions src/axom/mint/execution/internal/structured_exec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,28 @@ struct structured_exec<SEQ_EXEC>
#ifdef AXOM_USE_RAJA
/* clang-format off */
using loop2d_policy = RAJA::KernelPolicy<
#if RAJA_VERSION_MAJOR > 2022
RAJA::statement::For< 1, RAJA::seq_exec, // j
RAJA::statement::For< 0, RAJA::seq_exec, // i
#else
RAJA::statement::For< 1, RAJA::loop_exec, // j
RAJA::statement::For< 0, RAJA::loop_exec, // i
#endif
RAJA::statement::Lambda< 0 >
> // END i
> // END j
>; // END kernel

using loop3d_policy = RAJA::KernelPolicy<
#if RAJA_VERSION_MAJOR > 2022
RAJA::statement::For< 2, RAJA::seq_exec, // k
RAJA::statement::For< 1, RAJA::seq_exec, // j
RAJA::statement::For< 0, RAJA::seq_exec, // i
#else
RAJA::statement::For< 2, RAJA::loop_exec, // k
RAJA::statement::For< 1, RAJA::loop_exec, // j
RAJA::statement::For< 0, RAJA::loop_exec, // i
#endif
RAJA::statement::Lambda< 0 >
> // END i
> // END j
Expand All @@ -82,16 +93,25 @@ struct structured_exec<OMP_EXEC>

using loop2d_policy = RAJA::KernelPolicy<
RAJA::statement::For< 1, RAJA::omp_parallel_for_exec, // j
#if RAJA_VERSION_MAJOR > 2022
RAJA::statement::For< 0, RAJA::seq_exec, // i
#else
RAJA::statement::For< 0, RAJA::loop_exec, // i
#endif
RAJA::statement::Lambda< 0 >
> // END i
> // END j
>; // END kernel

using loop3d_policy = RAJA::KernelPolicy<
RAJA::statement::For< 2, RAJA::omp_parallel_for_exec, // k
#if RAJA_VERSION_MAJOR > 2022
RAJA::statement::For< 1, RAJA::seq_exec, // j
RAJA::statement::For< 0, RAJA::seq_exec, // i
#else
RAJA::statement::For< 1, RAJA::loop_exec, // j
RAJA::statement::For< 0, RAJA::loop_exec, // i
#endif
RAJA::statement::Lambda< 0 >
> // END i
> // END j
Expand Down

0 comments on commit e7fad6a

Please sign in to comment.