Skip to content

Commit

Permalink
Update CMakeLists.txt to be compatible with latest cuda versions
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulPPelaez committed Dec 7, 2020
1 parent d9e8ab9 commit 9c132da
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
17 changes: 12 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,20 @@ if(NOT DONT_USE_CUDA)
if(CMAKE_CUDA_COMPILER)
enable_language(CUDA)
set(USE_CUDA ON)

set(CMAKE_CUDA_STANDARD 11)

if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11)
set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CXX_STANDARD 14)
else()
include_directories(src/third_party)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CUDA_STANDARD 11)
endif()
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_SEPARABLE_COMPILATION OFF)

execute_process(COMMAND bash ${PROJECT_SOURCE_DIR}/cmake/listArchs.sh OUTPUT_VARIABLE ARCHS)
set(CMAKE_CUDA_FLAGS ${ARCHS} ${CMAKE_CUDA_FLAGS})
#execute_process(COMMAND bash ${PROJECT_SOURCE_DIR}/cmake/listArchs.sh OUTPUT_VARIABLE ARCHS)
#set(CMAKE_CUDA_FLAGS ${ARCHS} ${CMAKE_CUDA_FLAGS})
endif()
endif()

Expand All @@ -44,6 +51,6 @@ endif()
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

include_directories(src/third_party)

add_subdirectory(src)

2 changes: 1 addition & 1 deletion src/NeighbourListGPU.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include"ParticleSorter.cuh"
#include<thrust/device_vector.h>
#include<thrust/host_vector.h>
#include"third_party/cub/cub.cuh"
#include"cub/cub.cuh"

#include<limits>

Expand Down
2 changes: 1 addition & 1 deletion src/ParticleSorter.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ REFERENCES:
#include"utils.cuh"
#include<thrust/device_vector.h>
#include<thrust/host_vector.h>
#include"third_party/cub/cub.cuh"
#include"cub/cub.cuh"

namespace gdr{

Expand Down

0 comments on commit 9c132da

Please sign in to comment.