CMake build elf without PTX (#3739)

This commit is contained in:
Simon Mo 2024-03-29 18:53:08 -07:00 committed by GitHub
parent 3ad438c66f
commit 51c31bc10c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -240,9 +240,12 @@ macro(override_gpu_arches GPU_ARCHES GPU_LANG GPU_SUPPORTED_ARCHES)
endif() endif()
if (_SM) if (_SM)
set(_VIRT "") # -real suffix let CMake to only generate elf code for the kernels.
# we want this, otherwise the added ptx (default) will increase binary size.
set(_VIRT "-real")
set(_CODE_ARCH ${_SM}) set(_CODE_ARCH ${_SM})
else() else()
# -virtual suffix let CMake to generate ptx code for the kernels.
set(_VIRT "-virtual") set(_VIRT "-virtual")
set(_CODE_ARCH ${_CODE}) set(_CODE_ARCH ${_CODE})
endif() endif()