1 #ifndef VIENNACL_TOOLS_ENTRY_PROXY_HPP_
2 #define VIENNACL_TOOLS_ENTRY_PROXY_HPP_
39 template <
typename SCALARTYPE>
51 handle_type & mem_handle)
52 : index_(mem_offset), mem_handle_(mem_handle) {}
60 SCALARTYPE temp = read();
70 SCALARTYPE temp = read();
80 SCALARTYPE temp = read();
90 SCALARTYPE temp = read();
129 operator SCALARTYPE ()
const
131 SCALARTYPE temp = read();
141 handle_type
const &
handle()
const {
return mem_handle_; }
146 SCALARTYPE read()
const
155 void write(SCALARTYPE value)
177 template <
typename SCALARTYPE>
190 handle_type
const & mem_handle)
191 : index_(mem_offset), mem_handle_(mem_handle) {}
203 operator SCALARTYPE ()
const
205 SCALARTYPE temp = read();
211 unsigned int index()
const {
return index_; }
215 handle_type
const &
handle()
const {
return mem_handle_; }
220 SCALARTYPE read()
const
std::size_t vcl_size_t
Definition: forwards.h:58
void memory_write(mem_handle &dst_buffer, vcl_size_t dst_offset, vcl_size_t bytes_to_write, const void *ptr, bool async=false)
Writes data from main RAM identified by 'ptr' to the buffer identified by 'dst_buffer'.
Definition: memory.hpp:220
handle_type const & handle() const
Returns the memory handle.
Definition: entry_proxy.hpp:215
A proxy class for a single element of a vector or matrix. This proxy should not be noticed by end-use...
Definition: entry_proxy.hpp:178
This class represents a single scalar value on the GPU and behaves mostly like a built-in scalar type...
Definition: forwards.h:172
vcl_size_t index() const
Returns the index of the represented element.
Definition: entry_proxy.hpp:137
This file provides the forward declarations for the main types used within ViennaCL.
void memory_read(mem_handle const &src_buffer, vcl_size_t src_offset, vcl_size_t bytes_to_read, void *ptr, bool async=false)
Reads data from a buffer back to main RAM.
Definition: memory.hpp:261
entry_proxy & operator+=(SCALARTYPE value)
Inplace addition of a CPU floating point value.
Definition: entry_proxy.hpp:58
entry_proxy & operator-=(SCALARTYPE value)
Inplace subtraction of a CPU floating point value.
Definition: entry_proxy.hpp:68
entry_proxy & operator=(scalar< SCALARTYPE > const &value)
Assignment of a GPU floating point value. Avoids unnecessary GPU->CPU->GPU transfers.
Definition: entry_proxy.hpp:106
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
Definition: cpu_ram.hpp:29
A proxy class for a single element of a vector or matrix. This proxy should not be noticed by end-use...
Definition: forwards.h:178
handle_type const & handle() const
Returns the memory viennacl::ocl::handle.
Definition: entry_proxy.hpp:141
entry_proxy & operator/=(SCALARTYPE value)
Inplace division by a CPU floating point value.
Definition: entry_proxy.hpp:88
entry_proxy & operator=(entry_proxy const &other)
Assignment of another GPU value.
Definition: entry_proxy.hpp:114
entry_proxy & operator*=(SCALARTYPE value)
Inplace multiplication with a CPU floating point value.
Definition: entry_proxy.hpp:78
handle_type & handle()
Returns the memory handle, non-const version.
Definition: scalar.hpp:704
unsigned int index() const
Returns the index of the represented element.
Definition: entry_proxy.hpp:211
entry_proxy & operator=(SCALARTYPE value)
Assignment of a CPU floating point value.
Definition: entry_proxy.hpp:98
void memory_copy(mem_handle const &src_buffer, mem_handle &dst_buffer, vcl_size_t src_offset, vcl_size_t dst_offset, vcl_size_t bytes_to_copy)
Copies 'bytes_to_copy' bytes from address 'src_buffer + src_offset' to memory starting at address 'ds...
Definition: memory.hpp:140
viennacl::backend::mem_handle handle_type
Definition: entry_proxy.hpp:182
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...
Definition: entry_proxy.hpp:189
Main abstraction class for multiple memory domains. Represents a buffer in either main RAM...
Definition: mem_handle.hpp:62
entry_proxy(vcl_size_t mem_offset, handle_type &mem_handle)
The constructor for the proxy class. Declared explicit to avoid any surprises created by the compiler...
Definition: entry_proxy.hpp:50
Implementation of the ViennaCL scalar class.
viennacl::backend::mem_handle handle_type
Definition: entry_proxy.hpp:43