Skip to content

Commit dbe0c3b

Browse files
committed
opencl: fix size calculation when creating image1d_buffer_t
1 parent a69591a commit dbe0c3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3461,7 +3461,7 @@ static void ggml_backend_opencl_buffer_set_tensor(ggml_backend_buffer_t buffer,
34613461
cl_image_format img_format_q = {CL_RG, CL_UNSIGNED_INT32};
34623462
cl_image_desc img_desc_q = {
34633463
CL_MEM_OBJECT_IMAGE1D_BUFFER,
3464-
static_cast<size_t>(tensor->ne[0] * tensor->ne[1] * tensor->ne[2] / 32 * 2),
3464+
static_cast<size_t>(ggml_nelements(tensor)/32*2),
34653465
0, 0, 0, 0, 0, 0, 0,
34663466
{ extra->q }
34673467
};

0 commit comments

Comments
 (0)