@@ -317,7 +317,7 @@ struct ggml_backend_opencl_context {
317317 cl_program program_sum_rows_f32;
318318 cl_program program_repeat;
319319 cl_program program_pad;
320- cl_program program_unary ;
320+ cl_program program_tanh ;
321321 cl_program program_upscale;
322322 cl_program program_concat;
323323 cl_program program_tsembd;
@@ -1154,24 +1154,24 @@ static void load_cl_kernels(ggml_backend_opencl_context *backend_ctx, ggml_cl_ve
11541154 }
11551155 }
11561156
1157- // unary ( tanh)
1157+ // tanh
11581158 {
11591159#ifdef GGML_OPENCL_EMBED_KERNELS
11601160 const std::string kernel_src {
1161- #include " unary .cl.h"
1161+ #include " tanh .cl.h"
11621162 };
11631163#else
1164- const std::string kernel_src = read_file (" unary .cl" );
1164+ const std::string kernel_src = read_file (" tanh .cl" );
11651165#endif
11661166 if (!kernel_src.empty ()) {
1167- backend_ctx->program_unary =
1167+ backend_ctx->program_tanh =
11681168 build_program_from_source (backend_ctx->context , backend_ctx->device , kernel_src.c_str (), compile_opts);
1169- CL_CHECK ((backend_ctx->kernel_tanh_f32_nd = clCreateKernel (backend_ctx->program_unary , " kernel_tanh_f32_nd" , &err), err));
1170- CL_CHECK ((backend_ctx->kernel_tanh_f16_nd = clCreateKernel (backend_ctx->program_unary , " kernel_tanh_f16_nd" , &err), err));
1169+ CL_CHECK ((backend_ctx->kernel_tanh_f32_nd = clCreateKernel (backend_ctx->program_tanh , " kernel_tanh_f32_nd" , &err), err));
1170+ CL_CHECK ((backend_ctx->kernel_tanh_f16_nd = clCreateKernel (backend_ctx->program_tanh , " kernel_tanh_f16_nd" , &err), err));
11711171 GGML_LOG_CONT (" ." );
11721172 } else {
1173- GGML_LOG_WARN (" ggml_opencl: unary kernel source not found or empty. Unary operations like tanh will not be available.\n " );
1174- backend_ctx->program_unary = nullptr ;
1173+ GGML_LOG_WARN (" ggml_opencl: tanh kernel source not found or empty. Tanh operation will not be available.\n " );
1174+ backend_ctx->program_tanh = nullptr ;
11751175 backend_ctx->kernel_tanh_f32_nd = nullptr ;
11761176 backend_ctx->kernel_tanh_f16_nd = nullptr ;
11771177 }
@@ -2150,7 +2150,7 @@ static bool ggml_opencl_supports_op(ggml_backend_dev_t dev, const struct ggml_te
21502150 case GGML_OP_NORM:
21512151 case GGML_OP_RMS_NORM:
21522152 return true ;
2153- case GGML_OP_REPEAT:
2153+ case GGML_OP_REPEAT:
21542154 return op->src [0 ]->type == GGML_TYPE_F32 && op->type == GGML_TYPE_F32; // Assuming F32 for now, can be expanded
21552155 case GGML_OP_PAD:
21562156 return op->src [0 ]->type == GGML_TYPE_F32 && op->type == GGML_TYPE_F32 &&
0 commit comments