Function offload
const fn offload<F, T: crate::marker::Tuple, R>(f: F, workgroup_dim: [u32; 3], thread_dim: [u32; 3], args: T) -> R
Generates the LLVM body of a wrapper function to offload a kernel f.
Type Parameters:
F: The kernel to offload. Must be a function item.T: A tuple of arguments passed tof.R: The return type of the kernel.
Arguments:
f: The kernel function to offload.workgroup_dim: A 3D size specifying the number of workgroups to launch.thread_dim: A 3D size specifying the number of threads per workgroup.args: A tuple of arguments forwarded tof.
Example usage (pseudocode):
extern "C"
extern "gpu-kernel"
For reference, see the Clang documentation on offloading: https://clang.llvm.org/docs/OffloadingDesign.html.