Skip to content

Commit 764b7c9

Browse files
committed
improve cpy f32
Change-Id: I5abe9e0e123cf2645efea3bd77a66fa991fda461
1 parent 7ff7550 commit 764b7c9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ggml/src/ggml-cpu/vec.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ inline static void ggml_vec_sub_f16 (const int n, ggml_fp16_t * z, const ggml_fp
8080
}
8181
}
8282
inline static void ggml_vec_set_f32 (const int n, float * x, const float v) { for (int i = 0; i < n; ++i) x[i] = v; }
83+
#ifdef GGML_USE_CPU_RISCV64_SPACEMIT
84+
inline static void ggml_vec_cpy_f32 (const int n, float * y, const float * x) {
85+
ggml_vec_cpy_rvv(y, x, n * sizeof(float));
86+
}
87+
#else
8388
inline static void ggml_vec_cpy_f32 (const int n, float * y, const float * x) { for (int i = 0; i < n; ++i) y[i] = x[i]; }
89+
#endif
8490
inline static void ggml_vec_neg_f32 (const int n, float * y, const float * x) { for (int i = 0; i < n; ++i) y[i] = -x[i]; }
8591
inline static void ggml_vec_neg_f16 (const int n, ggml_fp16_t * y, const ggml_fp16_t * x) {
8692
for (int i = 0; i < n; ++i) {

0 commit comments

Comments
 (0)