1334 cl_uint num_devices;
1336 "Failed to get OpenCL context info" );
1339 cl_device_id *device_list = (cl_device_id *)alloca( num_devices*
sizeof( cl_device_id ) );
1340 enforce_cl_retcode( clGetContextInfo(
my_factory.context(), CL_CONTEXT_DEVICES, num_devices*
sizeof( cl_device_id ), device_list, NULL ),
1341 "Failed to get OpenCL context info" );
1342 const char *options = NULL;
1346 const char *
s[] = { fr.content() };
1347 const size_t l[] = { fr.length() };
1351 opencl_device_filter(
1352 num_devices, device_list,
1353 [](
const opencl_device&
d ) ->
bool {
1354 return !d.compiler_available() || !d.linker_available();
1355 },
"No one device supports building program from sources" );
1356 opencl_program_builder(
1358 options, NULL, NULL );
1362 options =
"-x spir";
1365 std::vector<const unsigned char*>
s(
1366 num_devices, reinterpret_cast<const unsigned char*>(fr.content()) );
1367 std::vector<size_t> l( num_devices, fr.length() );
1368 std::vector<cl_int> bin_statuses( num_devices, -1 );
1371 device_list, l.data(), s.data(),
1372 bin_statuses.data(), &err );
1373 if( err != CL_SUCCESS ) {
1374 std::string statuses_str;
1375 for (
auto st = bin_statuses.begin(); st != bin_statuses.end(); ++st) {
1376 statuses_str += std::to_string((*st));
1380 std::string(
", binary_statuses = " ) + statuses_str );
1382 opencl_program_builder(
1384 options, NULL, NULL );
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d
opencl_program_type my_type
void enforce_cl_retcode(cl_int err, std::string msg)
void const char const char int ITT_FORMAT __itt_group_sync s