pub struct FftGpuContext { /* private fields */ }
Expand description
FFT-specific GPU context wrapping scirs2-core GPU context
Implementations§
Source§impl FftGpuContext
impl FftGpuContext
Sourcepub fn new(deviceid: i32) -> FFTResult<Self>
pub fn new(deviceid: i32) -> FFTResult<Self>
Create a new FFT GPU context for the specified device
Sourcepub fn device_info(&self) -> &GpuDeviceInfo
pub fn device_info(&self) -> &GpuDeviceInfo
Get device information
Sourcepub fn allocate(&self, sizebytes: usize) -> FFTResult<BufferDescriptor>
pub fn allocate(&self, sizebytes: usize) -> FFTResult<BufferDescriptor>
Allocate device memory
Sourcepub fn free(&self, descriptor: BufferDescriptor) -> FFTResult<()>
pub fn free(&self, descriptor: BufferDescriptor) -> FFTResult<()>
Free device memory
Sourcepub fn copy_host_to_device<T>(
&self,
host_data: &[T],
device_buffer: &BufferDescriptor,
) -> FFTResult<()>
pub fn copy_host_to_device<T>( &self, host_data: &[T], device_buffer: &BufferDescriptor, ) -> FFTResult<()>
Copy data from host to device
Sourcepub fn copy_device_to_host<T>(
&self,
device_buffer: &BufferDescriptor,
host_data: &mut [T],
) -> FFTResult<()>
pub fn copy_device_to_host<T>( &self, device_buffer: &BufferDescriptor, host_data: &mut [T], ) -> FFTResult<()>
Copy data from device to host
Auto Trait Implementations§
impl Freeze for FftGpuContext
impl !RefUnwindSafe for FftGpuContext
impl Send for FftGpuContext
impl Sync for FftGpuContext
impl Unpin for FftGpuContext
impl !UnwindSafe for FftGpuContext
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