diff --git a/ggml-opencl.c b/ggml-opencl.c index d06c2566e..46de53581 100644 --- a/ggml-opencl.c +++ b/ggml-opencl.c @@ -3,9 +3,10 @@ #define CL_TARGET_OPENCL_VERSION 110 #include +#include #include #include -#include + #include "ggml.h" @@ -337,7 +338,8 @@ void ggml_cl_sgemm_wrapper( cl_host_b = (cl_block_q5_0*) malloc(sizeof(cl_block_q5_0) * global / 32); for (size_t i = 0; i < global / 32; i++) { cl_host_b[i].d = ggml_fp16_to_fp32(b[i].d); - memcpy(&cl_host_b[i].qh, b[i].qh, sizeof(uint32_t) + QK5_0 / 2); + memcpy(&cl_host_b[i].qh, b[i].qh, sizeof(uint32_t)); + memcpy(&cl_host_b[i].qs, b[i].qs, QK5_0 / 2); } host_b = (const float*) cl_host_b; size_qb = global * (sizeof(float) + sizeof(uint32_t) + local) / 32; @@ -422,4 +424,4 @@ void ggml_cl_sgemm_wrapper( if (btype == GGML_TYPE_Q5_0) { free((void*) cl_host_b); } -} \ No newline at end of file +}