Commit 84250b88e for llama.cpp
commit 84250b88eeceb457539fa0b2ce7a420e2100d098
Author: Francisco Javier <web@inode64.com>
Date: Sun Nov 29 19:19:13 2026 +0100
hip: fix CU_CHECK macro shadowing causing infinite loop with VMM (#33227)
* hip: fix CU_CHECK macro shadowing causing infinite loop with VMM
* hip: fix CU_CHECK macro to prevent infinite loop
diff --git a/ggml/src/ggml-cuda/vendors/hip.h b/ggml/src/ggml-cuda/vendors/hip.h
index a97233c1e..e4382db86 100644
--- a/ggml/src/ggml-cuda/vendors/hip.h
+++ b/ggml/src/ggml-cuda/vendors/hip.h
@@ -31,7 +31,7 @@ typedef uint64_t ggml_cuda_thread_mask_t;
#define CU_MEM_ALLOCATION_TYPE_PINNED hipMemAllocationTypePinned
#define CU_MEM_LOCATION_TYPE_DEVICE hipMemLocationTypeDevice
#define CU_MEM_ACCESS_FLAGS_PROT_READWRITE hipMemAccessFlagsProtReadWrite
-#define CU_CHECK(fn) {hipError_t err = fn; if(err != hipSuccess) { GGML_ABORT("HipVMM Failure: %s\n", hipGetErrorString(err)); }}
+#define CU_CHECK(fn) do { hipError_t err_ = (fn); if (err_ != hipSuccess) { GGML_ABORT("HipVMM Failure: %s\n", hipGetErrorString(err_)); } } while (0)
#define cublasStrsmBatched hipblasStrsmBatched
#define cublasCreate hipblasCreate
#define cublasDestroy hipblasDestroy