Skip to content

Commit 13b0a04

Browse files
danbevggerganov
authored andcommitted
whisper: remove MSVC warnings pragmas (whisper/3090)
* ggml : remove MSVC warnings pragmas This commit removes the MSVC-specific pragmas as these are now handled in ggml/CMakeLists.txt. * whisper : remove MSVC warning pragmas This commit removes the MSVC-specific pragmas. These are now handled in the ggml/CMakeLists.txt file.
1 parent bba9d94 commit 13b0a04

File tree

9 files changed

+2
-54
lines changed

9 files changed

+2
-54
lines changed

ggml/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@ if (MSVC)
366366
/wd4005 # Macro redefinition
367367
/wd4244 # Conversion from one type to another type, possible loss of data
368368
/wd4267 # Conversion from 'size_t' to a smaller type, possible loss of data
369+
/wd4996 # Disable POSIX deprecation warnings
370+
/wd4702 # Unreachable code warnings
369371
)
370372
function(disable_msvc_warnings target_name)
371373
if(TARGET ${target_name})

ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ static_assert(sizeof(block_iq4_nlx4) == 4 * sizeof(ggml_half) + QK4_NL * 2, "wro
7272

7373
#if defined(__GNUC__)
7474
#pragma GCC diagnostic ignored "-Woverlength-strings"
75-
#elif defined(_MSC_VER)
76-
#pragma warning(disable: 4244 4267) // possible loss of data
7775
#endif
7876

7977
#define UNUSED GGML_UNUSED

ggml/src/ggml-cpu/ggml-cpu-quants.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020
#define GROUP_MAX_EPS_IQ1_M 1e-7f
2121
#define GROUP_MAX_EPS_IQ1_S 1e-12f
2222

23-
#if defined(_MSC_VER)
24-
// disable "possible loss of data" to avoid warnings for hundreds of casts
25-
// we should just be careful :)
26-
#pragma warning(disable: 4244 4267)
27-
#endif
28-
2923
#define UNUSED GGML_UNUSED
3024

3125
// some compilers don't provide _mm256_set_m128i, e.g. gcc 7

ggml/src/ggml-cpu/ggml-cpu.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,6 @@
5050
#include "llamafile/sgemm.h"
5151
#endif
5252

53-
#if defined(_MSC_VER)
54-
// disable "possible loss of data" to avoid hundreds of casts
55-
// we should just be careful :)
56-
#pragma warning(disable: 4244 4267)
57-
58-
// disable POSIX deprecation warnings
59-
// these functions are never going away, anyway
60-
#pragma warning(disable: 4996)
61-
62-
// unreachable code because of multiple instances of code after GGML_ABORT
63-
#pragma warning(disable: 4702)
64-
#endif
65-
6653
// Note: once we move threading into a separate C++ file
6754
// will use std::hardware_destructive_interference_size instead of hardcoding it here
6855
// and we'll use C++ attribute syntax.

ggml/src/ggml-cpu/ops.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,6 @@
88

99
#include <float.h>
1010

11-
#if defined(_MSC_VER)
12-
// disable "possible loss of data" to avoid hundreds of casts
13-
// we should just be careful :)
14-
#pragma warning(disable: 4244 4267)
15-
16-
// disable POSIX deprecation warnings
17-
// these functions are never going away, anyway
18-
#pragma warning(disable: 4996)
19-
20-
// unreachable code because of multiple instances of code after GGML_ABORT
21-
#pragma warning(disable: 4702)
22-
#endif
23-
2411
// ggml_compute_forward_dup
2512

2613
static void ggml_compute_forward_dup_same_cont(

ggml/src/ggml-cpu/vec.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
#include <cassert>
44

5-
#if defined(_MSC_VER)
6-
// disable "possible loss of data" to avoid hundreds of casts
7-
// we should just be careful :)
8-
#pragma warning(disable: 4244 4267)
9-
#endif
10-
115
// precomputed gelu table for f16 (128 KB)
126
ggml_fp16_t ggml_table_gelu_f16[1 << 16];
137

ggml/src/ggml-cuda/common.cuh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ static int ggml_cuda_highest_compiled_arch(const int arch) {
130130

131131
#define MATRIX_ROW_PADDING 512 // last row of quant. matrices is a multiple of this to avoid out-of-bounds memory accesses
132132

133-
#if defined(_MSC_VER)
134-
#pragma warning(disable: 4244 4267) // possible loss of data
135-
#endif
136-
137133
#define GGML_CUDA_MAX_STREAMS 8
138134

139135
[[noreturn]]

ggml/src/ggml-quants.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
#define GROUP_MAX_EPS_IQ1_M 1e-7f
2020
#define GROUP_MAX_EPS_IQ1_S 1e-12f
2121

22-
#if defined(_MSC_VER)
23-
// disable "possible loss of data" to avoid warnings for hundreds of casts
24-
// we should just be careful :)
25-
#pragma warning(disable: 4244 4267)
26-
#endif
27-
2822
#define UNUSED GGML_UNUSED
2923

3024
// reference implementation for deterministic creation of model files

ggml/src/ggml-sycl/common.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ extern int g_ggml_sycl_disable_optimize;
8080
// max batch size to use MMQ kernels when tensor cores are available
8181
#define MMQ_MAX_BATCH_SIZE 32
8282

83-
#if defined(_MSC_VER)
84-
#pragma warning(disable : 4244 4267) // possible loss of data
85-
#endif
86-
8783
// dmmv = dequantize_mul_mat_vec
8884
#ifndef GGML_SYCL_DMMV_X
8985
#define GGML_SYCL_DMMV_X 32

0 commit comments

Comments
 (0)