Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface11::opencl_buffer< T, Factory > Class Template Reference

#include <flow_graph_opencl_node.h>

Inheritance diagram for tbb::flow::interface11::opencl_buffer< T, Factory >:
Collaboration diagram for tbb::flow::interface11::opencl_buffer< T, Factory >:

Public Types

typedef cl_mem native_object_type
 
typedef opencl_buffer memory_object_type
 
typedef Factory opencl_factory_type
 
template<access_type a>
using iterator = T *
 

Public Member Functions

template<access_type a>
iterator< a > access () const
 
T * data () const
 
template<access_type a = read_write>
iterator< a > begin () const
 
template<access_type a = read_write>
iterator< a > end () const
 
size_t size () const
 
T & operator[] (ptrdiff_t k)
 
 opencl_buffer ()
 
 opencl_buffer (size_t size)
 
 opencl_buffer (Factory &f, size_t size)
 
cl_mem native_object () const
 
const opencl_buffermemory_object () const
 
void send (opencl_device device, opencl_async_msg< opencl_buffer, Factory > &dependency) const
 
void receive (const opencl_async_msg< opencl_buffer, Factory > &dependency) const
 
opencl_subbuffer< T, Factory > subbuffer (size_t index, size_t size) const
 

Private Types

typedef opencl_buffer_impl< Factory > impl_type
 

Private Member Functions

 opencl_buffer (Factory &f, cl_mem m, size_t index, size_t size)
 

Private Attributes

std::shared_ptr< impl_typemy_impl
 

Friends

template<typename >
class opencl_factory
 
template<typename , typename >
class opencl_subbuffer
 
bool operator== (const opencl_buffer< T, Factory > &lhs, const opencl_buffer< T, Factory > &rhs)
 

Detailed Description

template<typename T, typename Factory = opencl_info::default_opencl_factory>
class tbb::flow::interface11::opencl_buffer< T, Factory >

Definition at line 644 of file flow_graph_opencl_node.h.

Member Typedef Documentation

◆ impl_type

template<typename T, typename Factory = opencl_info::default_opencl_factory>
typedef opencl_buffer_impl<Factory> tbb::flow::interface11::opencl_buffer< T, Factory >::impl_type
private

Definition at line 704 of file flow_graph_opencl_node.h.

◆ iterator

template<typename T, typename Factory = opencl_info::default_opencl_factory>
template<access_type a>
using tbb::flow::interface11::opencl_buffer< T, Factory >::iterator = T*

Definition at line 651 of file flow_graph_opencl_node.h.

◆ memory_object_type

template<typename T, typename Factory = opencl_info::default_opencl_factory>
typedef opencl_buffer tbb::flow::interface11::opencl_buffer< T, Factory >::memory_object_type

Definition at line 648 of file flow_graph_opencl_node.h.

◆ native_object_type

template<typename T, typename Factory = opencl_info::default_opencl_factory>
typedef cl_mem tbb::flow::interface11::opencl_buffer< T, Factory >::native_object_type

Definition at line 647 of file flow_graph_opencl_node.h.

◆ opencl_factory_type

template<typename T, typename Factory = opencl_info::default_opencl_factory>
typedef Factory tbb::flow::interface11::opencl_buffer< T, Factory >::opencl_factory_type

Definition at line 649 of file flow_graph_opencl_node.h.

Constructor & Destructor Documentation

◆ opencl_buffer() [1/4]

template<typename T, typename Factory = opencl_info::default_opencl_factory>
tbb::flow::interface11::opencl_buffer< T, Factory >::opencl_buffer ( )
inline

Definition at line 672 of file flow_graph_opencl_node.h.

672 {}

◆ opencl_buffer() [2/4]

template<typename T , typename Factory >
tbb::flow::interface11::opencl_buffer< T, Factory >::opencl_buffer ( size_t  size)

Definition at line 1225 of file flow_graph_opencl_node.h.

1225 : my_impl( std::make_shared<impl_type>( size*sizeof(T), opencl_info::default_factory() ) ) {}
default_opencl_factory & default_factory()

◆ opencl_buffer() [3/4]

template<typename T, typename Factory = opencl_info::default_opencl_factory>
tbb::flow::interface11::opencl_buffer< T, Factory >::opencl_buffer ( Factory &  f,
size_t  size 
)
inline

Definition at line 674 of file flow_graph_opencl_node.h.

674 : my_impl( std::make_shared<impl_type>( size*sizeof(T), f ) ) {}

◆ opencl_buffer() [4/4]

template<typename T, typename Factory = opencl_info::default_opencl_factory>
tbb::flow::interface11::opencl_buffer< T, Factory >::opencl_buffer ( Factory &  f,
cl_mem  m,
size_t  index,
size_t  size 
)
inlineprivate

Definition at line 702 of file flow_graph_opencl_node.h.

702 : my_impl( std::make_shared<impl_type>( m, index*sizeof(T), size*sizeof(T), f ) ) {}

Member Function Documentation

◆ access()

template<typename T, typename Factory = opencl_info::default_opencl_factory>
template<access_type a>
iterator<a> tbb::flow::interface11::opencl_buffer< T, Factory >::access ( ) const
inline

Definition at line 654 of file flow_graph_opencl_node.h.

