tbb::flow::interface11::opencl_factory< DeviceFilter >::kernel Class Reference

`#include <flow_graph_opencl_node.h>`

Inheritance diagram for tbb::flow::interface11::opencl_factory< DeviceFilter >::kernel:
Collaboration diagram for tbb::flow::interface11::opencl_factory< DeviceFilter >::kernel:

## Public Member Functions

| kernel (const kernel &k)
| ~kernel ()

## Private Types

typedef opencl_factory< DeviceFilter > | factory_type

## Private Member Functions

| kernel (const cl_kernel &k, factory_type &f)
Private Member Functions inherited from tbb::internal::no_assign
void | operator= (const no_assign &)=delete
| no_assign (const no_assign &)=default
| no_assign ()=default

## Private Attributes

cl_kernel | my_cl_kernel
factory_type & | my_factory

## Friends

template<typename DeviceFilter_ >
class | opencl_factory
template<typename Factory >
class | opencl_program

## Detailed Description

### template<typename DeviceFilter>
class tbb::flow::interface11::opencl_factory< DeviceFilter >::kernel

Definition at line 829 of file flow_graph_opencl_node.h.

## Member Typedef Documentation

## factory_type

template<typename DeviceFilter >

typedef opencl_factory<DeviceFilter> tbb::flow::interface11::opencl_factory< DeviceFilter >::kernel::factory_type

private

Definition at line 854 of file flow_graph_opencl_node.h.

## Constructor & Destructor Documentation

## kernel() [1/2]

template<typename DeviceFilter >

tbb::flow::interface11::opencl_factory< DeviceFilter >::kernel::kernel | ( | const kernel & | k | ) |

inline

Definition at line 831 of file flow_graph_opencl_node.h.

: my_factory( k.my_factory ) {
// Clone my_cl_kernel via opencl_program
size_t ret_size = 0;
std::vector<char> kernel_name;
for ( size_t curr_size = 32;; curr_size <<= 1 ) {
kernel_name.resize( curr_size <<= 1 );
enforce_cl_retcode( clGetKernelInfo( k.my_cl_kernel, CL_KERNEL_FUNCTION_NAME, curr_size, kernel_name.data(), &ret_size ), "Failed to get kernel info" );
if ( ret_size < curr_size ) break;
}
cl_program program;
enforce_cl_retcode( clGetKernelInfo( k.my_cl_kernel, CL_KERNEL_PROGRAM, sizeof(program), &program, &ret_size ), "Failed to get kernel info" );
__TBB_ASSERT( ret_size == sizeof(program), NULL );
my_cl_kernel = opencl_program< factory_type >( my_factory, program ).get_cl_kernel( kernel_name.data() );
}
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::flow::interface11::enforce_cl_retcode
void enforce_cl_retcode(cl_int err, std::string msg)
Definition: flow_graph_opencl_node.h:68
tbb::flow::interface11::opencl_factory::kernel::my_factory
factory_type & my_factory
Definition: flow_graph_opencl_node.h:860
tbb::flow::interface11::opencl_factory::kernel::my_cl_kernel
cl_kernel my_cl_kernel
Definition: flow_graph_opencl_node.h:859

References __TBB_ASSERT, tbb::flow::interface11::enforce_cl_retcode(), tbb::flow::interface11::opencl_program< Factory >::get_cl_kernel(), and tbb::flow::interface11::opencl_factory< DeviceFilter >::kernel::my_cl_kernel.

Here is the call graph for this function:

## ~kernel()

template<typename DeviceFilter >

tbb::flow::interface11::opencl_factory< DeviceFilter >::kernel::~kernel | ( |  | ) |

inline

Definition at line 849 of file flow_graph_opencl_node.h.

{
enforce_cl_retcode( clReleaseKernel( my_cl_kernel ), "Failed to release a kernel" );
}

References tbb::flow::interface11::enforce_cl_retcode().

Here is the call graph for this function:

## kernel() [2/2]

template<typename DeviceFilter >

tbb::flow::interface11::opencl_factory< DeviceFilter >::kernel::kernel | ( | const cl_kernel & | k,
|  | factory_type & | f
| ) |  |

inline private

Definition at line 856 of file flow_graph_opencl_node.h.

: my_cl_kernel( k ), my_factory( f ) {}

## Friends And Related Function Documentation

## opencl_factory

template<typename DeviceFilter >
template<typename DeviceFilter_ >

friend class opencl_factory

friend

Definition at line 863 of file flow_graph_opencl_node.h.

## opencl_program

template<typename DeviceFilter >
template<typename Factory >

friend class opencl_program

friend

Definition at line 866 of file flow_graph_opencl_node.h.

## Member Data Documentation

## my_cl_kernel

template<typename DeviceFilter >

cl_kernel tbb::flow::interface11::opencl_factory< DeviceFilter >::kernel::my_cl_kernel

private

Definition at line 859 of file flow_graph_opencl_node.h.

Referenced by tbb::flow::interface11::opencl_factory< DeviceFilter >::kernel::kernel(), tbb::flow::interface11::opencl_factory< DeviceFilter >::process_one_arg(), and tbb::flow::interface11::opencl_factory< DeviceFilter >::send_kernel().

## my_factory

template<typename DeviceFilter >

factory_type& tbb::flow::interface11::opencl_factory< DeviceFilter >::kernel::my_factory

private

Definition at line 860 of file flow_graph_opencl_node.h.

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.