File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
sycl/source/detail/program_manager Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -197,22 +197,27 @@ static bool isDeviceBinaryTypeSupported(const context &C,
197
197
if (Format != PI_DEVICE_BINARY_TYPE_SPIRV)
198
198
return true ;
199
199
200
+ vector_class<device> Devices = C.get_devices ();
201
+
202
+ // Program type is SPIR-V, so we need a device compiler to do JIT.
203
+ for (const device &D : Devices) {
204
+ if (!D.get_info <info::device::is_compiler_available>())
205
+ return false ;
206
+ }
207
+
200
208
// OpenCL 2.1 and greater require clCreateProgramWithIL
201
209
if (pi::useBackend (pi::SYCL_BE_PI_OPENCL) &&
202
210
C.get_platform ().get_info <info::platform::version>() >= " 2.1" )
203
211
return true ;
204
212
205
- for (const device &D : C. get_devices () ) {
213
+ for (const device &D : Devices ) {
206
214
// We need cl_khr_il_program extension to be present
207
215
// and we can call clCreateProgramWithILKHR using the extension
208
216
vector_class<string_class> Extensions =
209
217
D.get_info <info::device::extensions>();
210
218
if (Extensions.end () ==
211
219
std::find (Extensions.begin (), Extensions.end (), " cl_khr_il_program" ))
212
220
return false ;
213
-
214
- if (!D.get_info <info::device::is_compiler_available>())
215
- return false ;
216
221
}
217
222
218
223
return true ;
You can’t perform that action at this time.
0 commit comments