#[repr(transparent)]
pub struct RawMemObject(_);
Expand description

A raw OpenCL memory object

Implementations§

source§

impl RawMemObject

source

pub const unsafe fn from_id_unchecked(id: cl_mem) -> Self

source

pub const unsafe fn from_id(id: cl_mem) -> Option<Self>

source

pub unsafe fn retain(&self) -> Result<()>

source

pub const fn id(&self) -> cl_mem

source

pub const fn id_ref(&self) -> &cl_mem

source

pub fn id_ref_mut(&mut self) -> &mut cl_mem

source

pub fn ty(&self) -> Result<MemObjectType>

Returns the memory obejct’s type

source

pub fn associated_memobject(&self) -> Result<Option<RawMemObject>>

Available on crate feature cl1_1 only.

Return memory object from which memobj is created.

source

pub fn flags(&self) -> Result<MemFlags>

Return the flags argument value specified when memobj is created.

source

pub fn size(&self) -> Result<usize>

Return actual size of the data store associated with memobj in bytes.

source

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.

source

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.

source

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.

source

pub fn context(&self) -> Result<RawContext>

Return context specified when memory object is created.

source

pub fn offset(&self) -> Result<usize>

Available on crate feature 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.

source

pub fn uses_svm_pointer(&self) -> Result<bool>

Available on crate feature 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

source

pub fn on_destruct(&self, f: impl 'static + FnOnce() + Send) -> Result<()>

Available on crate feature cl1_1 only.

Adds a callback to be executed when the memory object is destructed by OpenCL.

source

pub fn on_destruct_boxed(&self, f: Box<dyn FnOnce() + Send>) -> Result<()>

Available on crate feature cl1_1 only.
source

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<()>

Available on crate feature cl1_1 only.

Trait Implementations§

source§

impl AsMem for RawMemObject

source§

impl AsMutMem for RawMemObject

source§

fn as_mut_mem(&mut self) -> &mut RawMemObject

source§

impl Clone for RawMemObject

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RawMemObject

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for RawMemObject

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Hash for RawMemObject

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Into<RawMemObject> for RawBuffer

source§

fn into(self) -> RawMemObject

Converts this type into the (usually inferred) input type.
source§

impl PartialEq<RawMemObject> for RawMemObject

source§

fn eq(&self, other: &RawMemObject) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for RawMemObject

source§

impl Send for RawMemObject

source§

impl StructuralEq for RawMemObject

source§

impl StructuralPartialEq for RawMemObject

source§

impl Sync for RawMemObject

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.