From 937f03f1434f08c6c8f486c9a6aa5745b2c4dee4 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 20 Jan 2024 09:14:57 -0500 Subject: [PATCH] cmake: fix setting `CMAKE_HIP_FLAGS` (#3155) Fix https://github.com/deepmodeling/deepmd-kit/discussions/2523#discussioncomment-8176469. [`CMAKE__FLAGS`](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS.html#variable:CMAKE_%3CLANG%3E_FLAGS) is a string, so when using `set`, we should use quotes. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- source/lib/src/gpu/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/lib/src/gpu/CMakeLists.txt b/source/lib/src/gpu/CMakeLists.txt index 5eb833e24d..3bd24cc620 100644 --- a/source/lib/src/gpu/CMakeLists.txt +++ b/source/lib/src/gpu/CMakeLists.txt @@ -73,9 +73,10 @@ elseif(USE_ROCM_TOOLKIT) message(STATUS "HIP major version is " ${hip_VERSION_MAJOR}) - set(CMAKE_HIP_FLAGS -fno-gpu-rdc ${CMAKE_HIP_FLAGS}) # --amdgpu-target=gfx906 + set(CMAKE_HIP_FLAGS "-fno-gpu-rdc ${CMAKE_HIP_FLAGS}" + )# --amdgpu-target=gfx906 if(hip_VERSION VERSION_LESS 3.5.1) - set(CMAKE_HIP_FLAGS -hc ${CMAKE_HIP_FLAGS}) + set(CMAKE_HIP_FLAGS "-hc ${CMAKE_HIP_FLAGS}") endif() file(GLOB SOURCE_FILES "*.cu")