Skip to content

Commit

Permalink
[SYCL][E2E] Remove deprecated warnings in XPTI e2e tests (intel#14257)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ayylol committed Jun 24, 2024
1 parent 973b8cb commit 157310a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 15 deletions.
12 changes: 6 additions & 6 deletions sycl/test-e2e/XPTI/buffer/accessors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ int main() {
(void)A6;
});
});
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID7:.*]]|2018|1024|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
{ auto HA = Buf.get_access<mode::read>(); }
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID8:.*]]|2018|1025|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
{ auto HA = Buf.get_access<mode::write>(); }
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID9:.*]]|2018|1026|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
{ auto HA = Buf.get_access<mode::read_write>(); }
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID7:.*]]|2018|1024|{{.*}}accessors.cpp:[[# @LINE + 1]]:25
{ sycl::host_accessor HA(Buf, sycl::read_only); }
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID8:.*]]|2018|1025|{{.*}}accessors.cpp:[[# @LINE + 1]]:25
{ sycl::host_accessor HA(Buf, sycl::write_only); }
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID9:.*]]|2018|1026|{{.*}}accessors.cpp:[[# @LINE + 1]]:25
{ sycl::host_accessor HA(Buf, sycl::read_write); }
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID10:.*]]|2018|1027|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
{ auto HA = Buf.get_access<mode::discard_write>(); }
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID11:.*]]|2018|1028|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/buffer/in_cycle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool func(sycl::queue &Queue, int depth = 0) {
// Get read only access to the buffer on the host.
// This introduces an implicit barrier which blocks execution until the
// command group above completes.
const auto HostAccessor = Buffer.get_access<sycl::access::mode::read>();
const sycl::host_accessor HostAccessor(Buffer, sycl::read_only);

// Check the results.
for (size_t I = 0; I < Buffer.size(); ++I) {
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/XPTI/buffer/multiple_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ int main() {
});
});

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

// Check the results.
for (size_t I = 0; I < Buffer1.size(); ++I) {
Expand Down
5 changes: 4 additions & 1 deletion sycl/test-e2e/XPTI/buffer/multiple_queues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
int main() {
bool MismatchFound = false;

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

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/buffer/recursion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool func(sycl::queue &Queue, int depth = 0) {
// Get read only access to the buffer on the host.
// This introduces an implicit barrier which blocks execution until the
// command group above completes.
const auto HostAccessor = Buffer.get_access<sycl::access::mode::read>();
const sycl::host_accessor HostAccessor(Buffer, sycl::read_only);

// Check the results.
for (size_t I = 0; I < Buffer.size(); ++I) {
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/XPTI/buffer/sub_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ int main() {
Accessor1[WIid] = static_cast<int>(WIid.get(0));
});
});
// CHECK: {{[0-9]+}}|Construct accessor|[[USERID1]]|[[ACCID2:.*]]|2018|1024|{{.*}}sub_buffer.cpp:[[# @LINE + 1]]:22
auto Accessor1 = Buffer1.get_access<sycl::access::mode::read>();
// CHECK: {{[0-9]+}}|Construct accessor|[[USERID1]]|[[ACCID2:.*]]|2018|1024|{{.*}}sub_buffer.cpp:[[# @LINE + 1]]:25
sycl::host_accessor Accessor1(Buffer1, sycl::read_only);
for (size_t I = 32; I < 64; ++I) {
if (Accessor1[I] != I - 32) {
std::cout << "The result is incorrect for element: " << I
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/XPTI/kernel/basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ int main() {
// CHECK: Wait end|{{.*}}.cpp:[[# @LINE + 1]]:3
Queue.wait();

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

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

0 comments on commit 157310a

Please sign in to comment.