From bb1bd5e2b733fb3400c7ab5770c90367d7fd6a98 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 10 Jul 2024 20:26:57 +0200 Subject: [PATCH] cuda : suppress 'noreturn' warn in no_device_code This commit adds a while(true) loop to the no_device_code function in common.cuh. This is done to suppress the warning: ```console /ggml/src/ggml-cuda/template-instances/../common.cuh:346:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn] 346 | } | ^ ``` The motivation for this is to reduce the number of warnings when compilng with GGML_HIPBLAS=ON. Signed-off-by: Daniel Bevenius --- ggml/src/ggml-cuda/common.cuh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ggml/src/ggml-cuda/common.cuh b/ggml/src/ggml-cuda/common.cuh index 4ff06b871..209b0bc74 100644 --- a/ggml/src/ggml-cuda/common.cuh +++ b/ggml/src/ggml-cuda/common.cuh @@ -342,6 +342,9 @@ static __device__ void no_device_code( #endif // defined(GGML_USE_HIPBLAS) && defined(__HIP_PLATFORM_AMD__) __trap(); + // Suppress "function declared 'noreturn' but has a return statement" warning. + while(true); + GGML_UNUSED(no_device_code); // suppress unused function warning }