]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ggml : fix warnings under MSVC (#1908)
authorHoward Su <redacted>
Sat, 17 Jun 2023 15:46:15 +0000 (23:46 +0800)
committerGitHub <redacted>
Sat, 17 Jun 2023 15:46:15 +0000 (18:46 +0300)
ggml-cuda.cu
ggml-opencl.cpp
llama.cpp

index 7edd1a9f8ef0a95220ebd2e3d16821825b403e50..fed2a7ce1095c3cd4fd489088aa75255d9c49b41 100644 (file)
 #include "ggml-cuda.h"
 #include "ggml.h"
 
+#if defined(_MSC_VER)
+#pragma warning(disable: 4244 4267) // possible loss of data
+#endif
+
 static_assert(sizeof(half) == sizeof(ggml_fp16_t), "wrong fp16 size");
 
 #define CUDA_CHECK(err)                                                                 \
index 1d4db96ee9b6117ede0a35bcdd81ff0cc7a7e37b..95f4cec6dd59cdc7b7ece51549420e355dfe3607 100644 (file)
 
 #include "ggml.h"
 
+#if defined(_MSC_VER)
+#pragma warning(disable: 4244 4267) // possible loss of data
+#endif
+
 #define CL_DMMV_BLOCK_SIZE 32
 
 #define MULTILINE_QUOTE(...) #__VA_ARGS__
index 81f047ed29819296c3c08eab130037b9e6d342a7..a50846f71c9108d65a5f70c75010f019adc8e030 100644 (file)
--- a/llama.cpp
+++ b/llama.cpp
@@ -1253,7 +1253,7 @@ static void llama_model_load_internal(
             vram_scratch = n_batch * MB;
             ggml_cuda_set_scratch_size(vram_scratch);
             if (n_gpu_layers > 0) {
-                fprintf(stderr, "%s: allocating batch_size x 1 MB = %ld MB VRAM for the scratch buffer\n",
+                fprintf(stderr, "%s: allocating batch_size x 1 MB = %zd MB VRAM for the scratch buffer\n",
                         __func__, vram_scratch / MB);
             }
         }