A proxy class for a single element of a vector or matrix. This proxy should not be noticed by end-users of the library. More...
#include <forwards.h>
Public Types | |
typedef viennacl::backend::mem_handle | handle_type |
Public Member Functions | |
const_entry_proxy (vcl_size_t mem_offset, handle_type const &mem_handle) | |
The constructor for the proxy class. Declared explicit to avoid any surprises created by the compiler. More... | |
operator NumericT () const | |
Conversion to a CPU floating point value. More... | |
unsigned int | index () const |
Returns the index of the represented element. More... | |
handle_type const & | handle () const |
Returns the memory handle. More... | |
A proxy class for a single element of a vector or matrix. This proxy should not be noticed by end-users of the library.
This proxy provides access to a single entry of a vector. If the element is assigned to a GPU object, no unnecessary transfers to the CPU and back to GPU are initiated.
NumericT | Either float or double |
Definition at line 236 of file forwards.h.
typedef viennacl::backend::mem_handle viennacl::const_entry_proxy< NumericT >::handle_type |
Definition at line 183 of file entry_proxy.hpp.
|
inlineexplicit |
The constructor for the proxy class. Declared explicit to avoid any surprises created by the compiler.
mem_offset | The memory offset in multiples of sizeof(NumericT) relative to the memory pointed to by the handle |
mem_handle | A viennacl::ocl::handle for the memory buffer on the GPU. |
Definition at line 190 of file entry_proxy.hpp.
|
inline |
Returns the memory handle.
Definition at line 216 of file entry_proxy.hpp.
|
inline |
Returns the index of the represented element.
Definition at line 212 of file entry_proxy.hpp.
|
inline |
Conversion to a CPU floating point value.
This conversion allows to write something like double test = vector(4); However, one has to keep in mind that CPU<->GPU transfers are very slow compared to CPU<->CPU operations.
Definition at line 204 of file entry_proxy.hpp.