move dup call into the actual add_at functions

This commit is contained in:
xaedes 2023-04-28 20:30:42 +02:00
parent 3dbd649cf9
commit 7281f60572
No known key found for this signature in database
GPG key ID: 30030EDD817EA2B1

9
ggml.c
View file

@ -7948,6 +7948,8 @@ static void ggml_compute_forward_add_at_f32(
// GGML_ASSERT(ggml_are_same_shape(src0, src1)); // TODO: assert that offset+len(src1) <= len(src1)
GGML_ASSERT(ggml_are_same_shape(src0, dst));
ggml_compute_forward_dup_same_cont(params, src0, dst);
if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) {
return;
}
@ -8007,6 +8009,8 @@ static void ggml_compute_forward_add_at_f16_f32(
// GGML_ASSERT(ggml_are_same_shape(src0, src1)); // TODO: assert that offset+len(src1) <= len(src1)
GGML_ASSERT(ggml_are_same_shape(src0, dst));
ggml_compute_forward_dup_same_cont(params, src0, dst);
if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) {
return;
}
@ -8058,6 +8062,8 @@ static void ggml_compute_forward_add_at_f16_f16(
// GGML_ASSERT(ggml_are_same_shape(src0, src1)); // TODO: assert that offset+len(src1) <= len(src1)
GGML_ASSERT(ggml_are_same_shape(src0, dst));
ggml_compute_forward_dup_same_cont(params, src0, dst);
if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) {
return;
}
@ -8109,6 +8115,8 @@ static void ggml_compute_forward_add_at_q_f32(
// GGML_ASSERT(ggml_are_same_shape(src0, src1)); // TODO: assert that offset+len(src1) <= len(src1)
GGML_ASSERT(ggml_are_same_shape(src0, dst));
ggml_compute_forward_dup_same_cont(params, src0, dst);
if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) {
return;
}
@ -8217,7 +8225,6 @@ static void ggml_compute_forward_add_at(
struct ggml_tensor * dst) {
size_t offset;
memcpy(&offset, dst->padding, sizeof(offset));
ggml_compute_forward_dup_same_cont(params, src0, dst);
switch (src0->type) {
case GGML_TYPE_F32:
{