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_buffer & | memory_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_type > | my_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.

{}

## 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.

: my_impl( std::make_shared<impl_type>( size*sizeof(T), opencl_info::default_factory() ) ) {}
tbb::flow::interface11::opencl_info::default_factory
default_opencl_factory & default_factory()
Definition: flow_graph_opencl_node.h:1217
tbb::flow::interface11::opencl_buffer::my_impl
std::shared_ptr< impl_type > my_impl
Definition: flow_graph_opencl_node.h:706
tbb::flow::interface11::opencl_buffer::size
size_t size() const
Definition: flow_graph_opencl_node.h:668

## 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.

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

inline private

Definition at line 702 of file flow_graph_opencl_node.h.

: 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.

{
T* ptr = (T*)my_impl->get_host_ptr();
__TBB_ASSERT( ptr, NULL );
return iterator<a>( ptr );
}
__TBB_ASSERT
#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.

{ 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.

{ 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.

{ 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.

{
return *this;
}

## 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.

{
return my_impl->get_cl_mem();
}

## 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.

{ return begin()[k]; }
tbb::flow::interface11::opencl_buffer::begin
iterator< a > begin() const
Definition: flow_graph_opencl_node.h:663

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.

{
__TBB_ASSERT( dependency.data( /*wait = */false ) == *this, NULL );
opencl_async_msg<void*, Factory> d = my_impl->receive( dependency.get_event() );
const cl_event *e = d.get_event();
if ( e ) dependency.set_event( *e );
else dependency.clear_event();
}
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

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.

{
__TBB_ASSERT( dependency.data( /*wait = */false ) == *this, NULL );
opencl_async_msg<void*, Factory> d = my_impl->send( device, dependency.get_event() );
const cl_event *e = d.get_event();
if ( e ) dependency.set_event( *e );
else dependency.clear_event();
}

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.

{ 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.

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

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.

{
return lhs.my_impl == rhs.my_impl;
}

## 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:

- 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.