ggerganov commited on
Commit
2117da6
·
unverified ·
1 Parent(s): 4b10327

ggml : define MIN / MAX only if not defined (minor)

Browse files
Files changed (4) hide show
  1. bindings/ios +1 -1
  2. ggml.c +5 -3
  3. whisper.cpp +2 -3
  4. whisper.h +1 -1
bindings/ios CHANGED
@@ -1 +1 @@
1
- Subproject commit 1502317fe050c1d5ae1a81082153b8f00d50d9cd
 
1
+ Subproject commit 6707f1ea1caa7ee5e9b6908101fe98775e582cff
ggml.c CHANGED
@@ -88,9 +88,6 @@ typedef void* thread_ret_t;
88
  #define GGML_MEM_ALIGN 16
89
  #endif
90
 
91
- #define MAX(a, b) ((a) > (b) ? (a) : (b))
92
- #define MIN(a, b) ((a) < (b) ? (a) : (b))
93
-
94
  #define UNUSED(x) (void)(x)
95
  #define SWAP(x, y, T) do { T SWAP = x; x = y; y = SWAP; } while (0)
96
 
@@ -108,6 +105,11 @@ typedef void* thread_ret_t;
108
  #include <cblas.h>
109
  #endif
110
 
 
 
 
 
 
111
  // floating point type used to accumulate sums
112
  typedef double ggml_float;
113
 
 
88
  #define GGML_MEM_ALIGN 16
89
  #endif
90
 
 
 
 
91
  #define UNUSED(x) (void)(x)
92
  #define SWAP(x, y, T) do { T SWAP = x; x = y; y = SWAP; } while (0)
93
 
 
105
  #include <cblas.h>
106
  #endif
107
 
108
+ #undef MIN
109
+ #undef MAX
110
+ #define MIN(a, b) ((a) < (b) ? (a) : (b))
111
+ #define MAX(a, b) ((a) > (b) ? (a) : (b))
112
+
113
  // floating point type used to accumulate sums
114
  typedef double ggml_float;
115
 
whisper.cpp CHANGED
@@ -435,9 +435,8 @@ struct whisper_context {
435
  };
436
 
437
  template<typename T>
438
- static void read_safe(std::ifstream& fin, T& dest)
439
- {
440
- fin.read((char*)& dest, sizeof(T));
441
  }
442
 
443
  // load the model from a ggml file
 
435
  };
436
 
437
  template<typename T>
438
+ static void read_safe(std::ifstream& fin, T& dest) {
439
+ fin.read((char*)& dest, sizeof(T));
 
440
  }
441
 
442
  // load the model from a ggml file
whisper.h CHANGED
@@ -148,7 +148,7 @@ extern "C" {
148
  struct whisper_context * ctx,
149
  const char * text,
150
  whisper_token * tokens,
151
- int n_max_tokens);
152
 
153
  // Largest language id (i.e. number of available languages - 1)
154
  WHISPER_API int whisper_lang_max_id();
 
148
  struct whisper_context * ctx,
149
  const char * text,
150
  whisper_token * tokens,
151
+ int n_max_tokens);
152
 
153
  // Largest language id (i.e. number of available languages - 1)
154
  WHISPER_API int whisper_lang_max_id();