]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
CUDA: fix variable name conflict for Windows build (llama/9382)
authorJohannes Gäßler <redacted>
Mon, 9 Sep 2024 12:22:53 +0000 (14:22 +0200)
committerGeorgi Gerganov <redacted>
Fri, 20 Sep 2024 19:03:57 +0000 (22:03 +0300)
src/ggml-cuda/sum.cu

index 0d5e953eeeb337008135a54a58e7efa97db2d8e1..21da635099078b7cf4df707556f406d7a91246fd 100644 (file)
@@ -1,13 +1,15 @@
-#include "sumrows.cuh"
-#include "sum.cuh"
-
-#include <cstdint>
-
 #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 <cub/cub.cuh>
 using namespace cub;
 #endif // !defined(GGML_USE_HIPBLAS) && !defined(GGML_USE_MUSA)
 
+#include "sumrows.cuh"
+#include "sum.cuh"
+
+#include <cstdint>
+
 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;