[llvm] [Offload] Add olLaunchKernelSuggestedGroupSize (PR #142130)

Ross Brunton via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 08:41:15 PDT 2025


RossBrunton wrote:

@jhuber6 Eventually, we are looking to implement [urKernelSuggestedWorkSize](https://oneapi-src.github.io/unified-runtime/core/api.html#urkernelgetsuggestedlocalworksize), which takes in the total number of work items in each dimension and returns a suitable workgroup size. `olLaunchKernelSuggestedGroupSize` is intended to be a convenience method to avoid having to call the hypothetical `olKernelSuggestedWorkSize`.

For offload, I was thinking of taking `GenericKernelTy::PreferredNumThreads` (which comes from getDefaultNumThreads) and running it through https://github.com/intel/llvm/blob/sycl/unified-runtime/source/ur/ur.hpp#L555 to get a workgroup size. I have a proof of concept for this, and I'll put up a link when I get the time.

https://github.com/llvm/llvm-project/pull/142130


More information about the llvm-commits mailing list