SLIC_CUDA icon indicating copy to clipboard operation
SLIC_CUDA copied to clipboard

Set CUDA_COMPUTE_CAPABILITY

Open Yannnnnnnnnnnn opened this issue 5 years ago • 0 comments

Maybe it is not a good idea to set CUDA_COMPUTE_CAPABILITY manually, which may lead to some unexpected errors.

I change the code in CMake from

### CUDA CHECK 
find_package(CUDA REQUIRED)
set(CUDA_COMPUTE_CAPABILITY "52")
set(CUDA_GENERATE_CODE "arch=compute_${CUDA_COMPUTE_CAPABILITY},code=sm_${CUDA_COMPUTE_CAPABILITY}" CACHE STRING "Which GPU architectures to generate code for (each arch/code pair will be passed as --generate-code option to nvcc, separate multiple pairs by ;)")
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -arch compute_${CUDA_COMPUTE_CAPABILITY})

to

find_package(CUDA REQUIRED)

I tested this code and works.

Yannnnnnnnnnnn avatar Dec 09 '19 13:12 Yannnnnnnnnnnn