mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-11-14 11:07:10 +00:00
will this fix cpu?
This commit is contained in:
@@ -4666,6 +4666,15 @@ static void ggml_compute_forward_scale_f32(
|
|||||||
|
|
||||||
const size_t nb1 = dst->nb[1];
|
const size_t nb1 = dst->nb[1];
|
||||||
|
|
||||||
|
if (b == 0.0f) {
|
||||||
|
for (int i1 = ir0; i1 < ir1; i1++) {
|
||||||
|
if (dst->data != src0->data) {
|
||||||
|
// src0 is same shape as dst => same indices
|
||||||
|
memcpy((char *)dst->data + i1*nb1, (char *)src0->data + i1*nb01, nc * sizeof(float));
|
||||||
|
}
|
||||||
|
ggml_vec_scale_f32(nc, (float *) ((char *) dst->data + i1*nb1), s);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
for (int i1 = ir0; i1 < ir1; i1++) {
|
for (int i1 = ir0; i1 < ir1; i1++) {
|
||||||
if (dst->data != src0->data) {
|
if (dst->data != src0->data) {
|
||||||
// src0 is same shape as dst => same indices
|
// src0 is same shape as dst => same indices
|
||||||
@@ -4674,6 +4683,7 @@ static void ggml_compute_forward_scale_f32(
|
|||||||
ggml_vec_mad1_f32(nc, (float *) ((char *) dst->data + i1*nb1), s, b);
|
ggml_vec_mad1_f32(nc, (float *) ((char *) dst->data + i1*nb1), s, b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ggml_compute_forward_scale(
|
void ggml_compute_forward_scale(
|
||||||
const ggml_compute_params * params,
|
const ggml_compute_params * params,
|
||||||
|
|||||||
Reference in New Issue
Block a user