Skip to content

Commit

Permalink
Fix tests for Unified Memory option being on
Browse files Browse the repository at this point in the history
  • Loading branch information
crtrott committed Mar 4, 2024
1 parent f24357e commit f433545
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions containers/unit_tests/TestWithoutInitializing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@
#endif
///@}

/// Some tests are skipped for unified memory space.
///@{
#if defined(KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY)
#define GTEST_SKIP_IF_UNIFIED_MEMORY_SPACE \
GTEST_SKIP() << "skipping since unified memory requires additional fences";
#else
#define GTEST_SKIP_IF_UNIFIED_MEMORY_SPACE
#endif
///@}

TEST(TEST_CATEGORY, resize_realloc_no_init_dualview) {
using namespace Kokkos::Test::Tools;
listen_tool_events(Config::DisableAll(), Config::EnableKernels());
Expand Down Expand Up @@ -657,6 +667,7 @@ TEST(TEST_CATEGORY, create_mirror_no_init_dynamicview) {

TEST(TEST_CATEGORY, create_mirror_view_and_copy_dynamicview) {
GTEST_SKIP_IF_CUDAUVM_MEMORY_SPACE
GTEST_SKIP_IF_UNIFIED_MEMORY_SPACE

using namespace Kokkos::Test::Tools;
listen_tool_events(Config::DisableAll(), Config::EnableKernels(),
Expand Down
6 changes: 6 additions & 0 deletions core/unit_test/cuda/TestCuda_Spaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ TEST(cuda, space_access) {
!Kokkos::Impl::MemorySpaceAccess<Kokkos::HostSpace,
Kokkos::CudaSpace>::assignable);

#ifndef KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY
static_assert(
!Kokkos::Impl::MemorySpaceAccess<Kokkos::HostSpace,
Kokkos::CudaSpace>::accessible);
#endif

static_assert(
!Kokkos::Impl::MemorySpaceAccess<Kokkos::HostSpace,
Expand Down Expand Up @@ -147,8 +149,10 @@ TEST(cuda, space_access) {
Kokkos::SpaceAccessibility<Kokkos::Cuda,
Kokkos::CudaHostPinnedSpace>::accessible);

#ifndef KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY
static_assert(!Kokkos::SpaceAccessibility<Kokkos::HostSpace,
Kokkos::CudaSpace>::accessible);
#endif

static_assert(Kokkos::SpaceAccessibility<Kokkos::HostSpace,
Kokkos::CudaUVMSpace>::accessible);
Expand All @@ -157,8 +161,10 @@ TEST(cuda, space_access) {
Kokkos::SpaceAccessibility<Kokkos::HostSpace,
Kokkos::CudaHostPinnedSpace>::accessible);

#ifndef KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY
static_assert(std::is_same<Kokkos::Impl::HostMirror<Kokkos::CudaSpace>::Space,
Kokkos::HostSpace>::value);
#endif

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

0 comments on commit f433545

Please sign in to comment.