Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface10::opencl_program< Factory >::opencl_program_builder Class Reference
Collaboration diagram for tbb::flow::interface10::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::interface10::opencl_program< Factory >::opencl_program_builder

Definition at line 1277 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::interface10::opencl_program< Factory >::opencl_program_builder::cl_callback_type) (cl_program, void *)

Definition at line 1279 of file flow_graph_opencl_node.h.

Constructor & Destructor Documentation

◆ opencl_program_builder()

template<typename Factory = opencl_info::default_opencl_factory>
tbb::flow::interface10::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 1280 of file flow_graph_opencl_node.h.

1283  {
1284  cl_int err = clBuildProgram( program, num_devices, device_list, options,
1285  callback, user_data );
1286  if( err == CL_SUCCESS )
1287  return;
1288  std::string str = std::string( "Failed to build program: " ) + name;
1289  if ( err == CL_BUILD_PROGRAM_FAILURE ) {
1290  const opencl_device_list &devices = f.devices();
1291  for ( auto d = devices.begin(); d != devices.end(); ++d ) {
1292  std::cerr << "Build log for device: " << (*d).name() << std::endl;
1293  size_t log_size;
1294  cl_int query_err = clGetProgramBuildInfo(
1295  program, (*d).my_cl_device_id, CL_PROGRAM_BUILD_LOG, 0, NULL,
1296  &log_size );
1297  enforce_cl_retcode( query_err, "Failed to get build log size" );
1298  if( log_size ) {
1299  std::vector<char> output;
1300  output.resize( log_size );
1301  query_err = clGetProgramBuildInfo(
1302  program, (*d).my_cl_device_id, CL_PROGRAM_BUILD_LOG,
1303  output.size(), output.data(), NULL );
1304  enforce_cl_retcode( query_err, "Failed to get build output" );
1305  std::cerr << output.data() << std::endl;
1306  } else {
1307  std::cerr << "No build log available" << std::endl;
1308  }
1309  }
1310  }
1311  enforce_cl_retcode( err, str );
1312  }
void const char const char int ITT_FORMAT __itt_group_sync x void const char * name
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 enforce_cl_retcode(cl_int err, std::string msg)

References tbb::flow::interface10::opencl_device_list::begin(), d, tbb::flow::interface10::opencl_device_list::end(), tbb::flow::interface10::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-2019 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.