pub struct Bindings {
pub buffers: Vec<Binding>,
pub metadata: MetadataBinding,
pub scalars: BTreeMap<Elem, ScalarBinding>,
pub tensor_maps: Vec<TensorMapBinding>,
}
Expand description
Bindings to execute a kernel.
Fields§
§buffers: Vec<Binding>
Buffer bindings
metadata: MetadataBinding
Packed metadata for tensor bindings (len, shape, stride, etc). Ordered by inputs, then outputs, then tensormaps
scalars: BTreeMap<Elem, ScalarBinding>
Scalar bindings
tensor_maps: Vec<TensorMapBinding>
Tensor map bindings
Implementations§
Source§impl Bindings
impl Bindings
Sourcepub fn with_buffer(self, binding: Binding) -> Self
pub fn with_buffer(self, binding: Binding) -> Self
Add a buffer binding
Sourcepub fn with_buffers(self, bindings: Vec<Binding>) -> Self
pub fn with_buffers(self, bindings: Vec<Binding>) -> Self
Extend the buffers with bindings
Sourcepub fn with_scalar(self, elem: Elem, length: usize, data: Vec<u64>) -> Self
pub fn with_scalar(self, elem: Elem, length: usize, data: Vec<u64>) -> Self
Add a scalar parameter
Sourcepub fn with_scalars(self, bindings: Vec<ScalarBinding>) -> Self
pub fn with_scalars(self, bindings: Vec<ScalarBinding>) -> Self
Extend the scalars with bindings
Sourcepub fn with_metadata(self, meta: MetadataBinding) -> Self
pub fn with_metadata(self, meta: MetadataBinding) -> Self
Set the metadata to meta
Sourcepub fn with_tensor_maps(self, bindings: Vec<TensorMapBinding>) -> Self
pub fn with_tensor_maps(self, bindings: Vec<TensorMapBinding>) -> Self
Extend the tensor maps with bindings
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bindings
impl RefUnwindSafe for Bindings
impl Send for Bindings
impl Sync for Bindings
impl Unpin for Bindings
impl UnwindSafe for Bindings
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