Skip to content

Commit 6083ddd

Browse files
[SYCL][NFC] Cleanup warnings in E2E tests (#11931)
Main changes: - dropped uses of deprecated APIs where this is not a direct goal of the test (`get_count` -> `size`) - defined `SYCL_DISABLE_IMAGE_ASPECT_WARNING` for some tests - `get_access` -> `get_host_access` (for simple cases) - removed uses of host backend
1 parent 0a2938b commit 6083ddd

30 files changed

+34
-40
lines changed

sycl/test-e2e/Basic/aspects.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %{build} -o %t.out
1+
// RUN: %{build} -o %t.out -DSYCL_DISABLE_IMAGE_ASPECT_WARNING
22
// RUN: %{run-unfiltered-devices} %t.out
33
//
44
// Hip is missing some of the parameters tested here so it fails with NVIDIA

sycl/test-e2e/Basic/device-selectors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %{build} -o %t.out
1+
// RUN: %{build} -o %t.out -DSYCL_DISABLE_IMAGE_ASPECT_WARNING
22
// RUN: %{run-unfiltered-devices} %t.out
33

44
#include <sycl/sycl.hpp>

sycl/test-e2e/Basic/exceptions-SYCL-2020.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ int main() {
8888
someL0ErrCode{EC};
8989
sycl::errc_for<sycl::backend::ext_oneapi_level_zero> anotherL0ErrCode{EC};
9090
assert(someL0ErrCode == anotherL0ErrCode);
91-
sycl::backend_traits<sycl::backend::host>::errc someHOSTErrCode{EC};
92-
sycl::errc_for<sycl::backend::host> anotherHOSTErrCode{EC};
93-
assert(someHOSTErrCode == anotherHOSTErrCode);
9491
sycl::backend_traits<sycl::backend::ext_oneapi_cuda>::errc someCUDAErrCode{
9592
EC};
9693
sycl::errc_for<sycl::backend::ext_oneapi_cuda> anotherCUDAErrCode{EC};

sycl/test-e2e/HostInteropTask/host-task-failure.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void copy(buffer<DataT, 1> &Src, buffer<DataT, 1> &Dst, queue &Q) {
2222
auto DstA = Dst.template get_access<mode::write>(CGH);
2323

2424
CGH.host_task([=]() {
25-
for (size_t Idx = 0; Idx < SrcA.get_count(); ++Idx)
25+
for (size_t Idx = 0; Idx < SrcA.size(); ++Idx)
2626
DstA[Idx] = SrcA[Idx];
2727
});
2828
});

sycl/test-e2e/HostInteropTask/host-task.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ void test2(queue &Q) {
4444
auto Acc = Buffer1.template get_access<mode::write>(CGH);
4545

4646
auto Kernel = [=](item<1> Id) { Acc[Id] = 123; };
47-
CGH.parallel_for<NameGen<class Test6Init, true>>(Acc.get_count(), Kernel);
47+
CGH.parallel_for<NameGen<class Test6Init, true>>(Acc.size(), Kernel);
4848
});
4949

