pub struct GpuStorage { /* private fields */ }Expand description
Buffer storage for AMD GPUs.
This struct manages memory resources for HIP kernels, allowing them to be used as bindings for launching kernels.
Implementations§
Source§impl GpuStorage
impl GpuStorage
Sourcepub fn new(mem_alignment: usize) -> Self
pub fn new(mem_alignment: usize) -> Self
Creates a new GpuStorage instance for the specified HIP stream.
§Arguments
mem_alignment- The memory alignment requirement in bytes.
Sourcepub fn perform_deallocations(&mut self)
pub fn perform_deallocations(&mut self)
Deallocates buffers marked for deallocation.
This method processes all pending deallocations by freeing the associated GPU memory.
Trait Implementations§
Source§impl ComputeStorage for GpuStorage
impl ComputeStorage for GpuStorage
Source§type Resource = GpuResource
type Resource = GpuResource
The resource associated type determines the way data is implemented and how
it can be accessed by kernels.
Source§fn get(&mut self, handle: &StorageHandle) -> Self::Resource
fn get(&mut self, handle: &StorageHandle) -> Self::Resource
Returns the underlying resource for a specified storage handle
Source§fn alloc(&mut self, size: u64) -> Result<StorageHandle, IoError>
fn alloc(&mut self, size: u64) -> Result<StorageHandle, IoError>
Allocates
size units of memory and returns a handle to itSource§impl Debug for GpuStorage
impl Debug for GpuStorage
impl Send for GpuStorage
Auto Trait Implementations§
impl Freeze for GpuStorage
impl RefUnwindSafe for GpuStorage
impl !Sync for GpuStorage
impl Unpin for GpuStorage
impl UnwindSafe for GpuStorage
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more