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.

{
cl_int err = clBuildProgram( program, num_devices, device_list, options,
callback, user_data );
if( err == CL_SUCCESS )
return;
std::string str = std::string( "Failed to build program: " ) + name;
if ( err == CL_BUILD_PROGRAM_FAILURE ) {
const opencl_device_list &devices = f.devices();
for ( auto d = devices.begin(); d != devices.end(); ++d ) {
std::cerr << "Build log for device: " << (*d).name() << std::endl;
size_t log_size;
cl_int query_err = clGetProgramBuildInfo(
program, (*d).my_cl_device_id, CL_PROGRAM_BUILD_LOG, 0, NULL,
&log_size );
enforce_cl_retcode( query_err, "Failed to get build log size" );
if( log_size ) {
std::vector<char> output;
output.resize( log_size );
query_err = clGetProgramBuildInfo(
program, (*d).my_cl_device_id, CL_PROGRAM_BUILD_LOG,
output.size(), output.data(), NULL );
enforce_cl_retcode( query_err, "Failed to get build output" );
std::cerr << output.data() << std::endl;
} else {
std::cerr << "No build log available" << std::endl;
}
}
}
enforce_cl_retcode( err, str );
}
d
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
Definition: ittnotify_static.h:109
name
void const char const char int ITT_FORMAT __itt_group_sync x void const char * name
Definition: ittnotify_static.h:93
tbb::flow::interface11::enforce_cl_retcode
void enforce_cl_retcode(cl_int err, std::string msg)
Definition: flow_graph_opencl_node.h:68

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:

- flow_graph_opencl_node.h

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.