Skip to content

Commit 98f50ae

Browse files
Revert "[NFC][SYCL] Replace #pragma unroll with dim_loop in accessor.hpp (#6939)"
This reverts commit fee486e.
1 parent 7d2f11f commit 98f50ae

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sycl/include/sycl/accessor.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,8 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
10841084
void __init(ConcreteASPtrType Ptr, range<AdjustedDim> AccessRange,
10851085
range<AdjustedDim> MemRange, id<AdjustedDim> Offset) {
10861086
MData = Ptr;
1087-
detail::dim_loop<AdjustedDim>([&, this](size_t I) {
1087+
#pragma unroll
1088+
for (int I = 0; I < AdjustedDim; ++I) {
10881089
#if __cplusplus >= 201703L
10891090
if constexpr (!(PropertyListT::template has_property<
10901091
sycl::ext::oneapi::property::no_offset>())) {
@@ -1095,7 +1096,7 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
10951096
#endif
10961097
getAccessRange()[I] = AccessRange[I];
10971098
getMemoryRange()[I] = MemRange[I];
1098-
});
1099+
}
10991100

11001101
// Adjust for offsets as that part is invariant for all invocations of
11011102
// operator[]. Will have to re-adjust in get_pointer.
@@ -2414,8 +2415,9 @@ class __SYCL_SPECIAL_CLASS local_accessor_base :
24142415
void __init(ConcreteASPtrType Ptr, range<AdjustedDim> AccessRange,
24152416
range<AdjustedDim>, id<AdjustedDim>) {
24162417
MData = Ptr;
2417-
detail::dim_loop<AdjustedDim>(
2418-
[&, this](size_t I) { getSize()[I] = AccessRange[I]; });
2418+
#pragma unroll
2419+
for (int I = 0; I < AdjustedDim; ++I)
2420+
getSize()[I] = AccessRange[I];
24192421
}
24202422

24212423
public:

0 commit comments

Comments
 (0)