Skip to content

Commit 8074617

Browse files
authored
[SYCL][NFC] Remove item dependency on reduction. (#12135)
Use Builder::createItem help function to create `item` object instead of adding one helper function in reduction namespace.
1 parent 525e69f commit 8074617

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

sycl/include/sycl/detail/reduction_forward.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
#pragma once
1010

11+
#include <sycl/detail/helpers.hpp> // for Builder
1112
#include <sycl/detail/item_base.hpp> // for range
1213
#include <sycl/id.hpp> // for id
13-
#include <sycl/item.hpp> // for getDelinearizedItem, item
14+
#include <sycl/item.hpp> // for item
1415
#include <sycl/nd_range.hpp> // for nd_range
1516
#include <sycl/range.hpp> // for range
1617

@@ -51,7 +52,7 @@ template <class FunctorTy> void withAuxHandler(handler &CGH, FunctorTy Func);
5152

5253
template <int Dims>
5354
item<Dims, false> getDelinearizedItem(range<Dims> Range, id<Dims> Id) {
54-
return {Range, Id};
55+
return Builder::createItem<Dims, false>(Range, Id);
5556
}
5657
} // namespace reduction
5758

sycl/include/sycl/item.hpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,13 @@
2121

2222
namespace sycl {
2323
inline namespace _V1 {
24+
2425
namespace detail {
2526
class Builder;
2627
template <typename TransformedArgType, int Dims, typename KernelType>
2728
class RoundedRangeKernel;
2829
template <typename TransformedArgType, int Dims, typename KernelType>
2930
class RoundedRangeKernelWithKH;
30-
31-
namespace reduction {
32-
template <int Dims>
33-
item<Dims, false> getDelinearizedItem(range<Dims> Range, id<Dims> Id);
34-
} // namespace reduction
3531
} // namespace detail
3632

3733
/// Identifies an instance of the function object executing at each point
@@ -133,10 +129,6 @@ template <int Dimensions = 1, bool with_offset = true> class item {
133129
friend class detail::Builder;
134130

135131
private:
136-
template <int Dims>
137-
friend item<Dims, false>
138-
detail::reduction::getDelinearizedItem(range<Dims> Range, id<Dims> Id);
139-
140132
detail::ItemBase<Dimensions, with_offset> MImpl;
141133
};
142134

0 commit comments

Comments
 (0)