mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 13:00:21 +01:00
clover: Check for executables before enqueueing a kernel
Without this check, the kernel::bind() method would fail with a std::out_of_range exception, letting an exception escape from the library into the client, rather than returning the corresponding error code CL_INVALID_PROGRAM_EXECUTABLE. Signed-off-by: Pierre Moreau <pierre.morrow@free.fr> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
parent
c17b2f5724
commit
4e0d171d7e
1 changed files with 4 additions and 1 deletions
|
|
@ -215,7 +215,10 @@ namespace {
|
|||
}, kern.args()))
|
||||
throw error(CL_INVALID_KERNEL_ARGS);
|
||||
|
||||
if (!count(q.device(), kern.program().devices()))
|
||||
// If the command queue's device is not associated to the program, we get
|
||||
// a module, with no sections, which will also fail the following test.
|
||||
auto &m = kern.program().build(q.device()).binary;
|
||||
if (!any_of(type_equals(module::section::text_executable), m.secs))
|
||||
throw error(CL_INVALID_PROGRAM_EXECUTABLE);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue