Skip to content

Commit 157310a

Browse files
authored
[SYCL][E2E] Remove deprecated warnings in XPTI e2e tests (#14257)
- Use callable device selector instead of deprecated filter selector in `buffer/multiple_queues.cpp` - Use host accessor constructor instead of deprecated buffer `get_access` call in the rest of changed files
1 parent 973b8cb commit 157310a

File tree

7 files changed

+18
-15
lines changed

7 files changed

+18
-15
lines changed

sycl/test-e2e/XPTI/buffer/accessors.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ int main() {
4545
(void)A6;
4646
});
4747
});
48-
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID7:.*]]|2018|1024|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
49-
{ auto HA = Buf.get_access<mode::read>(); }
50-
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID8:.*]]|2018|1025|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
51-
{ auto HA = Buf.get_access<mode::write>(); }
52-
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID9:.*]]|2018|1026|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
53-
{ auto HA = Buf.get_access<mode::read_write>(); }
48+
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID7:.*]]|2018|1024|{{.*}}accessors.cpp:[[# @LINE + 1]]:25
49+
{ sycl::host_accessor HA(Buf, sycl::read_only); }
50+
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID8:.*]]|2018|1025|{{.*}}accessors.cpp:[[# @LINE + 1]]:25
51+
{ sycl::host_accessor HA(Buf, sycl::write_only); }
52+
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID9:.*]]|2018|1026|{{.*}}accessors.cpp:[[# @LINE + 1]]:25
53+
{ sycl::host_accessor HA(Buf, sycl::read_write); }
5454
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID10:.*]]|2018|1027|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
5555
{ auto HA = Buf.get_access<mode::discard_write>(); }
5656
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID11:.*]]|2018|1028|{{.*}}accessors.cpp:[[# @LINE + 1]]:15

sycl/test-e2e/XPTI/buffer/in_cycle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ bool func(sycl::queue &Queue, int depth = 0) {
3232
// Get read only access to the buffer on the host.
3333
// This introduces an implicit barrier which blocks execution until the
3434
// command group above completes.
35-
const auto HostAccessor = Buffer.get_access<sycl::access::mode::read>();
35+
const sycl::host_accessor HostAccessor(Buffer, sycl::read_only);
3636

3737
// Check the results.
3838
for (size_t I = 0; I < Buffer.size(); ++I) {

sycl/test-e2e/XPTI/buffer/multiple_buffers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ int main() {
3535
});
3636
});
3737

38-
const auto HostAccessor1 = Buffer1.get_access<sycl::access::mode::read>();
39-
const auto HostAccessor2 = Buffer2.get_access<sycl::access::mode::read>();
38+
const sycl::host_accessor HostAccessor1(Buffer1, sycl::read_only);
39+
const sycl::host_accessor HostAccessor2(Buffer2, sycl::read_only);
4040

4141
// Check the results.
4242
for (size_t I = 0; I < Buffer1.size(); ++I) {

sycl/test-e2e/XPTI/buffer/multiple_queues.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
int main() {
1616
bool MismatchFound = false;
1717

18-
sycl::device Device{sycl::ext::oneapi::filter_selector{"cpu,accelerator"}};
18+
auto selector_v = [](const sycl::device &d) {
19+
return std::max(cpu_selector_v(d), accelerator_selector_v(d));
20+
};
21+
sycl::device Device{selector_v};
1922
auto Devices = Device.create_sub_devices<
2023
sycl::info::partition_property::partition_equally>(2);
2124

sycl/test-e2e/XPTI/buffer/recursion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ bool func(sycl::queue &Queue, int depth = 0) {
3232
// Get read only access to the buffer on the host.
3333
// This introduces an implicit barrier which blocks execution until the
3434
// command group above completes.
35-
const auto HostAccessor = Buffer.get_access<sycl::access::mode::read>();
35+
const sycl::host_accessor HostAccessor(Buffer, sycl::read_only);
3636

3737
// Check the results.
3838
for (size_t I = 0; I < Buffer.size(); ++I) {

sycl/test-e2e/XPTI/buffer/sub_buffer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ int main() {
3333
Accessor1[WIid] = static_cast<int>(WIid.get(0));
3434
});
3535
});
36-
// CHECK: {{[0-9]+}}|Construct accessor|[[USERID1]]|[[ACCID2:.*]]|2018|1024|{{.*}}sub_buffer.cpp:[[# @LINE + 1]]:22
37-
auto Accessor1 = Buffer1.get_access<sycl::access::mode::read>();
36+
// CHECK: {{[0-9]+}}|Construct accessor|[[USERID1]]|[[ACCID2:.*]]|2018|1024|{{.*}}sub_buffer.cpp:[[# @LINE + 1]]:25
37+
sycl::host_accessor Accessor1(Buffer1, sycl::read_only);
3838
for (size_t I = 32; I < 64; ++I) {
3939
if (Accessor1[I] != I - 32) {
4040
std::cout << "The result is incorrect for element: " << I

sycl/test-e2e/XPTI/kernel/basic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ int main() {
8282
// CHECK: Wait end|{{.*}}.cpp:[[# @LINE + 1]]:3
8383
Queue.wait();
8484

85-
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID3:.*]]|2018|1024|{{.*}}.cpp:[[# @LINE + 1]]:15
86-
{ auto HA = Buf.get_access<mode::read>(); }
85+
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID3:.*]]|2018|1024|{{.*}}.cpp:[[# @LINE + 1]]:25
86+
{ sycl::host_accessor HA(Buf, sycl::read_only); }
8787

8888
Queue.submit([&](sycl::handler &cgh) {
8989
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID4:.+]]|2014|1026|{{.*}}.cpp:[[# @LINE + 1]]:16

0 commit comments

Comments
 (0)