Hex  1.0
Hydrogen-electron collision solver
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes
CLArrayView< T > Class Template Reference

OpenCL array wrapper. More...

#include <opencl.h>

Inheritance diagram for CLArrayView< T >:
Inheritance graph
[legend]
Collaboration diagram for CLArrayView< T >:
Collaboration graph
[legend]

Public Types

typedef T DataType
 
typedef T * iterator
 
typedef T const * const_iterator
 
- Public Types inherited from ArrayView< T >
typedef T DataType
 
typedef T * iterator
 
typedef T const * const_iterator
 

Public Member Functions

 CLArrayView ()
 
 CLArrayView (size_t n, T const *ptr)
 
 CLArrayView (ArrayView< T > v, size_t i=0, size_t n=0)
 
 CLArrayView (CLArrayView< T > const &v)
 
 CLArrayView (CLArrayView< T > &&v)
 
virtual ~CLArrayView ()
 
size_t size () const
 
T const & operator[] (size_t i) const
 
T & operator[] (size_t i)
 
T const * data () const
 
T * data ()
 Pointer to the data. More...
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
T const & front (size_t i=0) const
 
T & front (size_t i=0)
 
T const & back (size_t i=0) const
 
T & back (size_t i=0)
 
bool is_connected () const
 
void connect (cl_context context, cl_mem_flags flags)
 
void disconnect ()
 
cl_int EnqueueUpload (cl_command_queue queue)
 
cl_int EnqueueDownload (cl_command_queue queue)
 
cl_mem const & handle () const
 
- Public Member Functions inherited from ArrayView< T >
 ArrayView ()
 
 ArrayView (size_t n, T *ptr)
 
 ArrayView (ArrayView< T > const &a, size_t i=0, size_t n=0)
 
 ArrayView (Array< T > const &a, size_t i=0, size_t n=0)
 
 ArrayView (NumberArray< T > const &a, size_t i=0, size_t n=0)
 
 ArrayView (const_iterator i, const_iterator j)
 
 ArrayView (ArrayView< T > &&r)
 
virtual ~ArrayView ()
 
ArrayView< T > & operator= (const ArrayView< T > v)
 Assignment operator. More...
 
T & operator[] (size_t i)
 Element-wise access (non-const). More...
 
T const & operator[] (size_t i) const
 Element-wise access (const). More...
 
size_t size () const
 Length of the array (number of elements). More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
T & front (int i=0)
 
T const & front (int i=0) const
 
T & back (int i=0)
 
T const & back (int i=0) const
 
void fill (T x)
 Fill the array with a value. More...
 
bool empty () const
 Check whether the size is equal to zero. More...
 
template<class = typename std::enable_if<is_scalar<T>::value>>
double norm () const
 Two-norm (defined only for scalar data type). More...
 

Protected Attributes

cl_mem cl_handle_
 Memory handle to the data copy on the GPU. More...
 
- Protected Attributes inherited from ArrayView< T >
size_t N_
 Number of elements in the array. More...
 
T * array_
 Pointer to the array. More...
 

Detailed Description

template<class T>
class CLArrayView< T >

This class equips ArrayView<T> with an OpenCL context handle and provides several service methods for upload and download to / from the compute device (mostly GPU).

Member Typedef Documentation

template<class T>
typedef T const* CLArrayView< T >::const_iterator
template<class T>
typedef T CLArrayView< T >::DataType
template<class T>
typedef T* CLArrayView< T >::iterator

Constructor & Destructor Documentation

template<class T>
CLArrayView< T >::CLArrayView ( )
inline
template<class T>
CLArrayView< T >::CLArrayView ( size_t  n,
T const *  ptr 
)
inline
template<class T>
CLArrayView< T >::CLArrayView ( ArrayView< T >  v,
size_t  i = 0,
size_t  n = 0 
)
inline
template<class T>
CLArrayView< T >::CLArrayView ( CLArrayView< T > const &  v)
inline
template<class T>
CLArrayView< T >::CLArrayView ( CLArrayView< T > &&  v)
inline
template<class T>
virtual CLArrayView< T >::~CLArrayView ( )
inlinevirtual

Member Function Documentation

template<class T>
T const& CLArrayView< T >::back ( size_t  i = 0) const
inline
template<class T>
T& CLArrayView< T >::back ( size_t  i = 0)
inline
template<class T>
const_iterator CLArrayView< T >::begin ( ) const
inline
template<class T>
iterator CLArrayView< T >::begin ( )
inline
template<class T>
void CLArrayView< T >::connect ( cl_context  context,
cl_mem_flags  flags 
)
inline
template<class T>
T const* CLArrayView< T >::data ( ) const
inlinevirtual

Reimplemented from ArrayView< T >.

Reimplemented in CLArray< T, Alloc >.

template<class T>
T* CLArrayView< T >::data ( )
inlinevirtual

Reimplemented from ArrayView< T >.

Reimplemented in CLArray< T, Alloc >.

template<class T>
void CLArrayView< T >::disconnect ( )
inline
template<class T>
const_iterator CLArrayView< T >::end ( ) const
inline
template<class T>
iterator CLArrayView< T >::end ( )
inline
template<class T>
cl_int CLArrayView< T >::EnqueueDownload ( cl_command_queue  queue)
inline
template<class T>
cl_int CLArrayView< T >::EnqueueUpload ( cl_command_queue  queue)
inline
template<class T>
T const& CLArrayView< T >::front ( size_t  i = 0) const
inline
template<class T>
T& CLArrayView< T >::front ( size_t  i = 0)
inline
template<class T>
cl_mem const& CLArrayView< T >::handle ( ) const
inline
template<class T>
bool CLArrayView< T >::is_connected ( ) const
inline
template<class T>
T const& CLArrayView< T >::operator[] ( size_t  i) const
inline
template<class T>
T& CLArrayView< T >::operator[] ( size_t  i)
inline
template<class T>
size_t CLArrayView< T >::size ( ) const
inline

Field Documentation

template<class T>
cl_mem CLArrayView< T >::cl_handle_
protected

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