pub struct GroupCountPlanner { /* private fields */ }Expand description
Plans ze_group_count_t launch grids from global problem sizes.
Given a per-dimension workgroup (local) size, plan_* computes the smallest
group count whose group_count * local_size >= global_size, i.e. the
ceiling division used by zeCommandListAppendLaunchKernel. The kernel’s
bounds check (if (gid < count)) masks the overhang.
Implementations§
Source§impl GroupCountPlanner
impl GroupCountPlanner
Sourcepub fn new_1d(local_x: u32) -> LevelZeroResult<Self>
pub fn new_1d(local_x: u32) -> LevelZeroResult<Self>
Create a 1-D planner with the given workgroup size.
Sourcepub fn new_3d(local_x: u32, local_y: u32, local_z: u32) -> LevelZeroResult<Self>
pub fn new_3d(local_x: u32, local_y: u32, local_z: u32) -> LevelZeroResult<Self>
Create a 3-D planner. Every local dimension must be non-zero.
Sourcepub fn local_size(&self) -> (u32, u32, u32)
pub fn local_size(&self) -> (u32, u32, u32)
The configured local (workgroup) size.
Sourcepub fn plan_1d(&self, global_x: u64) -> LevelZeroResult<GroupCount>
pub fn plan_1d(&self, global_x: u64) -> LevelZeroResult<GroupCount>
Plan a 1-D launch grid covering global_x work-items.
Sourcepub fn plan_3d(
&self,
global_x: u64,
global_y: u64,
global_z: u64,
) -> LevelZeroResult<GroupCount>
pub fn plan_3d( &self, global_x: u64, global_y: u64, global_z: u64, ) -> LevelZeroResult<GroupCount>
Plan a 3-D launch grid covering (global_x, global_y, global_z)
work-items.
Returns LevelZeroError::InvalidArgument if any dimension’s group
count would overflow u32 (the Level Zero limit).
Trait Implementations§
Source§impl Clone for GroupCountPlanner
impl Clone for GroupCountPlanner
Source§fn clone(&self) -> GroupCountPlanner
fn clone(&self) -> GroupCountPlanner
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 moreimpl Copy for GroupCountPlanner
Auto Trait Implementations§
impl Freeze for GroupCountPlanner
impl RefUnwindSafe for GroupCountPlanner
impl Send for GroupCountPlanner
impl Sync for GroupCountPlanner
impl Unpin for GroupCountPlanner
impl UnsafeUnpin for GroupCountPlanner
impl UnwindSafe for GroupCountPlanner
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