Trait blaze_rs::svm::SvmPointer

source ·
pub unsafe trait SvmPointer<T: ?Sized> {
    type Context: Context;

    // Required methods
    fn allocator(&self) -> &Svm<Self::Context>;
    fn as_ptr(&self) -> *const T;
    fn as_mut_ptr(&mut self) -> *mut T;
    fn len(&self) -> usize;
}
Available on crate feature svm only.
Expand description

Object that wraps, in some way, a pointer to SVM memory

Safety

For an SvmPointer implementation to be safe, as_ptr and as_mut_ptr must return the same SVM-allocated pointer.

Required Associated Types§

Required Methods§

source

fn allocator(&self) -> &Svm<Self::Context>

Returns a reference to the underlying Svm allocator

source

fn as_ptr(&self) -> *const T

Returns the SVM pointer

source

fn as_mut_ptr(&mut self) -> *mut T

Returns the mutable SVM pointer

source

fn len(&self) -> usize

Returns the number of elements owned by the pointer

Implementors§