]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
opencl: limit local workgroup size for GLU operation (#26383)
authormgroeber9110 <redacted>
Sun, 2 Aug 2026 18:44:00 +0000 (20:44 +0200)
committerGitHub <redacted>
Sun, 2 Aug 2026 18:44:00 +0000 (11:44 -0700)
ggml/src/ggml-opencl/ggml-opencl.cpp

index 388c585fa1210be0311da9e751a91ccd0f4ae6c4..915c8e7b903f9e68605ff1cb8c2d4c0c90fe2eff 100644 (file)
@@ -24260,7 +24260,7 @@ static void ggml_cl_glu(ggml_backend_t backend, const ggml_tensor * src0, const
     }
 
     const size_t nrows = ggml_nrows(src0);
-    size_t nth = 512;
+    size_t nth = backend_ctx->max_workgroup_size < 512 ? backend_ctx->max_workgroup_size : 512;
     size_t global_work_size[] = {nrows*nth, 1, 1};
     size_t local_work_size[] = {nth, 1, 1};