1333 cl_uint num_devices;
1335 "Failed to get OpenCL context info" );
1338 cl_device_id *device_list = (cl_device_id *)alloca( num_devices*
sizeof( cl_device_id ) );
1339 enforce_cl_retcode( clGetContextInfo(
my_factory.context(), CL_CONTEXT_DEVICES, num_devices*
sizeof( cl_device_id ), device_list, NULL ),
1340 "Failed to get OpenCL context info" );
1341 const char *options = NULL;
1345 const char *
s[] = { fr.content() };
1346 const size_t l[] = { fr.length() };
1350 opencl_device_filter(
1351 num_devices, device_list,
1352 [](
const opencl_device&
d ) ->
bool {
1353 return !d.compiler_available() || !d.linker_available();
1354 },
"No one device supports building program from sources" );
1355 opencl_program_builder(
1357 options, NULL, NULL );
1361 options =
"-x spir";
1364 std::vector<const unsigned char*>
s(
1365 num_devices, reinterpret_cast<const unsigned char*>(fr.content()) );
1366 std::vector<size_t> l( num_devices, fr.length() );
1367 std::vector<cl_int> bin_statuses( num_devices, -1 );
1370 device_list, l.data(), s.data(),
1371 bin_statuses.data(), &err );
1372 if( err != CL_SUCCESS ) {
1373 std::string statuses_str;
1374 for (
auto st = bin_statuses.begin(); st != bin_statuses.end(); ++st) {
1375 statuses_str += std::to_string((*st));
1379 std::string(
", binary_statuses = " ) + statuses_str );
1381 opencl_program_builder(
1383 options, NULL, NULL );
void const char const char int ITT_FORMAT __itt_group_sync s
void enforce_cl_retcode(cl_int err, std::string msg)
#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