1347 cl_uint num_devices;
1349 "Failed to get OpenCL context info" );
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() };
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 );
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 );
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));
1393 std::string(
", binary_statuses = " ) + statuses_str );
1395 opencl_program_builder(
1397 options, NULL, NULL );
opencl_program_type my_type
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
void const char const char int ITT_FORMAT __itt_group_sync s
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
void enforce_cl_retcode(cl_int err, std::string msg)