Skip to content

Commit 8b26b81

Browse files
committed
Compress binary size with build flags
1 parent 9c1dff7 commit 8b26b81

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

.github/scripts/build-rocm.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ else
4444
cmake -G Ninja \
4545
-DCOMPUTE_BACKEND=hip \
4646
-DBNB_ROCM_ARCH="${bnb_rocm_arch}" \
47-
-DCMAKE_BUILD_TYPE=Release \
47+
-DCMAKE_BUILD_TYPE=MinSizeRel \
48+
-DCMAKE_HIP_FLAGS="--offload-compress" \
4849
-S .
49-
cmake --build . --config Release
50+
cmake --build .
5051
fi
5152

5253
output_dir="output/${build_os}/${build_arch}"

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ if(WIN32 AND COMPUTE_BACKEND STREQUAL "hip")
3838
"${ROCM_PATH}/lib/llvm/amdgcn/bitcode"
3939
NO_DEFAULT_PATH
4040
)
41-
set(CMAKE_HIP_FLAGS "--rocm-path=${ROCM_PATH}")
41+
string(APPEND CMAKE_HIP_FLAGS " --rocm-path=${ROCM_PATH}")
4242
if(ROCM_DEVICE_LIB_PATH)
43-
set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} --rocm-device-lib-path=${ROCM_DEVICE_LIB_PATH}")
43+
string(APPEND CMAKE_HIP_FLAGS " --rocm-device-lib-path=${ROCM_DEVICE_LIB_PATH}")
4444
endif()
4545
endif()
4646
endif()

0 commit comments

Comments
 (0)