Skip to content

Commit

Permalink
CMake build elf without PTX (#3739)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-mo authored Mar 30, 2024
1 parent 3ad438c commit 51c31bc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,12 @@ macro(override_gpu_arches GPU_ARCHES GPU_LANG GPU_SUPPORTED_ARCHES)
endif()

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})
else()
# -virtual suffix let CMake to generate ptx code for the kernels.
set(_VIRT "-virtual")
set(_CODE_ARCH ${_CODE})
endif()
Expand Down

0 comments on commit 51c31bc

Please sign in to comment.