Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
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
 
voidget_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_typemy_curr_device_id
 
voidmy_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 602 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 605 of file flow_graph_opencl_node.h.

605  : opencl_memory<Factory>( f ), my_size( size ) {
606  cl_int err;
607  this->my_cl_mem = clCreateBuffer( this->my_factory->context(), CL_MEM_ALLOC_HOST_PTR, size, NULL, &err );
608  enforce_cl_retcode( err, "Failed to create an OpenCL buffer" );
609  }
void enforce_cl_retcode(cl_int err, std::string msg)

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 612 of file flow_graph_opencl_node.h.

612  : opencl_memory<Factory>( f ), my_size( size ) {
613  cl_int err;
614  cl_buffer_region region = { index, size };
615  this->my_cl_mem = clCreateSubBuffer( m, 0, CL_BUFFER_CREATE_TYPE_REGION, &region, &err );
616  enforce_cl_retcode( err, "Failed to create an OpenCL subbuffer" );
617  }
void enforce_cl_retcode(cl_int err, std::string msg)

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 
)
inlinevirtual

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

Definition at line 623 of file flow_graph_opencl_node.h.

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

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 619 of file flow_graph_opencl_node.h.

619  {
620  return my_size;
621  }

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

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.