1 #ifndef VIENNACL_TOOLS_ENTRY_PROXY_HPP_
2 #define VIENNACL_TOOLS_ENTRY_PROXY_HPP_
39 template <
typename SCALARTYPE>
50 : _index(mem_offset), _mem_handle(mem_handle) {};
58 SCALARTYPE temp = read();
68 SCALARTYPE temp = read();
78 SCALARTYPE temp = read();
88 SCALARTYPE temp = read();
119 sizeof(SCALARTYPE) * other._index,
120 sizeof(SCALARTYPE) * _index,
121 sizeof(SCALARTYPE), 0, NULL, NULL);
135 operator SCALARTYPE ()
const
137 SCALARTYPE temp = read();
143 unsigned int index()
const {
return _index; }
152 SCALARTYPE read()
const
156 err = clEnqueueReadBuffer(
viennacl::ocl::get_queue().
handle(), _mem_handle, CL_TRUE,
sizeof(SCALARTYPE)*_index,
sizeof(SCALARTYPE), &temp, 0, NULL, NULL);
165 void write(SCALARTYPE value)
168 err = clEnqueueWriteBuffer(
viennacl::ocl::get_queue().
handle(), _mem_handle, CL_TRUE,
sizeof(SCALARTYPE)*_index,
sizeof(SCALARTYPE), &value, 0, NULL, NULL);