Skip to content

Commit cbc5e69

Browse files
author
Sergey Kanaev
committed
[SYCL] Remove unwanted changes.
Signed-off-by: Sergey Kanaev <[email protected]>
1 parent cee60be commit cbc5e69

File tree

4 files changed

+6
-52
lines changed

4 files changed

+6
-52
lines changed

sycl/include/CL/sycl/detail/defines.hpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,6 @@
4040

4141
#if defined(__SYCL_ID_QUERIES_FIT_IN_INT__) && __has_builtin(__builtin_assume)
4242
#define __SYCL_ASSUME_INT(x) __builtin_assume(x <= INT_MAX)
43-
#define __SYCL_ASSUME_ID_INT(dims, x) \
44-
do { \
45-
for (size_t dim = 0; dim < dims; ++dim) { \
46-
size_t id = x.get_id(dim); \
47-
__SYCL_ASSUME_INT(id); \
48-
} \
49-
} while (0)
50-
#define __SYCL_ASSUME_ARRAY_INT(dims, x) \
51-
do { \
52-
for (size_t dim = 0; dim < dims; ++dim) { \
53-
size_t id = x[dim]; \
54-
__SYCL_ASSUME_INT(id); \
55-
} \
56-
} while (0)
5743
#else
5844
#define __SYCL_ASSUME_INT(x)
59-
#define __SYCL_ASSUME_ID_INT(dims, x)
60-
#define __SYCL_ASSUME_ARRAY_INT(dims, x)
6145
#endif

sycl/include/CL/sycl/item.hpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ template <int dimensions = 1, bool with_offset = true> class item {
2929
public:
3030
item() = delete;
3131

32-
id<dimensions> ALWAYS_INLINE get_id() const {
33-
__SYCL_ASSUME_ARRAY_INT(dimensions, MImpl.MIndex);
34-
return MImpl.MIndex;
35-
}
32+
id<dimensions> ALWAYS_INLINE get_id() const { return MImpl.MIndex; }
3633

3734
size_t ALWAYS_INLINE get_id(int dimension) const {
3835
size_t id = MImpl.MIndex[dimension];
@@ -46,10 +43,7 @@ template <int dimensions = 1, bool with_offset = true> class item {
4643
return id;
4744
}
4845

49-
range<dimensions> ALWAYS_INLINE get_range() const {
50-
__SYCL_ASSUME_ARRAY_INT(dimensions, MImpl.MExtent);
51-
return MImpl.MExtent;
52-
}
46+
range<dimensions> ALWAYS_INLINE get_range() const { return MImpl.MExtent; }
5347

5448
size_t ALWAYS_INLINE get_range(int dimension) const {
5549
size_t id = MImpl.MExtent[dimension];
@@ -58,9 +52,7 @@ template <int dimensions = 1, bool with_offset = true> class item {
5852
}
5953

6054
template <bool has_offset = with_offset>
61-
detail::enable_if_t<has_offset, id<dimensions>>
62-
ALWAYS_INLINE get_offset() const {
63-
__SYCL_ASSUME_ARRAY_INT(dimensions, MImpl.MOffset);
55+
detail::enable_if_t<has_offset, id<dimensions>> get_offset() const {
6456
return MImpl.MOffset;
6557
}
6658

sycl/include/CL/sycl/nd_item.hpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ template <int dimensions = 1> class nd_item {
3232
public:
3333
nd_item() = delete;
3434

35-
id<dimensions> ALWAYS_INLINE get_global_id() const {
36-
__SYCL_ASSUME_ID_INT(dimensions, globalItem);
37-
return globalItem.get_id();
38-
}
35+
id<dimensions> get_global_id() const { return globalItem.get_id(); }
3936

4037
size_t ALWAYS_INLINE get_global_id(int dimension) const {
4138
size_t id = globalItem.get_id(dimension);
@@ -49,10 +46,7 @@ template <int dimensions = 1> class nd_item {
4946
return id;
5047
}
5148

52-
id<dimensions> ALWAYS_INLINE get_local_id() const {
53-
__SYCL_ASSUME_ID_INT(dimensions, localItem);
54-
return localItem.get_id();
55-
}
49+
id<dimensions> get_local_id() const { return localItem.get_id(); }
5650

5751
size_t ALWAYS_INLINE get_local_id(int dimension) const {
5852
size_t id = localItem.get_id(dimension);
@@ -66,10 +60,7 @@ template <int dimensions = 1> class nd_item {
6660
return id;
6761
}
6862

69-
group<dimensions> ALWAYS_INLINE get_group() const {
70-
__SYCL_ASSUME_ARRAY_INT(dimensions, Group);
71-
return Group;
72-
}
63+
group<dimensions> get_group() const { return Group; }
7364

7465
intel::sub_group get_sub_group() const { return intel::sub_group(); }
7566

sycl/test/basic_tests/id_queries_fit_int.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ int main() {
1515
// CHECK: call void @llvm.assume(i1 {{.*}})
1616
int LinearId = TestItem.get_linear_id();
1717

18-
id<1> IdD = TestItem.get_id();
19-
// CHECK: call void @llvm.assume(i1 {{.*}})
20-
range<1> RangeD = TestItem.get_range();
21-
// CHECK: call void @llvm.assume(i1 {{.*}})
22-
id<1> Offset = TestItem.get_offset();
23-
// CHECK: call void @llvm.assume(i1 {{.*}})
24-
2518
cl::sycl::nd_item<1> TestNDItem =
2619
detail::Builder::createNDItem<1>(detail::Builder::createItem<1, false>({4}, {2}),
2720
detail::Builder::createItem<1, false>({2}, {0}),
@@ -46,12 +39,6 @@ int main() {
4639
// CHECK: call void @llvm.assume(i1 {{.*}})
4740
int LocalRange = TestNDItem.get_local_range(0);
4841

49-
id<1> GlobalIdD = TestNDItem.get_global_id();
50-
// CHECK: call void @llvm.assume(i1 {{.*}})
51-
id<1> LocalIdD = TestNDItem.get_local_id();
52-
// CHECK: call void @llvm.assume(i1 {{.*}})
53-
group<1> GroupD = TestNDItem.get_group();
54-
5542
return 0;
5643
}
5744
// CHECK: }

0 commit comments

Comments
 (0)