Skip to content

Commit

Permalink
respect user defined CUDAARCHS (#2979)
Browse files Browse the repository at this point in the history
Although we set it to `all` by default, one may manually set it via
[CMAKE_CUDA_ARCHITECTURES](https://cmake.org/cmake/help/latest/variable/CMAKE_CUDA_ARCHITECTURES.html)
or
[CUDAARCHS](https://cmake.org/cmake/help/latest/envvar/CUDAARCHS.html#envvar:CUDAARCHS).

Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz authored Nov 7, 2023
1 parent 7fb94ef commit ffbdcf8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/lib/src/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ if(USE_CUDA_TOOLKIT)
project(deepmd_op_cuda)
set(GPU_LIB_NAME deepmd_op_cuda)

set(CMAKE_CUDA_ARCHITECTURES all)
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES all)
endif()
enable_language(CUDA)
set(CMAKE_CUDA_STANDARD 11)
add_compile_definitions(
Expand Down

0 comments on commit ffbdcf8

Please sign in to comment.