pub struct KernelSpec {
pub name: String,
pub workgroup_size: [u32; 3],
pub buffer_bindings: Vec<BufferId>,
}Expand description
Specification for a GPU compute kernel dispatch.
Fields§
§name: StringHuman-readable kernel name.
workgroup_size: [u32; 3]Number of threads per workgroup \[X, Y, Z\].
buffer_bindings: Vec<BufferId>Ordered list of buffer bindings for this kernel.
Implementations§
Source§impl KernelSpec
impl KernelSpec
Sourcepub fn new(
name: impl Into<String>,
workgroup_x: u32,
buffer_bindings: Vec<BufferId>,
) -> Self
pub fn new( name: impl Into<String>, workgroup_x: u32, buffer_bindings: Vec<BufferId>, ) -> Self
Create a new kernel spec with a 1-D workgroup.
Sourcepub fn with_workgroup_3d(
name: impl Into<String>,
workgroup_size: [u32; 3],
buffer_bindings: Vec<BufferId>,
) -> Self
pub fn with_workgroup_3d( name: impl Into<String>, workgroup_size: [u32; 3], buffer_bindings: Vec<BufferId>, ) -> Self
Create a kernel spec with a 3-D workgroup size.
Sourcepub fn num_workgroups_x(&self, total_items: u32) -> u32
pub fn num_workgroups_x(&self, total_items: u32) -> u32
Compute the number of workgroups needed for total_items in the X dimension.
Sourcepub fn threads_per_workgroup(&self) -> u32
pub fn threads_per_workgroup(&self) -> u32
Total threads per workgroup.
Trait Implementations§
Source§impl Clone for KernelSpec
impl Clone for KernelSpec
Source§fn clone(&self) -> KernelSpec
fn clone(&self) -> KernelSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for KernelSpec
impl RefUnwindSafe for KernelSpec
impl Send for KernelSpec
impl Sync for KernelSpec
impl Unpin for KernelSpec
impl UnsafeUnpin for KernelSpec
impl UnwindSafe for KernelSpec
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