pub struct PointerAttributes {
pub memory_type: MemoryType,
pub device: i32,
pub device_pointer: DevicePtr,
pub host_pointer: *mut (),
pub locality_domain_ordinal: i32,
}Expand description
CUDA-reported memory kind, owning device, and accessible aliases for a pointer.
Fields§
§memory_type: MemoryTypeCUDA classification of the memory addressed by the queried pointer.
device: i32Device ordinal associated with the allocation or registration.
device_pointer: DevicePtrAlias usable for device access in the current context, or null when unavailable.
host_pointer: *mut ()Alias usable for host access, or null when the memory is not host-accessible.
locality_domain_ordinal: i32Locality domain ordinal of the allocation; negative when not localized.
Implementations§
Source§impl PointerAttributes
impl PointerAttributes
Sourcepub fn query<T>(ptr: *const T) -> Result<Self>
pub fn query<T>(ptr: *const T) -> Result<Self>
Returns the CUDA pointer attributes for a raw pointer.
§Errors
Returns an error if CUDA cannot query attributes for ptr, ptr is not known to a unified-addressing context, or CUDA reports runtime initialization diagnostics.
Sourcepub fn query_device(ptr: DevicePtr) -> Result<Self>
pub fn query_device(ptr: DevicePtr) -> Result<Self>
Returns CUDA pointer attributes for a raw CUDA device pointer wrapper.
§Errors
Returns an error if CUDA cannot query attributes for ptr, the pointer is not known to the current CUDA context, or CUDA reports runtime initialization diagnostics.
Sourcepub fn query_non_null<T>(ptr: NonNull<T>) -> Result<Self>
pub fn query_non_null<T>(ptr: NonNull<T>) -> Result<Self>
Returns CUDA pointer attributes for a non-null host or device pointer.
§Errors
Returns an error if CUDA cannot query attributes for ptr, the pointer is not known to a unified-addressing context, or CUDA reports runtime initialization diagnostics.
Trait Implementations§
Source§impl Clone for PointerAttributes
impl Clone for PointerAttributes
impl Copy for PointerAttributes
Source§impl Debug for PointerAttributes
impl Debug for PointerAttributes
impl Eq for PointerAttributes
Source§impl Hash for PointerAttributes
impl Hash for PointerAttributes
Source§impl PartialEq for PointerAttributes
impl PartialEq for PointerAttributes
impl StructuralPartialEq for PointerAttributes
Auto Trait Implementations§
impl !Send for PointerAttributes
impl !Sync for PointerAttributes
impl Forget for PointerAttributes
impl Freeze for PointerAttributes
impl Move for PointerAttributes
impl RefUnwindSafe for PointerAttributes
impl Unpin for PointerAttributes
impl UnsafeUnpin for PointerAttributes
impl UnwindSafe for PointerAttributes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.