Skip to content

Commit 210a657

Browse files
authored
opencl: fix compiler warnings for non-adreno path (#23922)
* opencl: fix compiler warnings for non-adreno path * opencl: fix const cast warning
1 parent b8275a8 commit 210a657

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ struct ggml_backend_opencl_device_context {
380380
ADRENO_GPU_GEN adreno_gen = ADRENO_GPU_GEN::ADRENO_UNKNOWN;
381381

382382
std::regex *opfilter = nullptr; // regex of ops to not claim
383-
std::string opfilter_str; // regex string for opfilter
383+
std::string opfilter_str = ""; // regex string for opfilter
384384
size_t global_mem_size = 0;
385385
};
386386

@@ -6822,9 +6822,6 @@ static void ggml_backend_opencl_buffer_set_tensor(ggml_backend_buffer_t buffer,
68226822

68236823
cl_buffer_region region;
68246824

6825-
cl_uchar mask_0F = 0x0F;
6826-
cl_uchar mask_F0 = 0xF0;
6827-
68286825
#ifdef GGML_OPENCL_USE_ADRENO_KERNELS
68296826
// Adreno MoE Q6_K kernel needs special transposed layout
68306827
if (use_adreno_moe_kernels(backend_ctx, tensor)) {
@@ -6858,6 +6855,9 @@ static void ggml_backend_opencl_buffer_set_tensor(ggml_backend_buffer_t buffer,
68586855

68596856
cl_kernel kernel = backend_ctx->kernel_convert_block_q6_k_trans4_ns;
68606857

6858+
cl_uchar mask_0F = 0x0F;
6859+
cl_uchar mask_F0 = 0xF0;
6860+
68616861
int ne00 = tensor->ne[0];
68626862
int ne01 = tensor->ne[1];
68636863
int ne02 = tensor->ne[2];
@@ -6994,7 +6994,7 @@ static void ggml_backend_opencl_buffer_set_tensor(ggml_backend_buffer_t buffer,
69946994

69956995
cl_int err;
69966996
cl_mem data_device = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,
6997-
size, (void *) data, &err);
6997+
size, const_cast<void *>(data), &err);
69986998
CL_CHECK(err);
69996999

70007000
cl_kernel kernel = backend_ctx->kernel_convert_bf16_to_f16;
@@ -7782,9 +7782,6 @@ static void ggml_backend_opencl_buffer_get_tensor(ggml_backend_buffer_t buffer,
77827782
if (tensor->type == GGML_TYPE_Q6_K) {
77837783
ggml_tensor_extra_cl_q6_K * extra = (ggml_tensor_extra_cl_q6_K *)tensor->extra;
77847784

7785-
cl_uchar mask_0F = 0x0F;
7786-
cl_uchar mask_F0 = 0xF0;
7787-
77887785
#ifdef GGML_OPENCL_USE_ADRENO_KERNELS
77897786
if (use_adreno_moe_kernels(backend_ctx, tensor)) {
77907787
cl_int err;
@@ -7794,6 +7791,9 @@ static void ggml_backend_opencl_buffer_get_tensor(ggml_backend_buffer_t buffer,
77947791

77957792
cl_kernel kernel = backend_ctx->kernel_restore_block_q6_k_trans4_ns;
77967793

7794+
cl_uchar mask_0F = 0x0F;
7795+
cl_uchar mask_F0 = 0xF0;
7796+
77977797
int ne00 = tensor->ne[0];
77987798
int ne01 = tensor->ne[1];
77997799
int ne02 = tensor->ne[2];
@@ -14888,6 +14888,8 @@ static void ggml_cl_mul_mat_id(ggml_backend_t backend, const ggml_tensor * src0,
1488814888
const int ne1 = dst->ne[1];
1488914889
const int ne2 = dst->ne[2];
1489014890

14891+
GGML_UNUSED(ne2);
14892+
1489114893
const int r2 = ne12/ne02;
1489214894
const int r3 = ne13/ne03;
1489314895
const int dst_rows = ne20*ne21; // ne20 = n_used_experts, ne21 = n_rows
@@ -14902,6 +14904,8 @@ static void ggml_cl_mul_mat_id(ggml_backend_t backend, const ggml_tensor * src0,
1490214904
const int n_tile_size = 32;
1490314905
const int max_post_router_tile = (ne20 * ne21 / n_tile_size) + ne02;
1490414906

14907+
GGML_UNUSED(max_post_router_tile);
14908+
1490514909
cl_kernel kernel;
1490614910

1490714911
// subgroup mat vec

0 commit comments

Comments
 (0)