Skip to content

Commit 4ffc389

Browse files
linehillmglambda
authored andcommitted
opencl : fix ulong kernel args were set from int variables (ggml-org#12174)
... which left garbage bits in the upper half of the kernel args. This caused segmentation faults when running PoCL.
1 parent 6818e6b commit 4ffc389

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ggml/src/ggml-opencl/ggml-opencl.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3765,10 +3765,10 @@ static void ggml_cl_rope(ggml_backend_t backend, const ggml_tensor * src0, const
37653765
const int ne02 = src0 ? src0->ne[2] : 0;
37663766
const int ne03 = src0 ? src0->ne[3] : 0;
37673767

3768-
const int nb00 = src0 ? src0->nb[0] : 0;
3769-
const int nb01 = src0 ? src0->nb[1] : 0;
3770-
const int nb02 = src0 ? src0->nb[2] : 0;
3771-
const int nb03 = src0 ? src0->nb[3] : 0;
3768+
const cl_ulong nb00 = src0 ? src0->nb[0] : 0;
3769+
const cl_ulong nb01 = src0 ? src0->nb[1] : 0;
3770+
const cl_ulong nb02 = src0 ? src0->nb[2] : 0;
3771+
const cl_ulong nb03 = src0 ? src0->nb[3] : 0;
37723772

37733773
const int ne10 = src1 ? src1->ne[0] : 0;
37743774
const int ne11 = src1 ? src1->ne[1] : 0; UNUSED(ne11);
@@ -3780,10 +3780,10 @@ static void ggml_cl_rope(ggml_backend_t backend, const ggml_tensor * src0, const
37803780
const int ne2 = dst ? dst->ne[2] : 0;
37813781
const int ne3 = dst ? dst->ne[3] : 0;
37823782

3783-
const int nb0 = dst ? dst->nb[0] : 0;
3784-
const int nb1 = dst ? dst->nb[1] : 0;
3785-
const int nb2 = dst ? dst->nb[2] : 0;
3786-
const int nb3 = dst ? dst->nb[3] : 0;
3783+
const cl_ulong nb0 = dst ? dst->nb[0] : 0;
3784+
const cl_ulong nb1 = dst ? dst->nb[1] : 0;
3785+
const cl_ulong nb2 = dst ? dst->nb[2] : 0;
3786+
const cl_ulong nb3 = dst ? dst->nb[3] : 0;
37873787

37883788
GGML_ASSERT(ne10 % ne02 == 0);
37893789
GGML_ASSERT(ne10 >= ne02);

0 commit comments

Comments
 (0)