Merge pull request #24131 from cudawarped:cuda_add_default_ptx

`cuda`: update default PTX behaviour when `CUDA_ARCH_BIN` is unset
This commit is contained in:
Alexander Smorkalov 2023-09-14 15:00:34 +03:00 committed by GitHub
commit ec1c0608bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,7 +228,7 @@ if(CUDA_FOUND)
endif()
endmacro()
set(__cuda_arch_ptx "")
set(__cuda_arch_ptx ${CUDA_ARCH_PTX})
if(CUDA_GENERATION STREQUAL "Fermi")
set(__cuda_arch_bin ${_arch_fermi})
elseif(CUDA_GENERATION STREQUAL "Kepler")
@ -259,7 +259,7 @@ if(CUDA_FOUND)
set(__cuda_arch_bin ${CUDA_ARCH_BIN})
endif()
if(NOT DEFINED __cuda_arch_bin)
if(NOT DEFINED __cuda_arch_bin AND NOT DEFINED __cuda_arch_ptx)
if(ARM)
set(__cuda_arch_bin "3.2")
set(__cuda_arch_ptx "")
@ -295,6 +295,7 @@ if(CUDA_FOUND)
${_arch_lovelace}
${_arch_hopper}
)
list(GET __cuda_arch_bin -1 __cuda_arch_ptx)
endif()
endif()