Skip to content

Commit 4c8ccb8

Browse files
authored
Merge pull request #331 from idefix-code/fixSyclConfig
Fix SYCL loop auto-configuration
2 parents eccab2d + e58f724 commit 4c8ccb8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/loop.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ typedef Kokkos::TeamPolicy<>::member_type member_type;
3434

3535
// Check if the user requested a specific loop unrolling strategy
3636
#if defined(LOOP_PATTERN_SIMD)
37+
// Check that Idefix Arrays can be assigned from SIMD loop
38+
static_assert(
39+
Kokkos::SpaceAccessibility<Kokkos::DefaultHostExecutionSpace::execution_space,
40+
Kokkos::DefaultExecutionSpace::memory_space>::accessible,
41+
"Idefix Arrays cannot be accessed from SIMD loop. You should try another loop pattern."
42+
);
3743
constexpr LoopPattern defaultLoop = LoopPattern::SIMDFOR;
3844
#elif defined(LOOP_PATTERN_1DRANGE)
3945
constexpr LoopPattern defaultLoop = LoopPattern::RANGE;
@@ -51,7 +57,16 @@ typedef Kokkos::TeamPolicy<>::member_type member_type;
5157
constexpr LoopPattern defaultLoop = LoopPattern::RANGE;
5258
#elif defined(KOKKOS_ENABLE_HIP)
5359
constexpr LoopPattern defaultLoop = LoopPattern::RANGE;
60+
#elif defined(KOKKOS_ENABLE_SYCL)
61+
constexpr LoopPattern defaultLoop = LoopPattern::RANGE;
5462
#elif defined(KOKKOS_ENABLE_SERIAL)
63+
// Check that Idefix Arrays can be assigned from SIMD loop
64+
static_assert(
65+
Kokkos::SpaceAccessibility<Kokkos::DefaultHostExecutionSpace::execution_space,
66+
Kokkos::DefaultExecutionSpace::memory_space>::accessible,
67+
"Idefix Arrays cannot be accessed from Host, but Device is unknown/untested. "
68+
"Ask the developers to add support."
69+
);
5570
constexpr LoopPattern defaultLoop = LoopPattern::SIMDFOR;
5671
#else
5772
#warning "Unknown target architeture: default to MDrange"

0 commit comments

Comments
 (0)