Skip to content

Commit 32d6b24

Browse files
committed
fix: add workgroup size hack and comment out context release for stability on certain devices
1 parent cb3822c commit 32d6b24

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,9 @@ struct ggml_backend_opencl_context {
548548
}
549549

550550
size_t get_kernel_workgroup_size(cl_kernel kernel) const {
551+
// FIXME: hack, some phones crash when trying to get work group info
552+
return 8;
553+
551554
size_t workgroup_size = 0;
552555
size_t ret_size = 0;
553556
CL_CHECK(
@@ -2200,7 +2203,8 @@ static void ggml_cl2_free(ggml_backend_t backend) {
22002203
}
22012204

22022205
if (should_release_opencl) {
2203-
CL_CHECK(clReleaseContext(ctx->context));
2206+
// FIXME: hack, some phones crash when releasing the context
2207+
//CL_CHECK(clReleaseContext(ctx->context));
22042208
}
22052209
}
22062210

@@ -7433,4 +7437,4 @@ bool ggml_cl_compute_forward(ggml_backend_t backend, struct ggml_tensor * tensor
74337437

74347438
func(backend, tensor->src[0], tensor->src[1], tensor);
74357439
return true;
7436-
}
7440+
}

0 commit comments

Comments
 (0)