1330 cl_uint num_devices;
1332 "Failed to get OpenCL context info" );
1335 cl_device_id *device_list = (cl_device_id *)alloca( num_devices*
sizeof( cl_device_id ) );
1336 enforce_cl_retcode( clGetContextInfo(
my_factory.context(), CL_CONTEXT_DEVICES, num_devices*
sizeof( cl_device_id ), device_list, NULL ),
1337 "Failed to get OpenCL context info" );
1338 const char *options = NULL;
1342 const char *
s[] = { fr.content() };
1343 const size_t l[] = { fr.length() };
1347 opencl_device_filter(
1348 num_devices, device_list,
1349 [](
const opencl_device&
d ) ->
bool {
1350 return !d.compiler_available() || !d.linker_available();
1351 },
"No one device supports building program from sources" );
1352 opencl_program_builder(
1354 options, NULL, NULL );
1358 options =
"-x spir";
1361 std::vector<const unsigned char*>
s(
1362 num_devices, reinterpret_cast<const unsigned char*>(fr.content()) );
1363 std::vector<size_t> l( num_devices, fr.length() );
1364 std::vector<cl_int> bin_statuses( num_devices, -1 );
1367 device_list, l.data(), s.data(),
1368 bin_statuses.data(), &err );
1369 if( err != CL_SUCCESS ) {
1370 std::string statuses_str;
1371 for (
auto st = bin_statuses.begin(); st != bin_statuses.end(); ++st) {
1372 statuses_str += std::to_string((*st));
1376 std::string(
", binary_statuses = " ) + statuses_str );
1378 opencl_program_builder(
1380 options, NULL, NULL );
void const char const char int ITT_FORMAT __itt_group_sync s
#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)