From 2faad208aed95ce7c1fe7b8acc6e1ec0f23be7c9 Mon Sep 17 00:00:00 2001 From: JohannesGaessler Date: Sat, 19 Aug 2023 17:17:55 +0200 Subject: [PATCH] CUDA: fix __builtin_assume for CUDA < 11.2 --- ggml-cuda.cu | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ggml-cuda.cu b/ggml-cuda.cu index 5b415c646..08d452003 100644 --- a/ggml-cuda.cu +++ b/ggml-cuda.cu @@ -51,7 +51,14 @@ static_assert(sizeof(half) == sizeof(ggml_fp16_t), "wrong fp16 size"); exit(1); \ } \ } while (0) -#endif // CUDART_VERSION >= 11 +#endif // CUDART_VERSION >= 12000 + +// define nop for old CUDA versions to fix compilation issues +#if CUDART_VERSION < 11020 +__device__ void __builtin_assume(bool exp) { + (void) exp; +} +#endif // CUDART_VERSION < 11020 #ifdef GGML_CUDA_F16 typedef half dfloat; // dequantize float