Skip to content

Commit

Permalink
[SYCL] Remove sycl::id -> sycl::range conversion (#13293)
Browse files Browse the repository at this point in the history
Non-standard, had been deprecated for some time now.
  • Loading branch information
aelovikov-intel authored Apr 5, 2024
1 parent 8bc909e commit f98e99c
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 43 deletions.
8 changes: 0 additions & 8 deletions sycl/include/sycl/detail/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ template <int dimensions = 1> class array {
return result;
}

operator sycl::range<dimensions>() const {
sycl::range<dimensions> result;
for (int i = 0; i < dimensions; ++i) {
result[i] = common_array[i];
}
return result;
}

size_t get(int dimension) const {
check_dimension(dimension);
return common_array[dimension];
Expand Down
3 changes: 2 additions & 1 deletion sycl/include/sycl/detail/cg_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ class HostKernel : public HostKernelBase {
GlobalSize, LocalSize, GroupSize, GroupID);

detail::NDLoop<Dims>::iterate(LocalSize, [&](const id<Dims> &LocalID) {
id<Dims> GlobalID = GroupID * LocalSize + LocalID + GlobalOffset;
id<Dims> GlobalID =
GroupID * id<Dims>{LocalSize} + LocalID + GlobalOffset;
const sycl::item<Dims, /*Offset=*/true> GlobalItem =
IDBuilder::createItem<Dims, true>(GlobalSize, GlobalID,
GlobalOffset);
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/sycl/group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ template <int Dimensions = 1> class __SYCL_TYPE(group) group {

Func(HItem);
#else
id<Dimensions> GroupStartID = index * localRange;
id<Dimensions> GroupStartID = index * id<Dimensions>{localRange};

// ... host variant needs explicit 'iterate' because it is serial
detail::NDLoop<Dimensions>::iterate(
Expand Down
10 changes: 0 additions & 10 deletions sycl/include/sycl/id.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,6 @@ template <int Dimensions = 1> class id : public detail::array<Dimensions> {
id(ParamTy<N, 3, const item<Dimensions, with_offset>> &item)
: base(item.get_id(0), item.get_id(1), item.get_id(2)) {}

__SYCL_DEPRECATED("range() conversion is deprecated")
explicit operator range<Dimensions>() const {
range<Dimensions> result(
detail::InitializedVal<Dimensions, range>::template get<0>());
for (int i = 0; i < Dimensions; ++i) {
result[i] = this->get(i);
}
return result;
}

#ifndef __SYCL_DISABLE_ID_TO_INT_CONV__
/* Template operator is not allowed because it disables further type
* conversion. For example, the next code will not work in case of template
Expand Down
12 changes: 0 additions & 12 deletions sycl/test/basic_tests/id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,6 @@ int main() {
((twoLeftValue op three_dim_op_right)[1] == \
(twoLeftValue op twoRightValue)) && \
((three_dim_op_left op threeRightValue)[2] == \
(threeLeftValue op threeRightValue))); \
assert((one_dim_op_left op one_dim_op_range)[0] == \
(oneLeftValue op oneRightValue)); \
assert(((two_dim_op_left op two_dim_op_range)[0] == \
(oneLeftValue op oneRightValue)) && \
((two_dim_op_left op two_dim_op_range)[1] == \
(twoLeftValue op twoRightValue))); \
assert(((three_dim_op_left op three_dim_op_range)[0] == \
(oneLeftValue op oneRightValue)) && \
((three_dim_op_left op three_dim_op_range)[1] == \
(twoLeftValue op twoRightValue)) && \
((three_dim_op_left op three_dim_op_range)[2] == \
(threeLeftValue op threeRightValue)));

OPERATOR_TEST(+)
Expand Down
11 changes: 0 additions & 11 deletions sycl/test/warnings/conversion_deprecation.cpp

This file was deleted.

0 comments on commit f98e99c

Please sign in to comment.