pub struct BufferDescriptor {
pub size: usize,
pub element_size: usize,
pub location: BufferLocation,
pub buffer_type: BufferType,
pub id: usize,
pub backend: GPUBackend,
/* private fields */
}
Expand description
Memory buffer descriptor
Fields§
§size: usize
Size of the buffer in elements
element_size: usize
Element size in bytes
location: BufferLocation
Buffer location
buffer_type: BufferType
Buffer type
id: usize
Buffer ID
backend: GPUBackend
GPU backend used for this buffer
Implementations§
Source§impl BufferDescriptor
impl BufferDescriptor
Sourcepub fn new(
size: usize,
element_size: usize,
location: BufferLocation,
buffer_type: BufferType,
id: usize,
backend: GPUBackend,
) -> FFTResult<Self>
pub fn new( size: usize, element_size: usize, location: BufferLocation, buffer_type: BufferType, id: usize, backend: GPUBackend, ) -> FFTResult<Self>
Create a new buffer descriptor with specified backend
Sourcepub fn new_auto(
size: usize,
element_size: usize,
location: BufferLocation,
buffer_type: BufferType,
id: usize,
) -> FFTResult<Self>
pub fn new_auto( size: usize, element_size: usize, location: BufferLocation, buffer_type: BufferType, id: usize, ) -> FFTResult<Self>
Create a new buffer descriptor with auto-detected backend
Sourcepub fn get_host_ptr(&self) -> (*mut c_void, usize)
pub fn get_host_ptr(&self) -> (*mut c_void, usize)
Get host pointer and size
Sourcepub fn has_device_memory(&self) -> bool
pub fn has_device_memory(&self) -> bool
Check if this buffer has GPU memory allocated
Sourcepub fn copy_host_to_device(&self, hostdata: &[u8]) -> FFTResult<()>
pub fn copy_host_to_device(&self, hostdata: &[u8]) -> FFTResult<()>
Copy data from host to device
Sourcepub fn copy_device_to_host(&self, hostdata: &mut [u8]) -> FFTResult<()>
pub fn copy_device_to_host(&self, hostdata: &mut [u8]) -> FFTResult<()>
Copy data from device to host
Trait Implementations§
Source§impl Clone for BufferDescriptor
impl Clone for BufferDescriptor
Source§fn clone(&self) -> BufferDescriptor
fn clone(&self) -> BufferDescriptor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BufferDescriptor
impl Debug for BufferDescriptor
Source§impl Drop for BufferDescriptor
impl Drop for BufferDescriptor
impl Send for BufferDescriptor
impl Sync for BufferDescriptor
Auto Trait Implementations§
impl Freeze for BufferDescriptor
impl RefUnwindSafe for BufferDescriptor
impl Unpin for BufferDescriptor
impl UnwindSafe for BufferDescriptor
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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