pub struct GpuExecutor { /* private fields */ }Expand description
GPU executor for computation graphs
Implementations§
Source§impl GpuExecutor
impl GpuExecutor
Sourcepub fn select_device(&mut self, device: GpuDevice)
pub fn select_device(&mut self, device: GpuDevice)
Select a GPU device
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if GPU is available
Sourcepub fn allocate_buffer(&mut self, size: usize) -> Result<usize, GpuError>
pub fn allocate_buffer(&mut self, size: usize) -> Result<usize, GpuError>
Allocate a buffer on GPU
Sourcepub fn free_buffer(&mut self, id: usize)
pub fn free_buffer(&mut self, id: usize)
Free a buffer
Sourcepub fn compile_kernel(
&mut self,
name: &str,
source: &str,
) -> Result<(), GpuError>
pub fn compile_kernel( &mut self, name: &str, source: &str, ) -> Result<(), GpuError>
Compile and cache a kernel
Sourcepub fn execute_graph(
&mut self,
_graph: &ComputationGraph,
) -> Result<HashMap<String, Vec<f32>>, GpuError>
pub fn execute_graph( &mut self, _graph: &ComputationGraph, ) -> Result<HashMap<String, Vec<f32>>, GpuError>
Execute a computation graph on GPU (stub)
Sourcepub fn kernel_count(&self) -> usize
pub fn kernel_count(&self) -> usize
Get number of compiled kernels
Sourcepub fn buffer_count(&self) -> usize
pub fn buffer_count(&self) -> usize
Get number of allocated buffers
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuExecutor
impl RefUnwindSafe for GpuExecutor
impl Send for GpuExecutor
impl Sync for GpuExecutor
impl Unpin for GpuExecutor
impl UnwindSafe for GpuExecutor
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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