[llvm-branch-commits] [llvm] [libsycl] add single_task (PR #188797)
Kseniya Tikhomirova via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Apr 2 06:18:08 PDT 2026
================
@@ -16,6 +16,32 @@ _LIBSYCL_BEGIN_NAMESPACE_SYCL
namespace detail {
+static void setKernelLaunchArgs(const detail::UnifiedRangeView &Range,
+ ol_kernel_launch_size_args_t &ArgsToSet) {
+ size_t GlobalSize[3] = {1, 1, 1};
+ if (Range.MGlobalSize) {
+ for (uint32_t I = 0; I < Range.MDims; I++) {
+ GlobalSize[I] = Range.MGlobalSize[I];
+ }
+ }
+
+ size_t GroupSize[3] = {1, 1, 1};
+ if (Range.MLocalSize) {
+ for (uint32_t I = 0; I < Range.MDims; I++) {
+ GroupSize[I] = Range.MLocalSize[I];
+ }
+ }
+
+ ArgsToSet.Dimensions = Range.MDims;
+ ArgsToSet.NumGroups.x = GlobalSize[0] / GroupSize[0];
+ ArgsToSet.NumGroups.y = GlobalSize[1] / GroupSize[1];
+ ArgsToSet.NumGroups.z = GlobalSize[2] / GroupSize[2];
----------------
KseniyaTikhomirova wrote:
Clarified with Greg, he created a Khronos issue to clarify this behavior in spec https://github.com/KhronosGroup/SYCL-Docs/issues/993.
main point is to define this behavior UB, we shouldn't handle it at all and allow dividing by 0
https://github.com/llvm/llvm-project/pull/188797
More information about the llvm-branch-commits
mailing list