Update ggml-opencl.cpp for readability using division instead of shift

Co-authored-by: Jared Van Bortel <cebtenzzre@gmail.com>
This commit is contained in:
Albert Jin 2024-05-09 10:44:34 +08:00 committed by GitHub
parent 93f8d471c1
commit 0e968fac53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2119,7 +2119,7 @@ static size_t ggml_backend_opencl_buffer_type_get_alignment(ggml_backend_buffer_
if (alignment == (cl_uint)-1) { if (alignment == (cl_uint)-1) {
ggml_cl_init(); ggml_cl_init();
clGetDeviceInfo(device, CL_DEVICE_MEM_BASE_ADDR_ALIGN, sizeof(cl_uint), &alignment, NULL); clGetDeviceInfo(device, CL_DEVICE_MEM_BASE_ADDR_ALIGN, sizeof(cl_uint), &alignment, NULL);
alignment >>= 3; alignment /= 8; // bits to bytes
} }
return alignment; return alignment;