From 154fbd03ccb326317dcfdfe193083d121ef70ece Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Tue, 17 Jul 2018 02:07:45 -0400 Subject: [PATCH] clover: Report error when pipe driver fails to create compute state CC: Signed-off-by: Jan Vesely Reviewed-by: Francisco Jerez --- src/gallium/state_trackers/clover/core/kernel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp index 47167053231..dab7ef8683a 100644 --- a/src/gallium/state_trackers/clover/core/kernel.cpp +++ b/src/gallium/state_trackers/clover/core/kernel.cpp @@ -231,6 +231,10 @@ kernel::exec_context::bind(intrusive_ptr _q, cs.req_local_mem = mem_local; cs.req_input_mem = input.size(); st = q->pipe->create_compute_state(q->pipe, &cs); + if (!st) { + unbind(); // Cleanup + throw error(CL_OUT_OF_RESOURCES); + } } return st; -- 2.30.2