Skip to content

Commit

Permalink
Merge branch 'develop' into offload-ao-vgl
Browse files Browse the repository at this point in the history
  • Loading branch information
prckent committed Oct 30, 2023
2 parents 5f652be + 65eea1d commit 2d5f88d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/Platforms/ROCm/cuda2hip.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
#define cudaPointerAttributes hipPointerAttribute_t
#define cudaMemoryTypeHost hipMemoryTypeHost
#define cudaMemoryTypeDevice hipMemoryTypeDevice
#define cudaMemoryTypeManaged hipMemoryTypeManaged
#define cudaIpcGetMemHandle hipIpcGetMemHandle
#define cudaIpcMemHandle_t hipIpcMemHandle_t
#define cudaIpcMemLazyEnablePeerAccess hipIpcMemLazyEnablePeerAccess
Expand Down
20 changes: 10 additions & 10 deletions src/Platforms/tests/CUDA/test_CUDAallocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,39 @@ TEST_CASE("CUDA_allocators", "[CUDA]")
Vector<double, CUDAManagedAllocator<double>> vec(1024);
cudaPointerAttributes attr;
cudaErrorCheck(cudaPointerGetAttributes(&attr, vec.data()), "cudaPointerGetAttributes failed!");
#if (CUDART_VERSION >= 10000)
#if (CUDART_VERSION >= 10000 || HIP_VERSION_MAJOR >= 6)
REQUIRE(attr.type == cudaMemoryTypeManaged);
#endif
}
{ // CUDAAllocator
Vector<double, CUDAAllocator<double>> vec(1024);
cudaPointerAttributes attr;
cudaErrorCheck(cudaPointerGetAttributes(&attr, vec.data()), "cudaPointerGetAttributes failed!");
#if (CUDART_VERSION < 10000)
REQUIRE(attr.memoryType == cudaMemoryTypeDevice);
#else
#if (CUDART_VERSION >= 10000 || HIP_VERSION_MAJOR >= 6)
REQUIRE(attr.type == cudaMemoryTypeDevice);
#else
REQUIRE(attr.memoryType == cudaMemoryTypeDevice);
#endif
}
{ // CUDAHostAllocator
Vector<double, CUDAHostAllocator<double>> vec(1024);
cudaPointerAttributes attr;
cudaErrorCheck(cudaPointerGetAttributes(&attr, vec.data()), "cudaPointerGetAttributes failed!");
#if (CUDART_VERSION < 10000)
REQUIRE(attr.memoryType == cudaMemoryTypeHost);
#else
#if (CUDART_VERSION >= 10000 || HIP_VERSION_MAJOR >= 6)
REQUIRE(attr.type == cudaMemoryTypeHost);
#else
REQUIRE(attr.memoryType == cudaMemoryTypeHost);
#endif
}
#if !defined(QMC_DISABLE_HIP_HOST_REGISTER)
{ // CUDALockedPageAllocator
Vector<double, CUDALockedPageAllocator<double>> vec(1024);
cudaPointerAttributes attr;
cudaErrorCheck(cudaPointerGetAttributes(&attr, vec.data()), "cudaPointerGetAttributes failed!");
#if (CUDART_VERSION < 10000)
REQUIRE(attr.memoryType == cudaMemoryTypeHost);
#else
#if (CUDART_VERSION >= 10000 || HIP_VERSION_MAJOR >= 6)
REQUIRE(attr.type == cudaMemoryTypeHost);
#else
REQUIRE(attr.memoryType == cudaMemoryTypeHost);
#endif
Vector<double, CUDALockedPageAllocator<double>> vecb(vec);
}
Expand Down

0 comments on commit 2d5f88d

Please sign in to comment.