@@ -351,14 +351,14 @@ inline static void ggml_vec_mad_f32_unroll(const int n, const int xs, const int
351351#endif
352352}
353353
354- inline static void ggml_vec_mad1_f32 (const int n , float * y , const float s , const float b ) {
354+ inline static void ggml_vec_mad1_f32 (const int n , float * y , const float * x , const float s , const float b ) {
355355#if defined(GGML_USE_ACCELERATE )
356- vDSP_vsmsa (y , 1 , & s , & b , y , 1 , n );
356+ vDSP_vsmsa (x , 1 , & s , & b , y , 1 , n );
357357#elif defined(GGML_SIMD )
358358 #if defined(__ARM_FEATURE_SVE )
359359 // scalar ; TODO: Write SVE code
360360 for (int i = 0 ; i < n ; ++ i ) {
361- y [i ] = y [i ]* s + b ;
361+ y [i ] = x [i ]* s + b ;
362362 }
363363 #else
364364 const int np = (n & ~(GGML_F32_STEP - 1 ));
@@ -370,7 +370,7 @@ inline static void ggml_vec_mad1_f32(const int n, float * y, const float s, cons
370370
371371 for (int i = 0 ; i < np ; i += GGML_F32_STEP ) {
372372 for (int j = 0 ; j < GGML_F32_ARR ; j ++ ) {
373- ay [j ] = GGML_F32_VEC_LOAD (y + i + j * GGML_F32_EPR );
373+ ay [j ] = GGML_F32_VEC_LOAD (x + i + j * GGML_F32_EPR );
374374 ay [j ] = GGML_F32_VEC_FMA (ay [j ], vs , vb );
375375
376376 GGML_F32_VEC_STORE (y + i + j * GGML_F32_EPR , ay [j ]);
@@ -379,13 +379,13 @@ inline static void ggml_vec_mad1_f32(const int n, float * y, const float s, cons
379379
380380 // leftovers
381381 for (int i = np ; i < n ; ++ i ) {
382- y [i ] = y [i ]* s + b ;
382+ y [i ] = x [i ]* s + b ;
383383 }
384384 #endif
385385#else
386386 // scalar
387387 for (int i = 0 ; i < n ; ++ i ) {
388- y [i ] = y [i ]* s + b ;
388+ y [i ] = x [i ]* s + b ;
389389 }
390390#endif
391391}
0 commit comments