Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricchevalier19 committed May 29, 2024
1 parent 6673511 commit a6cd28e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
13 changes: 8 additions & 5 deletions containers/unit_tests/TestWithoutInitializing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@

/// 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";
#define GTEST_SKIP_IF_UNIFIED_MEMORY_SPACE \
if constexpr (std::is_same_v<typename TEST_EXECSPACE::memory_space, \
Kokkos::CudaSpace>) \
GTEST_SKIP() << "skipping since unified memory requires additional " \
"fences";
#else
#define GTEST_SKIP_IF_UNIFIED_MEMORY_SPACE
#endif
Expand Down Expand Up @@ -277,7 +280,7 @@ TEST(TEST_CATEGORY, resize_realloc_no_init_scatterview) {
using namespace Kokkos::Test::Tools;
listen_tool_events(Config::DisableAll(), Config::EnableKernels());
Kokkos::Experimental::ScatterView<
int*** * [1][2][3], typename TEST_EXECSPACE::array_layout, TEST_EXECSPACE>
int**** [1][2][3], typename TEST_EXECSPACE::array_layout, TEST_EXECSPACE>
bla("bla", 4, 5, 6, 7);

auto success = validate_absence(
Expand Down Expand Up @@ -309,7 +312,7 @@ TEST(TEST_CATEGORY, resize_realloc_no_alloc_scatterview) {
listen_tool_events(Config::DisableAll(), Config::EnableKernels(),
Config::EnableAllocs());
Kokkos::Experimental::ScatterView<
int*** * [1][2][3], typename TEST_EXECSPACE::array_layout, TEST_EXECSPACE>
int**** [1][2][3], typename TEST_EXECSPACE::array_layout, TEST_EXECSPACE>
bla("bla", 7, 6, 5, 4);

auto success = validate_absence(
Expand Down Expand Up @@ -340,7 +343,7 @@ TEST(TEST_CATEGORY, resize_exec_space_scatterview) {
listen_tool_events(Config::DisableAll(), Config::EnableFences(),
Config::EnableKernels());
Kokkos::Experimental::ScatterView<
int*** * [1][2][3], typename TEST_EXECSPACE::array_layout, TEST_EXECSPACE>
int**** [1][2][3], typename TEST_EXECSPACE::array_layout, TEST_EXECSPACE>
bla("bla", 7, 6, 5, 4);

auto success = validate_absence(
Expand Down
9 changes: 6 additions & 3 deletions core/src/Cuda/Kokkos_CudaSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <algorithm>
#include <atomic>

// #include <Cuda/Kokkos_Cuda_BlockSize_Deduction.hpp>
#include <impl/Kokkos_Error.hpp>

#include <impl/Kokkos_Tools.hpp>
Expand Down Expand Up @@ -187,12 +186,16 @@ void *impl_allocate_common(const int device_id,
#elif defined(KOKKOS_ENABLE_IMPL_CUDA_EMULATE_UNIFIED_MEMORY)
// This is inteded to simulate Grace-Hopper like behavior
error_code = cudaMallocManaged(&ptr, arg_alloc_size, cudaMemAttachGlobal);
KOKKOS_IMPL_CUDA_SAFE_CALL(cudaDeviceSynchronize());
if (error_code == cudaSuccess) {
KOKKOS_IMPL_CUDA_SAFE_CALL(cudaDeviceSynchronize());
}
#elif defined(KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY)
// This is intended for Grace-Hopper (and future unified memory architectures)
// The idea is to use host allocator and then advise to keep it in HBM on
// device, but that requires CUDA 12.2
static_assert(CUDART_VERSION >= 12020);
static_assert(CUDART_VERSION >= 12020,
"CUDA runtime version >=12.2 required when "
"Kokkos_ENABLE_IMPL_CUDA_UNIFIED_MEMORY is set");
if (arg_alloc_size) { // cudaMemAdvise_v2 does not work with nullptr
ptr = malloc(arg_alloc_size);
if (ptr != nullptr) {
Expand Down

0 comments on commit a6cd28e

Please sign in to comment.