|
| CLArray () |
|
| Alloc::alloc (n)) |
|
| CLArray (ArrayView< T > v, size_t i=0, size_t n=0) |
|
| CLArray (std::initializer_list< T > list) |
|
| CLArray (CLArray< T, Alloc > &&rvrf) |
|
virtual | ~CLArray () |
|
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=CL_MEM_COPY_HOST_PTR|CL_MEM_READ_WRITE) |
|
void | disconnect () |
|
cl_int | EnqueueDownload (cl_command_queue queue) |
|
cl_int | EnqueueUpload (cl_command_queue queue) |
|
cl_mem const & | handle () const |
|
| 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) |
|
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 |
|
| 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...
|
|
template<class T, class Alloc = PlainAllocator<T>>
class CLArray< T, Alloc >
This class combines NumberArray<T> and CLArrayView<T>. It is a self-standing array of memory-aligned elements. The alignment is large by default so that the class can be used as the host-type memory within OpenCL. However, the aimed usage is this:
- Create the array.
- Fill the array with initial data.
- Connect to the computing device (GPU) and upload the data.
- Run computation on the compute device.
- Download the resulting data back to RAM.
- Disconnect from compute device.
- Destruct the class.