Skip to content

Commit

Permalink
Fix MEM flag for CUDA, resolves UoB-HPC#163
Browse files Browse the repository at this point in the history
  • Loading branch information
tom91136 authored and pranav-sivaraman committed Dec 7, 2023
1 parent 87abde4 commit 18dff8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 7 additions & 1 deletion src/cuda/CUDAStream.cu
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ CUDAStream<T>::CUDAStream(const int ARRAY_SIZE, const int device_index)
// Print out device information
std::cout << "Using CUDA device " << getDeviceName(device_index) << std::endl;
std::cout << "Driver: " << getDeviceDriver(device_index) << std::endl;

#if defined(MANAGED)
std::cout << "Memory: MANAGED" << std::endl;
#elif defined(PAGEFAULT)
std::cout << "Memory: PAGEFAULT" << std::endl;
#else
std::cout << "Memory: DEFAULT" << std::endl;
#endif
array_size = ARRAY_SIZE;

// Allocate the host array for partial sums for dot kernels
Expand Down
8 changes: 1 addition & 7 deletions src/cuda/CUDAStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@

#include "Stream.h"

#if defined(PAGEFAULT)
#define IMPLEMENTATION_STRING "CUDA - Page Fault"
#elif defined(MANAGED)
#define IMPLEMENTATION_STRING "CUDA - Managed Memory"
#else
#define IMPLEMENTATION_STRING "CUDA"
#endif
#define IMPLEMENTATION_STRING "CUDA"

#define TBSIZE 1024
#define DOT_NUM_BLOCKS 1024
Expand Down
2 changes: 1 addition & 1 deletion src/cuda/model.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ macro(setup)
endif()

enable_language(CUDA)
register_definitions(MEM=${MEM})
register_definitions(${MEM})

# add -forward-unknown-to-host-compiler for compatibility reasons
set(CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS} "-forward-unknown-to-host-compiler -arch=${CUDA_ARCH}" ${CUDA_EXTRA_FLAGS})
Expand Down

0 comments on commit 18dff8e

Please sign in to comment.