Skip to content

Commit e6d7896

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

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -1739,6 +1739,9 @@ static void ggml_backend_opencl_synchronize(ggml_backend_t backend) {
17391739
// enqueued to it won't start until commands in the other devices have
17401740
// completed.
17411741
static void sync_with_other_backends(ggml_backend_opencl_context * backend_ctx) {
1742+
if (g_ggml_backend_opencl_devices.size() < 2)
1743+
return; // No other devices to synchronize with.
1744+
17421745
std::vector<cl_event> events;
17431746
events.reserve(g_ggml_backend_opencl_devices.size());
17441747

0 commit comments

Comments
 (0)