pub struct ResidencySet(/* private fields */);Expand description
A residency set for managing GPU memory residency.
C++ equivalent: MTL::ResidencySet
Implementations§
Source§impl ResidencySet
impl ResidencySet
Sourcepub fn device(&self) -> Device
pub fn device(&self) -> Device
Get the device that created this residency set.
C++ equivalent: Device* device() const
Sourcepub fn allocated_size(&self) -> u64
pub fn allocated_size(&self) -> u64
Get the allocated size in bytes.
C++ equivalent: uint64_t allocatedSize() const
Sourcepub fn allocation_count(&self) -> UInteger
pub fn allocation_count(&self) -> UInteger
Get the allocation count.
C++ equivalent: NS::UInteger allocationCount() const
Sourcepub fn all_allocations_ptr(&self) -> *const c_void
pub fn all_allocations_ptr(&self) -> *const c_void
Get all allocations as a raw NS::Array pointer.
C++ equivalent: NS::Array* allAllocations() const
Sourcepub fn add_allocation_ptr(&self, allocation: *const c_void)
pub fn add_allocation_ptr(&self, allocation: *const c_void)
Add an allocation using a raw pointer.
C++ equivalent: void addAllocation(const MTL::Allocation*)
Sourcepub fn add_allocations_ptr(
&self,
allocations: *const *const c_void,
count: UInteger,
)
pub fn add_allocations_ptr( &self, allocations: *const *const c_void, count: UInteger, )
Add multiple allocations.
C++ equivalent: void addAllocations(const MTL::Allocation* const[], NS::UInteger)
Sourcepub fn remove_allocation_ptr(&self, allocation: *const c_void)
pub fn remove_allocation_ptr(&self, allocation: *const c_void)
Remove an allocation using a raw pointer.
C++ equivalent: void removeAllocation(const MTL::Allocation*)
Sourcepub fn remove_allocations_ptr(
&self,
allocations: *const *const c_void,
count: UInteger,
)
pub fn remove_allocations_ptr( &self, allocations: *const *const c_void, count: UInteger, )
Remove multiple allocations.
C++ equivalent: void removeAllocations(const MTL::Allocation* const[], NS::UInteger)
Sourcepub fn remove_all_allocations(&self)
pub fn remove_all_allocations(&self)
Remove all allocations.
C++ equivalent: void removeAllAllocations()
Sourcepub fn contains_allocation_ptr(&self, allocation: *const c_void) -> bool
pub fn contains_allocation_ptr(&self, allocation: *const c_void) -> bool
Check if the set contains an allocation.
C++ equivalent: bool containsAllocation(const MTL::Allocation*)
Sourcepub fn request_residency(&self)
pub fn request_residency(&self)
Request residency for all allocations in the set.
C++ equivalent: void requestResidency()
Sourcepub fn end_residency(&self)
pub fn end_residency(&self)
End residency for all allocations in the set.
C++ equivalent: void endResidency()