Fix MEM flag for CUDA, resolves #163

This commit is contained in:
Tom Lin 2023-09-25 01:39:23 +01:00
parent 29b03be572
commit bd6bb09b5d
3 changed files with 9 additions and 9 deletions

View File

@ -42,7 +42,13 @@ CUDAStream<T>::CUDAStream(const int ARRAY_SIZE, const int device_index)
// Print out device information // Print out device information
std::cout << "Using CUDA device " << getDeviceName(device_index) << std::endl; std::cout << "Using CUDA device " << getDeviceName(device_index) << std::endl;
std::cout << "Driver: " << getDeviceDriver(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; array_size = ARRAY_SIZE;
// Allocate the host array for partial sums for dot kernels // Allocate the host array for partial sums for dot kernels

View File

@ -13,13 +13,7 @@
#include "Stream.h" #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" #define IMPLEMENTATION_STRING "CUDA"
#endif
#define TBSIZE 1024 #define TBSIZE 1024
#define DOT_NUM_BLOCKS 1024 #define DOT_NUM_BLOCKS 1024

View File

@ -29,7 +29,7 @@ macro(setup)
endif() endif()
enable_language(CUDA) enable_language(CUDA)
register_definitions(MEM=${MEM}) register_definitions(${MEM})
# add -forward-unknown-to-host-compiler for compatibility reasons # 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}) set(CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS} "-forward-unknown-to-host-compiler -arch=${CUDA_ARCH}" ${CUDA_EXTRA_FLAGS})