Skip to content

Fix SYCL loop auto-configuration #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/loop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ typedef Kokkos::TeamPolicy<>::member_type member_type;

// Check if the user requested a specific loop unrolling strategy
#if defined(LOOP_PATTERN_SIMD)
// Check that Idefix Arrays can be assigned from SIMD loop
static_assert(
Kokkos::SpaceAccessibility<Kokkos::DefaultHostExecutionSpace::execution_space,
Kokkos::DefaultExecutionSpace::memory_space>::accessible,
"Idefix Arrays cannot be accessed from SIMD loop. You should try another loop pattern."
);
constexpr LoopPattern defaultLoop = LoopPattern::SIMDFOR;
#elif defined(LOOP_PATTERN_1DRANGE)
constexpr LoopPattern defaultLoop = LoopPattern::RANGE;
Expand All @@ -51,7 +57,16 @@ typedef Kokkos::TeamPolicy<>::member_type member_type;
constexpr LoopPattern defaultLoop = LoopPattern::RANGE;
#elif defined(KOKKOS_ENABLE_HIP)
constexpr LoopPattern defaultLoop = LoopPattern::RANGE;
#elif defined(KOKKOS_ENABLE_SYCL)
constexpr LoopPattern defaultLoop = LoopPattern::RANGE;
#elif defined(KOKKOS_ENABLE_SERIAL)
// Check that Idefix Arrays can be assigned from SIMD loop
static_assert(
Kokkos::SpaceAccessibility<Kokkos::DefaultHostExecutionSpace::execution_space,
Kokkos::DefaultExecutionSpace::memory_space>::accessible,
"Idefix Arrays cannot be accessed from Host, but Device is unknown/untested. "
"Ask the developers to add support."
);
constexpr LoopPattern defaultLoop = LoopPattern::SIMDFOR;
#else
#warning "Unknown target architeture: default to MDrange"
Expand Down