Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface11::opencl_program< Factory >::opencl_program_builder Class Reference
Collaboration diagram for tbb::flow::interface11::opencl_program< Factory >::opencl_program_builder:

Public Types

typedef void(CL_CALLBACK * cl_callback_type) (cl_program, void *)
 

Public Member Functions

 opencl_program_builder (Factory &f, const std::string &name, cl_program program, cl_uint num_devices, cl_device_id *device_list, const char *options, cl_callback_type callback, void *user_data)
 

Detailed Description

template<typename Factory = opencl_info::default_opencl_factory>
class tbb::flow::interface11::opencl_program< Factory >::opencl_program_builder

Definition at line 1294 of file flow_graph_opencl_node.h.

Member Typedef Documentation

◆ cl_callback_type

template<typename Factory = opencl_info::default_opencl_factory>
typedef void(CL_CALLBACK * tbb::flow::interface11::opencl_program< Factory >::opencl_program_builder::cl_callback_type) (cl_program, void *)

Definition at line 1296 of file flow_graph_opencl_node.h.

Constructor & Destructor Documentation

◆ opencl_program_builder()

template<typename Factory = opencl_info::default_opencl_factory>
tbb::flow::interface11::opencl_program< Factory >::opencl_program_builder::opencl_program_builder ( Factory &  f,
const std::string &  name,
cl_program  program,
cl_uint  num_devices,
cl_device_id *  device_list,
const char *  options,
cl_callback_type  callback,
void user_data 
)
inline

Definition at line 1297 of file flow_graph_opencl_node.h.

1300  {
1301  cl_int err = clBuildProgram( program, num_devices, device_list, options,
1302  callback, user_data );
1303  if( err == CL_SUCCESS )
1304  return;
1305  std::string str = std::string( "Failed to build program: " ) + name;
1306  if ( err == CL_BUILD_PROGRAM_FAILURE ) {
1307  const opencl_device_list &devices = f.devices();
1308  for ( auto d = devices.begin(); d != devices.end(); ++d ) {
1309  std::cerr << "Build log for device: " << (*d).name() << std::endl;
1310  size_t log_size;
1311  cl_int query_err = clGetProgramBuildInfo(
1312  program, (*d).my_cl_device_id, CL_PROGRAM_BUILD_LOG, 0, NULL,
1313  &log_size );
1314  enforce_cl_retcode( query_err, "Failed to get build log size" );
1315  if( log_size ) {
1316  std::vector<char> output;
1317  output.resize( log_size );
1318  query_err = clGetProgramBuildInfo(
1319  program, (*d).my_cl_device_id, CL_PROGRAM_BUILD_LOG,
1320  output.size(), output.data(), NULL );
1321  enforce_cl_retcode( query_err, "Failed to get build output" );
1322  std::cerr << output.data() << std::endl;
1323  } else {
1324  std::cerr << "No build log available" << std::endl;
1325  }
1326  }
1327  }
1328  enforce_cl_retcode( err, str );
1329  }
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 x void const char * name
void enforce_cl_retcode(cl_int err, std::string msg)

References tbb::flow::interface11::opencl_device_list::begin(), d, tbb::flow::interface11::opencl_device_list::end(), tbb::flow::interface11::enforce_cl_retcode(), and name.

Here is the call graph for this function:

The documentation for this class was generated from the following file:

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.