1 #ifndef VIENNACL_BACKEND_OPENCL_HPP_
2 #define VIENNACL_BACKEND_OPENCL_HPP_
75 assert( &src_buffer.
context() == &dst_buffer.
context() && bool(
"Transfer between memory buffers in different contexts not supported yet!"));
78 cl_int err = clEnqueueCopyBuffer(memory_context.get_queue().handle().get(),
107 async ? CL_FALSE : CL_TRUE,
134 async ? CL_FALSE : CL_TRUE,
std::size_t vcl_size_t
Definition: forwards.h:58
cl_mem memory_create(viennacl::ocl::context const &ctx, vcl_size_t size_in_bytes, const void *host_ptr=NULL)
Creates an array of the specified size in the current OpenCL context. If the second argument is provi...
Definition: opencl.hpp:55
viennacl::ocl::context const & context() const
Definition: handle.hpp:191
Manages an OpenCL context and provides the respective convenience functions for creating buffers...
Definition: context.hpp:51
void memory_write(viennacl::ocl::handle< cl_mem > &dst_buffer, vcl_size_t dst_offset, vcl_size_t bytes_to_copy, const void *ptr, bool async=false)
Writes data from main RAM identified by 'ptr' to the OpenCL buffer identified by 'dst_buffer'.
Definition: opencl.hpp:97
cl_mem create_memory_without_smart_handle(cl_mem_flags flags, unsigned int size, void *ptr=NULL) const
Creates a memory buffer within the context. Does not wrap the OpenCL handle into the smart-pointer-li...
Definition: context.hpp:179
viennacl::ocl::handle< cl_command_queue > const & handle() const
Definition: command_queue.hpp:81
void memory_read(viennacl::ocl::handle< cl_mem > const &src_buffer, vcl_size_t src_offset, vcl_size_t bytes_to_copy, void *ptr, bool async=false)
Reads data from an OpenCL buffer back to main RAM.
Definition: opencl.hpp:124
const OCL_TYPE & get() const
Definition: handle.hpp:189
#define VIENNACL_ERR_CHECK(err)
Definition: error.hpp:655
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
Definition: cpu_ram.hpp:29
viennacl::ocl::command_queue & get_queue()
Definition: context.hpp:249
void memory_copy(viennacl::ocl::handle< cl_mem > const &src_buffer, viennacl::ocl::handle< cl_mem > &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' in the OpenCL context to memory s...
Definition: opencl.hpp:69
Implementation of a smart-pointer-like class for handling OpenCL handles.
Implementations of the OpenCL backend, where all contexts are stored in.