Skip to content

Commit f98e99c

Browse files
[SYCL] Remove sycl::id -> sycl::range conversion (#13293)
Non-standard, had been deprecated for some time now.
1 parent 8bc909e commit f98e99c

File tree

6 files changed

+3
-43
lines changed

6 files changed

+3
-43
lines changed

sycl/include/sycl/detail/array.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ template <int dimensions = 1> class array {
5959
return result;
6060
}
6161

62-
operator sycl::range<dimensions>() const {
63-
sycl::range<dimensions> result;
64-
for (int i = 0; i < dimensions; ++i) {
65-
result[i] = common_array[i];
66-
}
67-
return result;
68-
}
69-
7062
size_t get(int dimension) const {
7163
check_dimension(dimension);
7264
return common_array[dimension];

sycl/include/sycl/detail/cg_types.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,8 @@ class HostKernel : public HostKernelBase {
398398
GlobalSize, LocalSize, GroupSize, GroupID);
399399

400400
detail::NDLoop<Dims>::iterate(LocalSize, [&](const id<Dims> &LocalID) {
401-
id<Dims> GlobalID = GroupID * LocalSize + LocalID + GlobalOffset;
401+
id<Dims> GlobalID =
402+
GroupID * id<Dims>{LocalSize} + LocalID + GlobalOffset;
402403
const sycl::item<Dims, /*Offset=*/true> GlobalItem =
403404
IDBuilder::createItem<Dims, true>(GlobalSize, GlobalID,
404405
GlobalOffset);

sycl/include/sycl/group.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ template <int Dimensions = 1> class __SYCL_TYPE(group) group {
204204

205205
Func(HItem);
206206
#else
207-
id<Dimensions> GroupStartID = index * localRange;
207+
id<Dimensions> GroupStartID = index * id<Dimensions>{localRange};
208208

209209
// ... host variant needs explicit 'iterate' because it is serial
210210
detail::NDLoop<Dimensions>::iterate(

sycl/include/sycl/id.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,6 @@ template <int Dimensions = 1> class id : public detail::array<Dimensions> {
9999
id(ParamTy<N, 3, const item<Dimensions, with_offset>> &item)
100100
: base(item.get_id(0), item.get_id(1), item.get_id(2)) {}
101101

102-
__SYCL_DEPRECATED("range() conversion is deprecated")
103-
explicit operator range<Dimensions>() const {
104-
range<Dimensions> result(
105-
detail::InitializedVal<Dimensions, range>::template get<0>());
106-
for (int i = 0; i < Dimensions; ++i) {
107-
result[i] = this->get(i);
108-
}
109-
return result;
110-
}
111-
112102
#ifndef __SYCL_DISABLE_ID_TO_INT_CONV__
113103
/* Template operator is not allowed because it disables further type
114104
* conversion. For example, the next code will not work in case of template

sycl/test/basic_tests/id.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -262,18 +262,6 @@ int main() {
262262
((twoLeftValue op three_dim_op_right)[1] == \
263263
(twoLeftValue op twoRightValue)) && \
264264
((three_dim_op_left op threeRightValue)[2] == \
265-
(threeLeftValue op threeRightValue))); \
266-
assert((one_dim_op_left op one_dim_op_range)[0] == \
267-
(oneLeftValue op oneRightValue)); \
268-
assert(((two_dim_op_left op two_dim_op_range)[0] == \
269-
(oneLeftValue op oneRightValue)) && \
270-
((two_dim_op_left op two_dim_op_range)[1] == \
271-
(twoLeftValue op twoRightValue))); \
272-
assert(((three_dim_op_left op three_dim_op_range)[0] == \
273-
(oneLeftValue op oneRightValue)) && \
274-
((three_dim_op_left op three_dim_op_range)[1] == \
275-
(twoLeftValue op twoRightValue)) && \
276-
((three_dim_op_left op three_dim_op_range)[2] == \
277265
(threeLeftValue op threeRightValue)));
278266

279267
OPERATOR_TEST(+)

sycl/test/warnings/conversion_deprecation.cpp

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)