1346 {
1347 cl_uint num_devices;
1349 "Failed to get OpenCL context info" );
1350 if ( !num_devices )
1352 cl_device_id *device_list = (cl_device_id *)alloca( num_devices*sizeof( cl_device_id ) );
1353 enforce_cl_retcode( clGetContextInfo(
my_factory.context(), CL_CONTEXT_DEVICES, num_devices*
sizeof( cl_device_id ), device_list, NULL ),
1354 "Failed to get OpenCL context info" );
1355 const char *options = NULL;
1359 const char *
s[] = { fr.content() };
1360 const size_t l[] = { fr.length() };
1361 cl_int err;
1364 opencl_device_filter(
1365 num_devices, device_list,
1366 [](
const opencl_device&
d ) ->
bool {
1367 return !
d.compiler_available() || !
d.linker_available();
1368 }, "No one device supports building program from sources" );
1369 opencl_program_builder(
1371 options, NULL, NULL );
1372 break;
1373 }
1375 options = "-x spir";
1378 std::vector<const unsigned char*>
s(
1379 num_devices, reinterpret_cast<const unsigned char*>(fr.content()) );
1380 std::vector<size_t> l( num_devices, fr.length() );
1381 std::vector<cl_int> bin_statuses( num_devices, -1 );
1382 cl_int err;
1384 device_list, l.data(),
s.data(),
1385 bin_statuses.data(), &err );
1386 if( err != CL_SUCCESS ) {
1387 std::string statuses_str;
1388 for (auto st = bin_statuses.begin(); st != bin_statuses.end(); ++st) {
1389 statuses_str += std::to_string((*st));
1390 }
1391
1393 std::string( ", binary_statuses = " ) + statuses_str );
1394 }
1395 opencl_program_builder(
1397 options, NULL, NULL );
1398 break;
1399 }
1400 default:
1402 }
1403 }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
void const char const char int ITT_FORMAT __itt_group_sync s
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