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 8b194f0 commit c1d908e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion containers/unit_tests/TestWithoutInitializing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
///@}

/// Some tests are skipped for unified memory space.
#if defined(KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY)
#if defined(KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY) || defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY)
#define GTEST_SKIP_IF_UNIFIED_MEMORY_SPACE \
GTEST_SKIP() << "skipping since unified memory requires additional fences";
#else
Expand Down
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 c1d908e

Please sign in to comment.