Skip to content

Commit

Permalink
Set CUDA_ARCHITECTURES "all" (cmake-policy CMP0104)
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Nov 29, 2023
1 parent b804625 commit dff3a37
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion pybind_interface/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.18)
project(qsim LANGUAGES CXX CUDA)

if(WIN32)
Expand All @@ -22,6 +22,7 @@ include_directories(${PYTHON_INCLUDE_DIRS} ${pybind11_SOURCE_DIR}/include)

cuda_add_library(qsim_cuda MODULE pybind_main_cuda.cpp)
set_target_properties(qsim_cuda PROPERTIES
CUDA_ARCHITECTURES "all"
PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}"
)
Expand Down
4 changes: 2 additions & 2 deletions pybind_interface/custatevec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ cuda_add_library(qsim_custatevec MODULE pybind_main_custatevec.cpp)
target_link_libraries(qsim_custatevec -lcustatevec -lcublas)

set_target_properties(qsim_custatevec PROPERTIES
PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}"
PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}"
)
set_source_files_properties(pybind_main_custatevec.cpp PROPERTIES LANGUAGE CUDA)

Expand Down
11 changes: 6 additions & 5 deletions pybind_interface/decide/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.18)

if(WIN32)
set(CMAKE_CXX_FLAGS "/O2 /openmp")
Expand Down Expand Up @@ -26,8 +26,9 @@ if(has_nvcc)
find_package(Python3 3.7 REQUIRED COMPONENTS Interpreter Development)
include_directories(${PYTHON_INCLUDE_DIRS} ${pybind11_SOURCE_DIR}/include)
set_target_properties(qsim_decide PROPERTIES
PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}"
CUDA_ARCHITECTURES "all"
PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}"
)
set_source_files_properties(decide.cpp PROPERTIES LANGUAGE CUDA)
elseif(has_hipcc)
Expand All @@ -38,8 +39,8 @@ elseif(has_hipcc)
find_package(Python3 3.7 REQUIRED COMPONENTS Interpreter Development)
include_directories(${PYTHON_INCLUDE_DIRS} ${pybind11_SOURCE_DIR}/include)
set_target_properties(qsim_decide PROPERTIES
PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}"
PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}"
)
else()
pybind11_add_module(qsim_decide decide.cpp)
Expand Down

0 comments on commit dff3a37

Please sign in to comment.