Skip to content

Commit d84a020

Browse files
[NFCI][SYCL] Reduce dependencies of <sycl/item.hpp> (#20048)
1 parent b6707c2 commit d84a020

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sycl/include/sycl/item.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
#include <sycl/detail/defines.hpp> // for __SYCL_ASSUME_INT
1212
#include <sycl/detail/defines_elementary.hpp> // for __SYCL_ALWAYS_INLINE, __SYC...
13-
#include <sycl/detail/helpers.hpp> // for Builder
1413
#include <sycl/detail/item_base.hpp> // for id, range, ItemBase
15-
#include <sycl/exception.hpp> // for make_error_code, errc, exce...
1614
#include <sycl/id.hpp> // for id, item
1715
#include <sycl/range.hpp> // for range
1816

@@ -93,8 +91,7 @@ template <int Dimensions = 1, bool with_offset = true> class item {
9391

9492
template <bool has_offset = with_offset>
9593
operator std::enable_if_t<!has_offset, item<Dimensions, true>>() const {
96-
return detail::Builder::createItem<Dimensions, true>(
97-
MImpl.MExtent, MImpl.MIndex, /*Offset*/ {});
94+
return item<Dimensions, true>{MImpl.MExtent, MImpl.MIndex, /*Offset*/ {}};
9895
}
9996

10097
size_t __SYCL_ALWAYS_INLINE get_linear_id() const {
@@ -128,6 +125,8 @@ template <int Dimensions = 1, bool with_offset = true> class item {
128125

129126
friend class detail::Builder;
130127

128+
template <int, bool> friend class item;
129+
131130
private:
132131
detail::ItemBase<Dimensions, with_offset> MImpl;
133132
};

0 commit comments

Comments
 (0)