From 8e6e2fbe1458ac91387266241262294a964d6b95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=A4=C3=9Fler?= Date: Mon, 9 Sep 2024 14:22:53 +0200 Subject: [PATCH] CUDA: fix variable name conflict for Windows build (#9382) --- ggml/src/ggml-cuda/sum.cu | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ggml/src/ggml-cuda/sum.cu b/ggml/src/ggml-cuda/sum.cu index 0d5e953eeeb33..21da635099078 100644 --- a/ggml/src/ggml-cuda/sum.cu +++ b/ggml/src/ggml-cuda/sum.cu @@ -1,13 +1,15 @@ -#include "sumrows.cuh" -#include "sum.cuh" - -#include - #if !defined(GGML_USE_HIPBLAS) && !defined(GGML_USE_MUSA) +// On Windows CUB uses libraries with variables called CC_PASCAL which conflict with the define in common.cuh. +// For this reason CUB must be included BEFORE anything else. #include using namespace cub; #endif // !defined(GGML_USE_HIPBLAS) && !defined(GGML_USE_MUSA) +#include "sumrows.cuh" +#include "sum.cuh" + +#include + void sum_f32_cuda(ggml_cuda_pool & pool, const float * x, float * dst, const int64_t ne, cudaStream_t stream) { #if !defined(GGML_USE_HIPBLAS) && !defined(GGML_USE_MUSA) size_t tmp_size = 0;