Skip to content

LLM inference in C/C++

C++ ggml

CUDA: fix round issue, under MSVC the CPU and GPU agree (#30229)

Dante79e2e74eb110
diff --git a/ggml/src/ggml-cuda/unary.cu b/ggml/src/ggml-cuda/unary.cu
index 436fdfffb9..af839acd74 100644
--- a/ggml/src/ggml-cuda/unary.cu
+++ b/ggml/src/ggml-cuda/unary.cu
@@ -107,7 +107,7 @@ static __device__ __forceinline__ float op_ceil(float x) {
}
static __device__ __forceinline__ float op_round(float x) {
- return round(x);
+ return roundf(x);
}
static __device__ __forceinline__ float op_trunc(float x) {