boost::compute::memory_object — Base-class for memory objects.
// In header: <boost/compute/memory_object.hpp> class memory_object { public: // Flags for the creation of memory objects. enum mem_flags { read_write = = CL_MEM_READ_WRITE, read_only = = CL_MEM_READ_ONLY, write_only = = CL_MEM_WRITE_ONLY, use_host_ptr = = CL_MEM_USE_HOST_PTR, alloc_host_ptr = = CL_MEM_ALLOC_HOST_PTR, copy_host_ptr = = CL_MEM_COPY_HOST_PTR }; // Symbolic names for the OpenCL address spaces. enum address_space { global_memory, local_memory, private_memory, constant_memory }; // public member functions cl_mem & get() const; size_t get_memory_size() const; cl_mem_object_type get_memory_type() const; cl_mem_flags get_memory_flags() const; context get_context() const; void * get_host_ptr() const; uint_ reference_count() const; template<typename T> T get_memory_info(cl_mem_info) const; void set_destructor_callback(void(BOOST_COMPUTE_CL_CALLBACK *callback)(cl_mem memobj, void *user_data), void * = 0); bool operator==(const memory_object &) const; bool operator!=(const memory_object &) const; };
The memory_object class is the base-class for memory objects on compute devices.
See Also:
memory_object
public member functionscl_mem & get() const;Returns the underlying OpenCL memory object.
size_t get_memory_size() const;Returns the size of the memory object in bytes.
cl_mem_object_type get_memory_type() const;Returns the type for the memory object.
cl_mem_flags get_memory_flags() const;Returns the flags for the memory object.
context get_context() const;Returns the context for the memory object.
void * get_host_ptr() const;Returns the host pointer associated with the memory object.
uint_ reference_count() const;Returns the reference count for the memory object.
template<typename T> T get_memory_info(cl_mem_info info) const;
Returns information about the memory object.
See the documentation for clGetMemObjectInfo() for more information.
void set_destructor_callback(void(BOOST_COMPUTE_CL_CALLBACK *callback)(cl_mem memobj, void *user_data), void * user_data = 0);
Registers a function to be called when the memory object is deleted and its resources freed.
See the documentation for clSetMemObjectDestructorCallback() for more information.
Warning | |
---|---|
This method is only available if the OpenCL version is 1.1 or later. |
bool operator==(const memory_object & other) const;Returns
true
if the memory object is the same as other
. bool operator!=(const memory_object & other) const;Returns
true
if the memory object is different from other
.