From: uvos Date: Thu, 12 Mar 2026 02:37:10 +0000 (+0100) Subject: hip: compile debug builds with -O2 on hip to avoid a compiler bug (#20392) X-Git-Tag: upstream/0.0.8611~306 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=d63aa398de455cf8243802c5099dc30a2e26edcc;p=pkg%2Fggml%2Fsources%2Fllama.cpp hip: compile debug builds with -O2 on hip to avoid a compiler bug (#20392) --- diff --git a/ggml/src/ggml-hip/CMakeLists.txt b/ggml/src/ggml-hip/CMakeLists.txt index 80037d243..b44ed0f72 100644 --- a/ggml/src/ggml-hip/CMakeLists.txt +++ b/ggml/src/ggml-hip/CMakeLists.txt @@ -11,6 +11,10 @@ endif() list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) list(APPEND CMAKE_PREFIX_PATH "${ROCM_PATH}/lib64/cmake") +if (NOT DEFINED CMAKE_HIP_FLAGS_DEBUG) + set(CMAKE_HIP_FLAGS_DEBUG "-g -O2") +endif() + # CMake on Windows doesn't support the HIP language yet if (WIN32) set(CXX_IS_HIPCC TRUE)