tbb::flow::interface11::opencl_buffer_impl< Factory > Class Template Reference

`#include <flow_graph_opencl_node.h>`

Inheritance diagram for tbb::flow::interface11::opencl_buffer_impl< Factory >:
Collaboration diagram for tbb::flow::interface11::opencl_buffer_impl< Factory >:

## Public Member Functions

| opencl_buffer_impl (size_t size, Factory &f)
| opencl_buffer_impl (cl_mem m, size_t index, size_t size, Factory &f)
size_t | size () const
void | map_memory (opencl_device device, opencl_async_msg< void *, Factory > &dmsg) __TBB_override
Public Member Functions inherited from tbb::flow::interface11::opencl_memory< Factory >
| opencl_memory ()
| opencl_memory (Factory &f)
virtual | ~opencl_memory ()
cl_mem | get_cl_mem () const
void * | get_host_ptr ()
Factory * | factory () const
opencl_async_msg< void *, Factory > | receive (const cl_event *e)
opencl_async_msg< void *, Factory > | send (opencl_device device, const cl_event *e)

## Private Attributes

size_t | my_size

## Additional Inherited Members

Protected Attributes inherited from tbb::flow::interface11::opencl_memory< Factory >
cl_mem | my_cl_mem
tbb::atomic< opencl_device::device_id_type > | my_curr_device_id
void * | my_host_ptr
Factory * | my_factory
tbb::spin_mutex | my_sending_lock
bool | my_sending_event_present
cl_event | my_sending_event

## Detailed Description

### template<typename Factory>
class tbb::flow::interface11::opencl_buffer_impl< Factory >

Definition at line 591 of file flow_graph_opencl_node.h.

## Constructor & Destructor Documentation

## opencl_buffer_impl() [1/2]

template<typename Factory>

tbb::flow::interface11::opencl_buffer_impl< Factory >::opencl_buffer_impl | ( | size_t | size,
|  | Factory & | f
| ) |  |

inline

Definition at line 594 of file flow_graph_opencl_node.h.

: opencl_memory<Factory>( f ), my_size( size ) {
cl_int err;
this->my_cl_mem = clCreateBuffer( this->my_factory->context(), CL_MEM_ALLOC_HOST_PTR, size, NULL, &err );
enforce_cl_retcode( err, "Failed to create an OpenCL buffer" );
}

References tbb::flow::interface11::enforce_cl_retcode(), tbb::flow::interface11::opencl_memory< Factory >::my_cl_mem, tbb::flow::interface11::opencl_memory< Factory >::my_factory, and tbb::flow::interface11::opencl_buffer_impl< Factory >::size().

Here is the call graph for this function:

## opencl_buffer_impl() [2/2]

template<typename Factory>

tbb::flow::interface11::opencl_buffer_impl< Factory >::opencl_buffer_impl | ( | cl_mem | m,
|  | size_t | index,
|  | size_t | size,
|  | Factory & | f
| ) |  |

inline

Definition at line 601 of file flow_graph_opencl_node.h.

: opencl_memory<Factory>( f ), my_size( size ) {
cl_int err;
cl_buffer_region region = { index, size };
this->my_cl_mem = clCreateSubBuffer( m, 0, CL_BUFFER_CREATE_TYPE_REGION, &region, &err );
enforce_cl_retcode( err, "Failed to create an OpenCL subbuffer" );
}

References tbb::flow::interface11::enforce_cl_retcode(), tbb::flow::interface11::opencl_memory< Factory >::my_cl_mem, and tbb::flow::interface11::opencl_buffer_impl< Factory >::size().

Here is the call graph for this function:

## Member Function Documentation

## map_memory()

template<typename Factory>

void tbb::flow::interface11::opencl_buffer_impl< Factory >::map_memory | ( | opencl_device | device,
|  | opencl_async_msg< void *, Factory > & | dmsg
| ) |  |

inline virtual

Implements tbb::flow::interface11::opencl_memory< Factory >.

Definition at line 612 of file flow_graph_opencl_node.h.

{
this->my_factory->enqueue_map_buffer( device, *this, dmsg );
}

References tbb::flow::interface11::opencl_memory< Factory >::my_factory.

## size()

template<typename Factory>

size_t tbb::flow::interface11::opencl_buffer_impl< Factory >::size | ( |  | ) | const

inline

Definition at line 608 of file flow_graph_opencl_node.h.

{
return my_size;
}

References tbb::flow::interface11::opencl_buffer_impl< Factory >::my_size.

Referenced by tbb::flow::interface11::opencl_factory< default_device_filter >::enqueue_map_buffer(), and tbb::flow::interface11::opencl_buffer_impl< Factory >::opencl_buffer_impl().

Here is the caller graph for this function:

## Member Data Documentation

## my_size

template<typename Factory>

size_t tbb::flow::interface11::opencl_buffer_impl< Factory >::my_size

private

Definition at line 592 of file flow_graph_opencl_node.h.

Referenced by tbb::flow::interface11::opencl_buffer_impl< Factory >::size().

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

- flow_graph_opencl_node.h

tbb::flow::interface11::opencl_buffer_impl::my_size
size_t my_size
Definition: flow_graph_opencl_node.h:592
tbb::flow::interface11::enforce_cl_retcode
void enforce_cl_retcode(cl_int err, std::string msg)
Definition: flow_graph_opencl_node.h:57
tbb::flow::interface11::opencl_memory::my_cl_mem
cl_mem my_cl_mem
Definition: flow_graph_opencl_node.h:580
tbb::flow::interface11::opencl_memory::my_factory
Factory * my_factory
Definition: flow_graph_opencl_node.h:583
tbb::flow::interface11::opencl_buffer_impl::size
size_t size() const
Definition: flow_graph_opencl_node.h:608

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.