Skip to content

Commit

Permalink
Fix two tests for AMD unified memory archs
Browse files Browse the repository at this point in the history
  • Loading branch information
crtrott committed Mar 13, 2024
1 parent 237fe6d commit 534cc03
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions core/unit_test/hip/TestHIP_Spaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ TEST(hip, space_access) {
static_assert(!Kokkos::Impl::MemorySpaceAccess<Kokkos::HostSpace,
Kokkos::HIPSpace>::assignable);

#if !defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY)
static_assert(!Kokkos::Impl::MemorySpaceAccess<Kokkos::HostSpace,
Kokkos::HIPSpace>::accessible);
#else
static_assert(Kokkos::Impl::MemorySpaceAccess<Kokkos::HostSpace,
Kokkos::HIPSpace>::accessible);
#endif

static_assert(
!Kokkos::Impl::MemorySpaceAccess<Kokkos::HostSpace,
Expand Down Expand Up @@ -149,8 +154,13 @@ TEST(hip, space_access) {
Kokkos::SpaceAccessibility<Kokkos::HIP,
Kokkos::HIPManagedSpace>::accessible);

#if !defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY)
static_assert(!Kokkos::SpaceAccessibility<Kokkos::HostSpace,
Kokkos::HIPSpace>::accessible);
#else
static_assert(Kokkos::SpaceAccessibility<Kokkos::HostSpace,
Kokkos::HIPSpace>::accessible);
#endif

static_assert(
Kokkos::SpaceAccessibility<Kokkos::HostSpace,
Expand All @@ -160,8 +170,14 @@ TEST(hip, space_access) {
Kokkos::SpaceAccessibility<Kokkos::HostSpace,
Kokkos::HIPManagedSpace>::accessible);

#if !defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY)
static_assert(std::is_same<Kokkos::Impl::HostMirror<Kokkos::HIPSpace>::Space,
Kokkos::HostSpace>::value);
#else
static_assert(std::is_same<Kokkos::Impl::HostMirror<Kokkos::HIPSpace>::Space,
Kokkos::Device<Kokkos::HostSpace::execution_space,
Kokkos::HIPSpace>>::value);
#endif

static_assert(
std::is_same<Kokkos::Impl::HostMirror<Kokkos::HIPHostPinnedSpace>::Space,
Expand Down

0 comments on commit 534cc03

Please sign in to comment.