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 <daniel.bevenius@gmail.com>
This commit is contained in:
Daniel Bevenius 2024-07-10 20:26:57 +02:00
parent dd07a123b7
commit bb1bd5e2b7
Failed to extract signature

View file

@ -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
}