Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9571fec
[SYCL] Add structure to pass references to ranges
Alexandr-Konovalov Aug 14, 2025
2521805
Fix formatting.
Alexandr-Konovalov Aug 14, 2025
1a90e48
Fix const.
Alexandr-Konovalov Aug 14, 2025
38945f3
Rename RangesRefT to ranges_ref_view and move to sycl::detail namespace.
Alexandr-Konovalov Aug 18, 2025
d4c267e
Fix formatting.
Alexandr-Konovalov Aug 18, 2025
0d76be9
Move assignment near ctors.
Alexandr-Konovalov Aug 19, 2025
858bf21
Decrease dumpilcation is the test.
Alexandr-Konovalov Aug 19, 2025
95beb6a
Fix formatting.
Alexandr-Konovalov Aug 19, 2025
f2e347d
Fix formatting.
Alexandr-Konovalov Aug 19, 2025
71e2eee
Add export to sycl::detail::NDRDescT.
Alexandr-Konovalov Aug 22, 2025
7a3f269
Fix formatting.
Alexandr-Konovalov Aug 22, 2025
e6ab5e7
Merge branch 'sycl' into Alexandr-Konovalov/ref-ndrange
Alexandr-Konovalov Aug 25, 2025
d309440
Rename sycl::detail::ranges_ref_view to nd_range_view.
Alexandr-Konovalov Aug 27, 2025
c7bc868
Fix formatting.
Alexandr-Konovalov Aug 27, 2025
2754978
Merge branch 'sycl' into Alexandr-Konovalov/ref-ndrange
Alexandr-Konovalov Sep 8, 2025
d635399
Merge branch 'sycl' into Alexandr-Konovalov/ref-ndrange
Alexandr-Konovalov Sep 8, 2025
063997e
Merge branch 'sycl' into nd_range_view_struct_only
slawekptak Oct 30, 2025
a3ae6c0
Update the nd_range_view and NDRDescT conversion
slawekptak Oct 31, 2025
fbebaef
Merge branch 'sycl' into nd_range_view_struct_and_no_handler
slawekptak Oct 31, 2025
ce2a223
Merge branch 'sycl' into nd_range_view_struct_and_no_handler
slawekptak Nov 3, 2025
8c970ab
Update Linux symbols
slawekptak Nov 3, 2025
8a434a1
Update the include deps tests
slawekptak Nov 3, 2025
fa35c99
Add nd_range_view layout tests
slawekptak Nov 3, 2025
b4184b4
Move the nd_range_view layout test to a separate file
slawekptak Nov 3, 2025
1677e6d
Merge branch 'sycl' into nd_range_view_struct_and_no_handler
slawekptak Nov 4, 2025
fa083a4
Update Linux symbols
slawekptak Nov 4, 2025
8227e9a
Update Windows symbols
slawekptak Nov 4, 2025
df435a0
Fix formatting
slawekptak Nov 4, 2025
8ebfad6
Merge branch 'sycl' into nd_range_view_struct_and_no_handler
slawekptak Nov 6, 2025
7677e98
Update Linux symbols
slawekptak Nov 6, 2025
4404ab1
Update Windows symbols
slawekptak Nov 6, 2025
c04aa1f
Remove include comment
slawekptak Nov 6, 2025
eea6565
Pass nd_range_view as const &
slawekptak Nov 12, 2025
e912039
Update Linux symbols
slawekptak Nov 12, 2025
34e875a
Update Windows symbols
slawekptak Nov 13, 2025
bdddb77
Support for range-based handler-less kernel submission
slawekptak Nov 13, 2025
3df0798
Support for range-based handler-less kernel submission - continue
slawekptak Nov 14, 2025
906d3df
Range-based kernel submit - part 3 - add exports
slawekptak Nov 14, 2025
2e2d48c
Fix nested calls tracker and num kernel copies test.
slawekptak Nov 14, 2025
0ebccee
Add export header
slawekptak Nov 17, 2025
0f1b0ab
Fix formatting
slawekptak Nov 17, 2025
ae2eda9
Move functions out of preview macro
slawekptak Nov 17, 2025
e8ad6a9
Update Linux symbols
slawekptak Nov 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions sycl/include/sycl/detail/nd_range_view.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//==---- nd_range_view.hpp --- SYCL iteration with reference to ranges ---==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#pragma once

#include <sycl/nd_range.hpp>

