Struct blaze_rs::memobj::RawMemObject
source · #[repr(transparent)]pub struct RawMemObject(_);Expand description
A raw OpenCL memory object
Implementations§
source§impl RawMemObject
impl RawMemObject
pub const unsafe fn from_id_unchecked(id: cl_mem) -> Self
pub const unsafe fn from_id(id: cl_mem) -> Option<Self>
pub unsafe fn retain(&self) -> Result<()>
pub const fn id(&self) -> cl_mem
pub const 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.
source§impl RawMemObject
impl RawMemObject
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.Trait Implementations§
source§impl AsMem for RawMemObject
impl AsMem for RawMemObject
fn as_mem(&self) -> &RawMemObject
source§impl AsMutMem for RawMemObject
impl AsMutMem for RawMemObject
fn as_mut_mem(&mut self) -> &mut RawMemObject
source§impl Clone for RawMemObject
impl Clone for RawMemObject
source§impl Debug for RawMemObject
impl Debug for RawMemObject
source§impl Drop for RawMemObject
impl Drop for RawMemObject
source§impl Hash for RawMemObject
impl Hash for RawMemObject
source§impl Into<RawMemObject> for RawBuffer
impl Into<RawMemObject> for RawBuffer
source§fn into(self) -> RawMemObject
fn into(self) -> RawMemObject
source§impl PartialEq<RawMemObject> for RawMemObject
impl PartialEq<RawMemObject> for RawMemObject
source§fn eq(&self, other: &RawMemObject) -> bool
fn eq(&self, other: &RawMemObject) -> bool
self and other values to be equal, and is used
by ==.