summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/clover/api/kernel.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/clover/api/kernel.cpp b/src/gallium/state_trackers/clover/api/kernel.cpp
index 73ba34abe8e..b665773d9ec 100644
--- a/src/gallium/state_trackers/clover/api/kernel.cpp
+++ b/src/gallium/state_trackers/clover/api/kernel.cpp
@@ -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);
}