@@ -1336,7 +1336,7 @@ inline static void ggml_vec_mul_f32 (const int n, float * z, const float * x, co
1336
1336
inline static void ggml_vec_div_f32 (const int n , float * z , const float * x , const float * y ) { for (int i = 0 ; i < n ; ++ i ) z [i ] = x [i ]/y [i ]; }
1337
1337
1338
1338
inline static void ggml_vec_dot_f32 (const int n , float * restrict s , const float * restrict x , const float * restrict y ) {
1339
- ggml_float sumf = 0.0 ;
1339
+ float sumf = 0.0f ;
1340
1340
1341
1341
#ifdef GGML_SIMD
1342
1342
const int np = (n & ~(GGML_F32_STEP - 1 ));
@@ -1360,12 +1360,12 @@ inline static void ggml_vec_dot_f32(const int n, float * restrict s, const float
1360
1360
1361
1361
// leftovers
1362
1362
for (int i = np ; i < n ; ++ i ) {
1363
- sumf += ( ggml_float )( x [i ]* y [i ]) ;
1363
+ sumf += x [i ]* y [i ];
1364
1364
}
1365
1365
#else
1366
1366
// scalar
1367
1367
for (int i = 0 ; i < n ; ++ i ) {
1368
- sumf += ( ggml_float )( x [i ]* y [i ]) ;
1368
+ sumf += x [i ]* y [i ];
1369
1369
}
1370
1370
#endif
1371
1371
@@ -1414,7 +1414,7 @@ static inline __m512 dot_q4_0_oneblock_avx512(
1414
1414
#endif
1415
1415
1416
1416
inline static void ggml_vec_dot_f16 (const int n , float * restrict s , ggml_fp16_t * restrict x , ggml_fp16_t * restrict y ) {
1417
- ggml_float sumf = 0.0 ;
1417
+ float sumf = 0.0f ;
1418
1418
1419
1419
#if defined(GGML_SIMD )
1420
1420
const int np = (n & ~(GGML_F16_STEP - 1 ));
@@ -1438,11 +1438,11 @@ inline static void ggml_vec_dot_f16(const int n, float * restrict s, ggml_fp16_t
1438
1438
1439
1439
// leftovers
1440
1440
for (int i = np ; i < n ; ++ i ) {
1441
- sumf += ( ggml_float )( GGML_FP16_TO_FP32 (x [i ])* GGML_FP16_TO_FP32 (y [i ]) );
1441
+ sumf += GGML_FP16_TO_FP32 (x [i ])* GGML_FP16_TO_FP32 (y [i ]);
1442
1442
}
1443
1443
#else
1444
1444
for (int i = 0 ; i < n ; ++ i ) {
1445
- sumf += ( ggml_float )( GGML_FP16_TO_FP32 (x [i ])* GGML_FP16_TO_FP32 (y [i ]) );
1445
+ sumf += GGML_FP16_TO_FP32 (x [i ])* GGML_FP16_TO_FP32 (y [i ]);
1446
1446
}
1447
1447
#endif
1448
1448
@@ -1899,7 +1899,7 @@ inline static void ggml_vec_dot_q4_1(const int n, float * restrict s, const void
1899
1899
// compute GGML_VEC_DOT_UNROLL dot products at once
1900
1900
// xs - x row stride in bytes
1901
1901
inline static void ggml_vec_dot_f16_unroll (const int n , const int xs , float * restrict s , void * restrict xv , ggml_fp16_t * restrict y ) {
1902
- ggml_float sumf [GGML_VEC_DOT_UNROLL ] = { 0.0 };
1902
+ float sumf [GGML_VEC_DOT_UNROLL ] = { 0.0f };
1903
1903
1904
1904
ggml_fp16_t * restrict x [GGML_VEC_DOT_UNROLL ];
1905
1905
@@ -1935,13 +1935,13 @@ inline static void ggml_vec_dot_f16_unroll(const int n, const int xs, float * re
1935
1935
// leftovers
1936
1936
for (int i = np ; i < n ; ++ i ) {
1937
1937
for (int j = 0 ; j < GGML_VEC_DOT_UNROLL ; ++ j ) {
1938
- sumf [j ] += ( ggml_float )( GGML_FP16_TO_FP32 (x [j ][i ])* GGML_FP16_TO_FP32 (y [i ]) );
1938
+ sumf [j ] += GGML_FP16_TO_FP32 (x [j ][i ])* GGML_FP16_TO_FP32 (y [i ]);
1939
1939
}
1940
1940
}
1941
1941
#else
1942
1942
for (int i = 0 ; i < n ; ++ i ) {
1943
1943
for (int j = 0 ; j < GGML_VEC_DOT_UNROLL ; ++ j ) {
1944
- sumf [j ] += ( ggml_float )( GGML_FP16_TO_FP32 (x [j ][i ])* GGML_FP16_TO_FP32 (y [i ]) );
1944
+ sumf [j ] += GGML_FP16_TO_FP32 (x [j ][i ])* GGML_FP16_TO_FP32 (y [i ]);
1945
1945
}
1946
1946
}
1947
1947
#endif
@@ -2663,7 +2663,7 @@ struct ggml_context * ggml_init(struct ggml_init_params params) {
2663
2663
const float f = table_f32_f16 [i ] = GGML_COMPUTE_FP16_TO_FP32 (ii );
2664
2664
table_gelu_f16 [i ] = GGML_FP32_TO_FP16 (ggml_gelu_f32 (f ));
2665
2665
table_silu_f16 [i ] = GGML_FP32_TO_FP16 (ggml_silu_f32 (f ));
2666
- table_exp_f16 [i ] = GGML_FP32_TO_FP16 (exp (f ));
2666
+ table_exp_f16 [i ] = GGML_FP32_TO_FP16 (expf (f ));
2667
2667
}
2668
2668
2669
2669
const uint64_t t_end = ggml_time_us (); UNUSED (t_end );
0 commit comments