[llvm] [libsycl] add single_task (PR #192499)
Alexey Bader via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 19 22:03:41 PDT 2026
================
@@ -10,11 +10,41 @@
#include <detail/device_impl.hpp>
#include <detail/event_impl.hpp>
+#include <detail/program_manager.hpp>
+
+#include <algorithm>
_LIBSYCL_BEGIN_NAMESPACE_SYCL
namespace detail {
+static void setKernelLaunchArgs(const detail::UnifiedRangeView &Range,
+ ol_kernel_launch_size_args_t &ArgsToSet) {
+ assert(Range.MDims < 4 && "Invalid dimensions.");
+ uint32_t GlobalSize[3] = {1, 1, 1};
+ if (Range.MGlobalSize) {
+ for (auto I = 0; I < Range.MDims; I++) {
+ GlobalSize[I] = static_cast<uint32_t>(Range.MGlobalSize[I]);
----------------
bader wrote:
```suggestion
assert(Range.MGlobalSize[I] <= std::numeric_limits<uint32_t>::max());
GlobalSize[I] = static_cast<uint32_t>(Range.MGlobalSize[I]);
```
Would it be useful to check that cast doesn't truncate the size?
https://github.com/llvm/llvm-project/pull/192499
More information about the llvm-commits
mailing list