namespace sycl {
inline namespace _V1 {
namespace detail {

class NDRDescT;

// The structure to keep dimension and references to ranges unified for
// all dimensions.
class nd_range_view {

public:
nd_range_view() = default;
nd_range_view(const nd_range_view &Desc) = default;
nd_range_view(nd_range_view &&Desc) = default;
nd_range_view &operator=(const nd_range_view &Desc) = default;
nd_range_view &operator=(nd_range_view &&Desc) = default;

template <int Dims_>
nd_range_view(sycl::range<Dims_> &N, bool SetNumWorkGroups = false)
: MGlobalSize(&(N[0])), MSetNumWorkGroups(SetNumWorkGroups),
MDims{size_t(Dims_)} {}

template <int Dims_>
nd_range_view(sycl::range<Dims_> &GlobalSize, sycl::id<Dims_> &Offset)
: MGlobalSize(&(GlobalSize[0])), MOffset(&(Offset[0])),
MDims{size_t(Dims_)} {}

template <int Dims_>
nd_range_view(sycl::nd_range<Dims_> &ExecutionRange)
: MGlobalSize(&(ExecutionRange.globalSize[0])),
MLocalSize(&(ExecutionRange.localSize[0])),
MOffset(&(ExecutionRange.offset[0])), MDims{size_t(Dims_)} {}

sycl::detail::NDRDescT toNDRDescT() const;

const size_t *MGlobalSize = nullptr;
const size_t *MLocalSize = nullptr;
const size_t *MOffset = nullptr;
bool MSetNumWorkGroups = false;
size_t MDims = 0;
};

} // namespace detail
} // namespace _V1
} // namespace sycl
40 changes: 19 additions & 21 deletions sycl/include/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,24 @@ class RoundedRangeKernelWithKH {
}
};

template <typename WrapperT, typename TransformedArgType, int Dims,
typename KernelType,
std::enable_if_t<detail::KernelLambdaHasKernelHandlerArgT<
KernelType, TransformedArgType>::value> * = nullptr>
auto getRangeRoundedKernelLambda(KernelType KernelFunc, range<Dims> UserRange) {
return detail::RoundedRangeKernelWithKH<TransformedArgType, Dims, KernelType>{
UserRange, KernelFunc};
}

template <typename WrapperT, typename TransformedArgType, int Dims,
typename KernelType,
std::enable_if_t<!detail::KernelLambdaHasKernelHandlerArgT<
KernelType, TransformedArgType>::value> * = nullptr>
auto getRangeRoundedKernelLambda(KernelType KernelFunc, range<Dims> UserRange) {
return detail::RoundedRangeKernel<TransformedArgType, Dims, KernelType>{
UserRange, KernelFunc};
}

using std::enable_if_t;
using sycl::detail::queue_impl;

Expand Down Expand Up @@ -1218,7 +1236,7 @@ class __SYCL_EXPORT handler {
if (HasRoundedRange) {
using NameWT = typename detail::get_kernel_wrapper_name_t<NameT>::name;
auto Wrapper =
getRangeRoundedKernelLambda<NameWT, TransformedArgType, Dims>(
detail::getRangeRoundedKernelLambda<NameWT, TransformedArgType, Dims>(
KernelFunc, UserRange);

using KName = std::conditional_t<std::is_same<KernelType, NameT>::value,
Expand Down Expand Up @@ -3265,26 +3283,6 @@ class __SYCL_EXPORT handler {
void GetRangeRoundingSettings(size_t &MinFactor, size_t &GoodFactor,
size_t &MinRange);

template <typename WrapperT, typename TransformedArgType, int Dims,
typename KernelType,
std::enable_if_t<detail::KernelLambdaHasKernelHandlerArgT<
KernelType, TransformedArgType>::value> * = nullptr>
auto getRangeRoundedKernelLambda(KernelType KernelFunc,
range<Dims> UserRange) {
return detail::RoundedRangeKernelWithKH<TransformedArgType, Dims,
KernelType>{UserRange, KernelFunc};
}

template <typename WrapperT, typename TransformedArgType, int Dims,
typename KernelType,
std::enable_if_t<!detail::KernelLambdaHasKernelHandlerArgT<
KernelType, TransformedArgType>::value> * = nullptr>
auto getRangeRoundedKernelLambda(KernelType KernelFunc,
range<Dims> UserRange) {
return detail::RoundedRangeKernel<TransformedArgType, Dims, KernelType>{
UserRange, KernelFunc};
}

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
const std::shared_ptr<detail::context_impl> &getContextImplPtr() const;
#endif
Expand Down
6 changes: 6 additions & 0 deletions sycl/include/sycl/nd_range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
namespace sycl {
inline namespace _V1 {

namespace detail {
class nd_range_view;
}

/// Defines the iteration domain of both the work-groups and the overall
/// dispatch.
///
Expand Down Expand Up @@ -65,6 +69,8 @@ template <int Dimensions = 1> class nd_range {
bool operator!=(const nd_range<Dimensions> &rhs) const {
return !(*this == rhs);
}

friend class sycl::_V1::detail::nd_range_view;
};

} // namespace _V1
Expand Down
Loading
Loading