From: Johannes Gäßler Date: Mon, 9 Sep 2024 12:22:53 +0000 (+0200) Subject: CUDA: fix variable name conflict for Windows build (llama/9382) X-Git-Tag: upstream/0.0.1642~381 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=5d89caf2bb920a72438d6c2455b3dbccef805d7d;p=pkg%2Fggml%2Fsources%2Fggml CUDA: fix variable name conflict for Windows build (llama/9382) --- diff --git a/src/ggml-cuda/sum.cu b/src/ggml-cuda/sum.cu index 0d5e953e..21da6350 100644 --- a/src/ggml-cuda/sum.cu +++ b/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;