Define the implementaiton strings in each implementation header
This commit is contained in:
parent
7006871cbe
commit
a1cab96c57
@ -8,10 +8,10 @@ set(gpu-stream_VERSION_MINOR 0)
|
||||
|
||||
list(APPEND CMAKE_CXX_FLAGS --std=c++11)
|
||||
|
||||
configure_file(src/common.h.in src/common.h)
|
||||
|
||||
find_package(CUDA QUIET)
|
||||
if (${CUDA_FOUND})
|
||||
set(IMPLEMENTATION CUDA)
|
||||
configure_file(src/common.h.in src/common_cuda.h)
|
||||
cuda_add_executable(cuda.exe src/main.cpp src/CUDAStream.cu)
|
||||
target_compile_definitions(cuda.exe PUBLIC CUDA)
|
||||
else (${CUDA_FOUND})
|
||||
@ -20,8 +20,6 @@ endif (${CUDA_FOUND})
|
||||
|
||||
find_package(OpenCL QUIET)
|
||||
if (${OpenCL_FOUND})
|
||||
set(gpu-stream_IMPLEMENTATION OpenCL)
|
||||
configure_file(src/common.h.in src/common_ocl.h)
|
||||
add_executable(ocl.exe src/main.cpp src/OCLStream.cpp)
|
||||
target_compile_definitions(ocl.exe PUBLIC OCL)
|
||||
target_link_libraries(ocl.exe ${OpenCL_LIBRARY})
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
|
||||
#include "Stream.h"
|
||||
|
||||
#define IMPLEMENTATION_STRING "CUDA"
|
||||
|
||||
template <class T>
|
||||
class CUDAStream : public Stream<T>
|
||||
{
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
|
||||
#include "Stream.h"
|
||||
|
||||
#define IMPLEMENTATION_STRING "OpenCL"
|
||||
|
||||
template <class T>
|
||||
class OCLStream : public Stream<T>
|
||||
{
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
#define VERSION_STRING "@gpu-stream_VERSION_MAJOR@.@gpu-stream_VERSION_MINOR@"
|
||||
#define IMPLEMENTATION_STRING "@gpu-stream_IMPLEMENTATION@"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user