5050
Q.submit([&](handler &CGH) {
5151
auto AccSrc = Buffer1.template get_access<mode::read>(CGH);
5252
auto AccDst = Buffer2.template get_access<mode::write>(CGH);
5353

5454
auto Func = [=] {
55-
for (size_t Idx = 0; Idx < AccDst.get_count(); ++Idx)
55+
for (size_t Idx = 0; Idx < AccDst.size(); ++Idx)
5656
AccDst[Idx] = AccSrc[Idx];
5757
};
5858
CGH.host_task(Func);
@@ -61,7 +61,7 @@ void test2(queue &Q) {
6161
{
6262
auto Acc = Buffer2.get_host_access();
6363

64-
for (size_t Idx = 0; Idx < Acc.get_count(); ++Idx) {
64+
for (size_t Idx = 0; Idx < Acc.size(); ++Idx) {
6565
std::cout << "Second buffer [" << Idx << "] = " << Acc[Idx] << std::endl;
6666
assert(Acc[Idx] == 123);
6767
}

sycl/test-e2e/Plugin/enqueue-arg-order-buffer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,21 @@ void testGetLinearIndex() {
124124
buffer<float, 2> buffer_2D(data_2D.data(), range<2>(height, width));
125125
buffer<float, 3> buffer_3D(data_3D.data(), range<3>(depth, height, width));
126126

127-
auto acc_1D = buffer_1D.get_access<access::mode::read_write>();
127+
auto acc_1D = buffer_1D.get_host_access();
128128
auto accTest_1D = AccTest<float, 1>(acc_1D);
129129
size_t linear_1D = accTest_1D.gLI(id<1>(x)); // s.b. 4
130130
std::cout << "linear_1D: " << linear_1D << " target_1D: " << target_1D
131131
<< std::endl;
132132
assert(linear_1D == target_1D && "linear_1D s.b. 4");
133133

134-
auto acc_2D = buffer_2D.get_access<access::mode::read_write>();
134+
auto acc_2D = buffer_2D.get_host_access();
135135
auto accTest_2D = AccTest<float, 2>(acc_2D);
136136
size_t linear_2D = accTest_2D.gLI(id<2>(y, x));
137137
std::cout << "linear_2D: " << linear_2D << " target_2D: " << target_2D
138138
<< std::endl;
139139
assert(linear_2D == target_2D && "linear_2D s.b. 52");
140140

141-
auto acc_3D = buffer_3D.get_access<access::mode::read_write>();
141+
auto acc_3D = buffer_3D.get_host_access();
142142
auto accTest_3D = AccTest<float, 3>(acc_3D);
143143
size_t linear_3D = accTest_3D.gLI(id<3>(z, y, x));
144144
std::cout << "linear_3D: " << linear_3D << " target_3D: " << target_3D

sycl/test-e2e/Regression/device_num.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ using namespace std;
1919
const std::map<info::device_type, std::string> DeviceTypeStringMap = {
2020
{info::device_type::cpu, "cpu"},
2121
{info::device_type::gpu, "gpu"},
22-
{info::device_type::host, "host"},
2322
{info::device_type::accelerator, "acc"}};
2423

2524
const std::map<backend, std::string> BackendStringMap = {
2625
{backend::opencl, "opencl"},
27-
{backend::host, "host"},
2826
{backend::ext_oneapi_level_zero, "ext_oneapi_level_zero"},
2927
{backend::ext_oneapi_cuda, "ext_oneapi_cuda"},
3028
{backend::ext_oneapi_hip, "ext_oneapi_hip"},
@@ -111,8 +109,7 @@ int GetPreferredDeviceIndex(const std::vector<device> &devices,
111109
const std::map<info::device_type, int> scoreByType = {
112110
{info::device_type::cpu, 300},
113111
{info::device_type::gpu, 500},
114-
{info::device_type::accelerator, 75},
115-
{info::device_type::host, 100}};
112+
{info::device_type::accelerator, 75}};
116113
int score = -1;
117114
int index = -1;
118115
int devCount = devices.size();

sycl/test-e2e/Regression/group.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ bool group__async_work_group_copy() {
189189
cgh.parallel_for<class group__async_work_group_copy>(
190190
nd_range<2>{GlobalRange, LocalRange}, [=](nd_item<DIMS> I) {
191191
const auto Group = I.get_group();
192-
const auto NumElem = AccLocal.get_count();
192+
const auto NumElem = AccLocal.size();
193193
const auto Off = Group[0] * I.get_group_range(1) * NumElem +
194194
Group[1] * I.get_local_range(1);
195195
auto PtrGlobal =

sycl/test-e2e/Sampler/basic-rw-float.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void test_rw(image_channel_order ChanOrder, image_channel_type ChanType) {
7373

7474
// REPORT RESULTS
7575
size_t offset = 0;
76-
auto test_acc = testResults.get_access<access::mode::read>();
76+
auto test_acc = testResults.get_host_access();
7777
std::cout << "read four pixels, no sampler" << std::endl;
7878
check_pixels(test_acc, ref, offset);
7979
} // ~image / ~buffer

sycl/test-e2e/Sampler/basic-rw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void test_rw(image_channel_order ChanOrder, image_channel_type ChanType) {
8787

8888
// REPORT RESULTS
8989
size_t offset = 0;
90-
auto test_acc = testResults.get_access<access::mode::read>();
90+
auto test_acc = testResults.get_host_access();
9191
std::cout << "read four pixels, no sampler" << std::endl;
9292
check_pixels(test_acc, ref, offset);
9393
} // ~image / ~buffer

0 commit comments

Comments
 (0)