From 51c31bc10ca7c48b580cd58fcd741ba4d6db4447 Mon Sep 17 00:00:00 2001 From: Simon Mo Date: Fri, 29 Mar 2024 18:53:08 -0700 Subject: [PATCH] CMake build elf without PTX (#3739) --- cmake/utils.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 8ac81bf2..6bf5d513 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -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()