Skip to content

Commit

Permalink
[SYCL][E2E] Remove deprecated use of accessor::get_pointer (intel#1…
Browse files Browse the repository at this point in the history
…5424)

- replaced with `get_multi_ptr().get()` in
`DiscardEvents/discard_events_accessors.cpp` and
`GroupAlgorithm/different_types.cpp`
- Use `-DSYCL2020_DISABLE_DEPRECATION_WARNINGS` in place of
`-Wno-error=deprecated-declarations` in
`Basic/offset-accessor-get_pointer.cpp` due to `accessor::get_pointer`'s
deliberate use. This brings it in line with `Basic/multi_ptr_legacy.cpp`
which also uses it deliberately.
  • Loading branch information
ayylol committed Sep 18, 2024
1 parent dae7032 commit b6286e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/offset-accessor-get_pointer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out
// RUN: %{build} -DSYCL2020_DISABLE_DEPRECATION_WARNINGS -o %t.out
// RUN: %{run} %t.out

// Per the SYCL 2020 spec (4.7.6.12 and others)
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/DiscardEvents/discard_events_accessors.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out
// RUN: %{build} -o %t.out
//
// RUN: env SYCL_UR_TRACE=2 %{run} %t.out &> %t.txt ; FileCheck %s --input-file %t.txt
//
Expand Down Expand Up @@ -60,7 +60,7 @@ int main(int Argc, const char *Argv[]) {
CGH.parallel_for<class kernel_using_local_memory>(
NDRange, [=](sycl::nd_item<1> ndi) {
size_t i = ndi.get_global_id(0);
int *Ptr = LocalAcc.get_pointer();
int *Ptr = LocalAcc.get_multi_ptr<access::decorated::no>().get();
Ptr[i] = i + 5;
Harray[i] = Ptr[i] + 5;
});
Expand Down
8 changes: 5 additions & 3 deletions sycl/test-e2e/GroupAlgorithm/different_types.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %{build} -Wno-error=deprecated-declarations -fsycl-device-code-split=per_kernel -I . -o %t.out
// RUN: %{build} -fsycl-device-code-split=per_kernel -I . -o %t.out
// RUN: %{run} %t.out

#include "../helpers.hpp"
Expand Down Expand Up @@ -28,8 +28,10 @@ void test(queue &q, const InputContainer &input, InitT init,
const auto g = it.get_group();
const auto sg = it.get_sub_group();
const auto idx = it.get_local_id();
const auto begin = a_in.get_pointer();
const auto end = a_in.get_pointer() + N;
const auto begin =
a_in.template get_multi_ptr<access::decorated::no>().get();
const auto end =
a_in.template get_multi_ptr<access::decorated::no>().get() + N;

a_reduce_out[0] = reduce_over_group(g, a_in[idx], init, binary_op);
a_reduce_out[1] = joint_reduce(g, begin, end, init, binary_op);
Expand Down

0 comments on commit b6286e1

Please sign in to comment.