Skip to content

Commit 13bfdec

Browse files
authored
Bug fix for clamp_f32
When using tensors larger than 1d clamp operation does not work due to the restriction of returning if ith is not 0.
1 parent 369be55 commit 13bfdec

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ggml/src/ggml-cpu/ggml-cpu.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9083,9 +9083,6 @@ static void ggml_compute_forward_clamp_f32(
90839083
memcpy(&min, (float *) dst->op_params + 0, sizeof(float));
90849084
memcpy(&max, (float *) dst->op_params + 1, sizeof(float));
90859085

9086-
const int ith = params->ith;
9087-
const int nth = params->nth;
9088-
90899086
const int n = ggml_nrows(src0);
90909087
const int nc = src0->ne[0];
90919088

@@ -9098,7 +9095,7 @@ static void ggml_compute_forward_clamp_f32(
90989095
GGML_ASSERT( nb0 == sizeof(float));
90999096
GGML_ASSERT(nb00 == sizeof(float));
91009097

9101-
for (int j = ith; j < n; j += nth) {
9098+
for (int j = 0; j < n; j++) {
91029099
float * dst_ptr = (float *) ((char *) dst->data + j*nb1);
91039100
float * src0_ptr = (float *) ((char *) src0->data + j*nb01);
91049101

0 commit comments

Comments
 (0)