Skip to content

Commit 51c31bc

Browse files
authored
CMake build elf without PTX (#3739)
1 parent 3ad438c commit 51c31bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/utils.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,12 @@ macro(override_gpu_arches GPU_ARCHES GPU_LANG GPU_SUPPORTED_ARCHES)
240240
endif()
241241

242242
if (_SM)
243-
set(_VIRT "")
243+
# -real suffix let CMake to only generate elf code for the kernels.
244+
# we want this, otherwise the added ptx (default) will increase binary size.
245+
set(_VIRT "-real")
244246
set(_CODE_ARCH ${_SM})
245247
else()
248+
# -virtual suffix let CMake to generate ptx code for the kernels.
246249
set(_VIRT "-virtual")
247250
set(_CODE_ARCH ${_CODE})
248251
endif()

0 commit comments

Comments
 (0)