pub struct GpuProgram {
pub source_size: usize,
pub output_count: usize,
pub operation_count: usize,
pub carried: usize,
pub stages: Vec<String>,
pub dispatch_records: Option<usize>,
/* private fields */
}Expand description
A compiled program on the GPU: a pipeline per shader stage and the constant tables.
Fields§
§source_size: usize§output_count: usize§operation_count: usizeOperations the shaders evaluate per record.
carried: usize32-bit words per record that stages pass to later stages.
stages: Vec<String>The WGSL of each stage, run in order.
dispatch_records: Option<usize>At most this many records per dispatch; None fits each dispatch’s buffers in the device’s storage binding
limit.
Implementations§
Source§impl GpuProgram
impl GpuProgram
Sourcepub fn new(
gpu: &Gpu,
circuit: &Circuit,
roots: &[Wire],
) -> Result<GpuProgram, GpuError>
pub fn new( gpu: &Gpu, circuit: &Circuit, roots: &[Wire], ) -> Result<GpuProgram, GpuError>
Compile the operations that roots need into shaders.
pub fn from_program( gpu: &Gpu, program: &TensorProgram, ) -> Result<GpuProgram, GpuError>
Sourcepub fn from_program_staged(
gpu: &Gpu,
program: &TensorProgram,
statements: usize,
) -> Result<GpuProgram, GpuError>
pub fn from_program_staged( gpu: &Gpu, program: &TensorProgram, statements: usize, ) -> Result<GpuProgram, GpuError>
Like GpuProgram::from_program, starting a new stage after statements statements whatever the
program’s length (usize::MAX for one shader).
Auto Trait Implementations§
impl !RefUnwindSafe for GpuProgram
impl !UnwindSafe for GpuProgram
impl Freeze for GpuProgram
impl Send for GpuProgram
impl Sync for GpuProgram
impl Unpin for GpuProgram
impl UnsafeUnpin for GpuProgram
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