Skip to main content

args_for_elements

Function args_for_elements 

Source
pub fn args_for_elements(
    total: u32,
    workgroup_size: u32,
) -> DispatchIndirectArgs
Expand description

Build DispatchIndirectArgs for a 1-D dispatch over total elements with the given workgroup_size.

Y and Z are set to 1.

ยงExamples

use oxigdal_gpu::{args_for_elements, DispatchIndirectArgs};
let args = args_for_elements(128, 64);
assert_eq!(args, DispatchIndirectArgs { x: 2, y: 1, z: 1 });