#[repr(transparent)]pub struct RawBuffer(_);Expand description
A raw OpenCL buffer
Implementations§
source§impl RawBuffer
impl RawBuffer
pub fn new( size: usize, flags: MemFlags, host_ptr: Option<NonNull<c_void>> ) -> Result<Self>
pub fn new_in( ctx: &RawContext, size: usize, flags: MemFlags, host_ptr: Option<NonNull<c_void>> ) -> Result<Self>
pub const unsafe fn from_mem(mem: RawMemObject) -> Self
pub const unsafe fn from_id_unchecked(id: cl_mem) -> Self
pub unsafe fn from_id(id: cl_mem) -> Option<Self>
sourcepub unsafe fn create_sub_buffer(
&self,
flags: MemAccess,
region: BufferRange
) -> Result<RawBuffer>
Available on crate feature cl1_1 only.
pub unsafe fn create_sub_buffer( &self, flags: MemAccess, region: BufferRange ) -> Result<RawBuffer>
cl1_1 only.Creates a new buffer object (referred to as a sub-buffer object) from an existing buffer object.
source§impl RawBuffer
impl RawBuffer
pub unsafe fn read_to_ptr( &self, range: BufferRange, dst: *mut c_void, wait: WaitList<'_> ) -> Result<RawEvent>
pub unsafe fn read_rect_to_ptr( &self, buffer_origin: [usize; 3], host_origin: [usize; 3], region: [usize; 3], buffer_row_pitch: Option<usize>, buffer_slice_pitch: Option<usize>, host_row_pitch: Option<usize>, host_slice_pitch: Option<usize>, dst: *mut c_void, wait: WaitList<'_> ) -> Result<RawEvent>
cl1_1 only.pub unsafe fn write_from_ptr( &mut self, range: BufferRange, src: *const c_void, wait: WaitList<'_> ) -> Result<RawEvent>
pub unsafe fn write_rect_from_ptr( &mut self, buffer_origin: [usize; 3], host_origin: [usize; 3], region: [usize; 3], buffer_row_pitch: Option<usize>, buffer_slice_pitch: Option<usize>, host_row_pitch: Option<usize>, host_slice_pitch: Option<usize>, src: *const c_void, wait: WaitList<'_> ) -> Result<RawEvent>
cl1_1 only.pub unsafe fn copy_from( &mut self, dst_offset: usize, src: &RawBuffer, src_offset: usize, size: usize, wait: WaitList<'_> ) -> Result<RawEvent>
pub unsafe fn fill_raw<T: Copy>( &mut self, v: T, range: BufferRange, wait: WaitList<'_> ) -> Result<RawEvent>
cl1_2 only.pub unsafe fn map_read( &self, range: BufferRange, wait: WaitList<'_> ) -> Result<(*const c_void, RawEvent)>
pub unsafe fn map_write( &self, range: BufferRange, wait: WaitList<'_> ) -> Result<(*mut c_void, RawEvent)>
pub unsafe fn map_read_write( &self, range: BufferRange, wait: WaitList<'_> ) -> Result<(*mut c_void, RawEvent)>
source§impl RawBuffer
impl RawBuffer
sourcepub unsafe fn read_to_ptr_in(
&self,
range: BufferRange,
dst: *mut c_void,
queue: &RawCommandQueue,
wait: WaitList<'_>
) -> Result<RawEvent>
pub unsafe fn read_to_ptr_in( &self, range: BufferRange, dst: *mut c_void, queue: &RawCommandQueue, wait: WaitList<'_> ) -> Result<RawEvent>
Reads the contents of this
pub unsafe fn read_rect_to_ptr_in( &self, buffer_origin: [usize; 3], host_origin: [usize; 3], region: [usize; 3], buffer_row_pitch: Option<usize>, buffer_slice_pitch: Option<usize>, host_row_pitch: Option<usize>, host_slice_pitch: Option<usize>, dst: *mut c_void, queue: &RawCommandQueue, wait: WaitList<'_> ) -> Result<RawEvent>
cl1_1 only.pub unsafe fn write_from_ptr_in( &mut self, range: BufferRange, src: *const c_void, queue: &RawCommandQueue, wait: WaitList<'_> ) -> Result<RawEvent>
pub unsafe fn write_rect_from_ptr_in( &mut self, buffer_origin: [usize; 3], host_origin: [usize; 3], region: [usize; 3], buffer_row_pitch: Option<usize>, buffer_slice_pitch: Option<usize>, host_row_pitch: Option<usize>, host_slice_pitch: Option<usize>, src: *const c_void, queue: &RawCommandQueue, wait: WaitList<'_> ) -> Result<RawEvent>
cl1_1 only.pub unsafe fn copy_from_in( &mut self, dst_offset: usize, src: &RawBuffer, src_offset: usize, size: usize, queue: &RawCommandQueue, wait: WaitList<'_> ) -> Result<RawEvent>
pub unsafe fn copy_from_rect_raw_in( &mut self, dst_origin: [usize; 3], src_origin: [usize; 3], region: [usize; 3], dst_row_pitch: Option<usize>, dst_slice_pitch: Option<usize>, src_row_pitch: Option<usize>, src_slice_pitch: Option<usize>, src: &RawBuffer, queue: &RawCommandQueue, wait: WaitList<'_> ) -> Result<RawEvent>
cl1_1 only.pub unsafe fn fill_raw_in<T>( &mut self, v: T, range: BufferRange, queue: &RawCommandQueue, wait: WaitList<'_> ) -> Result<RawEvent>
cl1_2 only.pub unsafe fn map_read_in( &self, range: BufferRange, queue: &RawCommandQueue, wait: WaitList<'_> ) -> Result<(*const c_void, RawEvent)>
pub unsafe fn map_write_in( &self, range: BufferRange, queue: &RawCommandQueue, wait: WaitList<'_> ) -> Result<(*mut c_void, RawEvent)>
pub unsafe fn map_read_write_in( &self, range: BufferRange, queue: &RawCommandQueue, wait: WaitList<'_> ) -> Result<(*mut c_void, RawEvent)>
Methods from Deref<Target = RawMemObject>§
pub unsafe fn retain(&self) -> Result<()>
pub fn id(&self) -> cl_mem
pub fn id_ref(&self) -> &cl_mem
pub fn id_ref_mut(&mut self) -> &mut cl_mem
sourcepub fn ty(&self) -> Result<MemObjectType>
pub fn ty(&self) -> Result<MemObjectType>
Returns the memory obejct’s type
sourcepub fn associated_memobject(&self) -> Result<Option<RawMemObject>>
Available on crate feature cl1_1 only.
pub fn associated_memobject(&self) -> Result<Option<RawMemObject>>
cl1_1 only.Return memory object from which memobj is created.
sourcepub fn flags(&self) -> Result<MemFlags>
pub fn flags(&self) -> Result<MemFlags>
Return the flags argument value specified when memobj is created.
sourcepub fn size(&self) -> Result<usize>
pub fn size(&self) -> Result<usize>
Return actual size of the data store associated with memobj in bytes.
sourcepub fn host_ptr(&self) -> Result<Option<NonNull<c_void>>>
pub fn host_ptr(&self) -> Result<Option<NonNull<c_void>>>
If memobj is created with a host_ptr specified, return the host_ptr argument value specified when memobj is created.
sourcepub fn map_count(&self) -> Result<u32>
pub fn map_count(&self) -> Result<u32>
Map count. The map count returned should be considered immediately stale. It is unsuitable for general use in applications. This feature is provided for debugging.
sourcepub fn reference_count(&self) -> Result<u32>
pub fn reference_count(&self) -> Result<u32>
Return memobj reference count. The reference count returned should be considered immediately stale. It is unsuitable for general use in applications. This feature is provided for identifying memory leaks.
sourcepub fn context(&self) -> Result<RawContext>
pub fn context(&self) -> Result<RawContext>
Return context specified when memory object is created.
sourcepub fn offset(&self) -> Result<usize>
Available on crate feature cl1_1 only.
pub fn offset(&self) -> Result<usize>
cl1_1 only.Return offset if memobj is a sub-buffer object created using create_sub_buffer. Returns 0 if memobj is not a subbuffer object.
sourcepub fn uses_svm_pointer(&self) -> Result<bool>
Available on crate feature cl2 only.
pub fn uses_svm_pointer(&self) -> Result<bool>
cl2 only.Return true if memobj is a buffer object that was created with CL_MEM_USE_HOST_PTR or is a sub-buffer object of a buffer object that was created with CL_MEM_USE_HOST_PTR and the host_ptr specified when the buffer object was created is a SVM pointer; otherwise returns false.
sourcepub fn on_destruct(&self, f: impl 'static + FnOnce() + Send) -> Result<()>
Available on crate feature cl1_1 only.
pub fn on_destruct(&self, f: impl 'static + FnOnce() + Send) -> Result<()>
cl1_1 only.Adds a callback to be executed when the memory object is destructed by OpenCL.
pub fn on_destruct_boxed(&self, f: Box<dyn FnOnce() + Send>) -> Result<()>
cl1_1 only.pub unsafe fn on_destruct_raw( &self, f: unsafe extern "C" fn(memobj: cl_mem, user_data: *mut c_void), user_data: *mut c_void ) -> Result<()>
cl1_1 only.