Skip to content

Commit ca31c30

Browse files
committed
fixup: fix an error in sync_with_other_backends
... when there is only one OpenCL device available.
1 parent cb4161b commit ca31c30

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,9 @@ static void ggml_backend_opencl_synchronize(ggml_backend_t backend) {
12381238
// enqueued to it won't start until commands in the other devices have
12391239
// completed.
12401240
static void sync_with_other_backends(ggml_backend_opencl_context * backend_ctx) {
1241+
if (g_ggml_backend_opencl_devices.size() < 2)
1242+
return; // No other devices to synchronize with.
1243+
12411244
std::vector<cl_event> events;
12421245
events.reserve(g_ggml_backend_opencl_devices.size());
12431246

0 commit comments

Comments
 (0)