654  {
655  T* ptr = (T*)my_impl->get_host_ptr();
656  __TBB_ASSERT( ptr, NULL );
657  return iterator<a>( ptr );
658  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

References __TBB_ASSERT.

◆ begin()

template<typename T, typename Factory = opencl_info::default_opencl_factory>
template<access_type a = read_write>
iterator<a> tbb::flow::interface11::opencl_buffer< T, Factory >::begin ( ) const
inline

Definition at line 663 of file flow_graph_opencl_node.h.

663 { return access<a>(); }

◆ data()

template<typename T, typename Factory = opencl_info::default_opencl_factory>
T* tbb::flow::interface11::opencl_buffer< T, Factory >::data ( ) const
inline

Definition at line 660 of file flow_graph_opencl_node.h.

660 { return &access<read_write>()[0]; }

◆ end()

template<typename T, typename Factory = opencl_info::default_opencl_factory>
template<access_type a = read_write>
iterator<a> tbb::flow::interface11::opencl_buffer< T, Factory >::end ( ) const
inline

Definition at line 666 of file flow_graph_opencl_node.h.

666 { return access<a>()+my_impl->size()/sizeof(T); }

◆ memory_object()

template<typename T, typename Factory = opencl_info::default_opencl_factory>
const opencl_buffer& tbb::flow::interface11::opencl_buffer< T, Factory >::memory_object ( ) const
inline

Definition at line 680 of file flow_graph_opencl_node.h.

680  {
681  return *this;
682  }

◆ native_object()

template<typename T, typename Factory = opencl_info::default_opencl_factory>
cl_mem tbb::flow::interface11::opencl_buffer< T, Factory >::native_object ( ) const
inline

Definition at line 676 of file flow_graph_opencl_node.h.

676  {
677  return my_impl->get_cl_mem();
678  }

◆ operator[]()

template<typename T, typename Factory = opencl_info::default_opencl_factory>
T& tbb::flow::interface11::opencl_buffer< T, Factory >::operator[] ( ptrdiff_t  k)
inline

Definition at line 670 of file flow_graph_opencl_node.h.

670 { return begin()[k]; }

References begin.

◆ receive()

template<typename T, typename Factory = opencl_info::default_opencl_factory>
void tbb::flow::interface11::opencl_buffer< T, Factory >::receive ( const opencl_async_msg< opencl_buffer< T, Factory >, Factory > &  dependency) const
inline

Definition at line 691 of file flow_graph_opencl_node.h.

691  {
692  __TBB_ASSERT( dependency.data( /*wait = */false ) == *this, NULL );
693  opencl_async_msg<void*, Factory> d = my_impl->receive( dependency.get_event() );
694  const cl_event *e = d.get_event();
695  if ( e ) dependency.set_event( *e );
696  else dependency.clear_event();
697  }
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
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

References __TBB_ASSERT, tbb::flow::interface11::opencl_async_msg< T, Factory >::clear_event(), d, tbb::flow::interface11::opencl_async_msg< T, Factory >::data(), tbb::flow::interface11::opencl_async_msg< T, Factory >::get_event(), and tbb::flow::interface11::opencl_async_msg< T, Factory >::set_event().

Here is the call graph for this function:

◆ send()

template<typename T, typename Factory = opencl_info::default_opencl_factory>
void tbb::flow::interface11::opencl_buffer< T, Factory >::send ( opencl_device  device,
opencl_async_msg< opencl_buffer< T, Factory >, Factory > &  dependency 
) const
inline

Definition at line 684 of file flow_graph_opencl_node.h.

684  {
685  __TBB_ASSERT( dependency.data( /*wait = */false ) == *this, NULL );
686  opencl_async_msg<void*, Factory> d = my_impl->send( device, dependency.get_event() );
687  const cl_event *e = d.get_event();
688  if ( e ) dependency.set_event( *e );
689  else dependency.clear_event();
690  }
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
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

References __TBB_ASSERT, tbb::flow::interface11::opencl_async_msg< T, Factory >::clear_event(), d, tbb::flow::interface11::opencl_async_msg< T, Factory >::data(), tbb::flow::interface11::opencl_async_msg< T, Factory >::get_event(), and tbb::flow::interface11::opencl_async_msg< T, Factory >::set_event().

Here is the call graph for this function:

◆ size()

template<typename T, typename Factory = opencl_info::default_opencl_factory>
size_t tbb::flow::interface11::opencl_buffer< T, Factory >::size ( ) const
inline

Definition at line 668 of file flow_graph_opencl_node.h.

668 { return my_impl->size()/sizeof(T); }

◆ subbuffer()

template<typename T , typename Factory >
opencl_subbuffer< T, Factory > tbb::flow::interface11::opencl_buffer< T, Factory >::subbuffer ( size_t  index,
size_t  size 
) const

Definition at line 729 of file flow_graph_opencl_node.h.

729  {
730  return opencl_subbuffer<T, Factory>( *this, index, size );
731 }

References size.

Friends And Related Function Documentation

◆ opencl_factory

template<typename T, typename Factory = opencl_info::default_opencl_factory>
template<typename >
friend class opencl_factory
friend

Definition at line 713 of file flow_graph_opencl_node.h.

◆ opencl_subbuffer

template<typename T, typename Factory = opencl_info::default_opencl_factory>
template<typename , typename >
friend class opencl_subbuffer
friend

Definition at line 715 of file flow_graph_opencl_node.h.

◆ operator==

template<typename T, typename Factory = opencl_info::default_opencl_factory>
bool operator== ( const opencl_buffer< T, Factory > &  lhs,
const opencl_buffer< T, Factory > &  rhs 
)
friend

Definition at line 708 of file flow_graph_opencl_node.h.

708  {
709  return lhs.my_impl == rhs.my_impl;
710  }

Member Data Documentation

◆ my_impl

template<typename T, typename Factory = opencl_info::default_opencl_factory>
std::shared_ptr<impl_type> tbb::flow::interface11::opencl_buffer< T, Factory >::my_impl
private

Definition at line 706 of file flow_graph_opencl_node.h.


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.