File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 1
1
#define _GNU_SOURCE // Defines CLOCK_MONOTONIC on Linux
2
2
#define _CRT_SECURE_NO_DEPRECATE // Disables ridiculous "unsafe" warnigns on Windows
3
+ #define _USE_MATH_DEFINES // For M_PI on MSVC
3
4
4
5
#include "ggml.h"
5
6
@@ -12093,8 +12094,10 @@ static void ggml_compute_forward_clamp(
12093
12094
12094
12095
// ggml_compute_forward_rope
12095
12096
12097
+ #ifndef _MSC_VER
12096
12098
// use -ffast-math so MIN and MAX are optimized to vminss and vmaxss
12097
12099
__attribute__((optimize("-ffast-math"), always_inline))
12100
+ #endif
12098
12101
static inline float ggml_rope_ntkv2_ramp(const float low, const float high, const int i0) {
12099
12102
const float y = (i0 / 2 - low) / MIN(0.001f, high - low);
12100
12103
return 1 - MIN(1, MAX(0, y));
You can’t perform that action at this time.
0 commit comments