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

sycl/test-e2e/Sampler/normalized-clamp-linear-float.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void test_normalized_clamp_linear_sampler(image_channel_order ChanOrder,
128128

129129
// REPORT RESULTS
130130
size_t offset = 0;
131-
auto test_acc = testResults.get_access<access::mode::read>();
131+
auto test_acc = testResults.get_host_access();
132132
std::cout << "read seven pixels at 'boundary' locations, starting out of "
133133
"bounds, sample: Normalized + Clamp + Linear"
134134
<< std::endl;

sycl/test-e2e/Sampler/normalized-clamp-nearest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void test_normalized_clamp_nearest_sampler(image_channel_order ChanOrder,
106106

107107
// REPORT RESULTS
108108
size_t offset = 0;
109-
auto test_acc = testResults.get_access<access::mode::read>();
109+
auto test_acc = testResults.get_host_access();
110110
std::cout << "read four pixels at low-boundary locations, sample: "
111111
"Normalized + Clamp + Nearest"
112112
<< std::endl;

sycl/test-e2e/Sampler/normalized-clampedge-linear-float.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void test_normalized_clampedge_linear_sampler(image_channel_order ChanOrder,
117117

118118
// REPORT RESULTS
119119
size_t offset = 0;
120-
auto test_acc = testResults.get_access<access::mode::read>();
120+
auto test_acc = testResults.get_host_access();
121121
std::cout << "read three pixels at inner boundary locations, sample: "
122122
" Normalized + ClampEdge + Linear"
123123
<< std::endl;

sycl/test-e2e/Sampler/normalized-clampedge-nearest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void test_normalized_clampedge_nearest_sampler(image_channel_order ChanOrder,
111111

112112
// REPORT RESULTS
113113
size_t offset = 0;
114-
auto test_acc = testResults.get_access<access::mode::read>();
114+
auto test_acc = testResults.get_host_access();
115115
std::cout << "read four pixels at low-boundary locations, sample: "
116116
"Normalized + Clamp To Edge + Nearest"
117117
<< std::endl;

sycl/test-e2e/Sampler/normalized-mirror-linear-float.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void test_normalized_mirrored_linear_sampler(image_channel_order ChanOrder,
130130

131131
// REPORT RESULTS
132132
size_t offset = 0;
133-
auto test_acc = testResults.get_access<access::mode::read>();
133+
auto test_acc = testResults.get_host_access();
134134
std::cout << "read three pixels at inner boundary locations, sample: "
135135
" Normalized + Mirrored + Linear"
136136
<< std::endl;

sycl/test-e2e/Sampler/normalized-mirror-nearest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void test_normalized_mirrored_nearest_sampler(image_channel_order ChanOrder,
128128

129129
// REPORT RESULTS
130130
size_t offset = 0;
131-
auto test_acc = testResults.get_access<access::mode::read>();
131+
auto test_acc = testResults.get_host_access();
132132
std::cout << "read four pixels at low-boundary locations, sample: "
133133
"Normalized + Mirrored Repeat + Nearest"
134134
<< std::endl;

sycl/test-e2e/Sampler/normalized-none-linear-float.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void test_normalized_none_linear_sampler(image_channel_order ChanOrder,
117117

118118
// REPORT RESULTS
119119
size_t offset = 0;
120-
auto test_acc = testResults.get_access<access::mode::read>();
120+
auto test_acc = testResults.get_host_access();
121121
std::cout << "read three pixels at inner boundary locations, sample: "
122122
" Normalized + None + Linear"
123123
<< std::endl;

sycl/test-e2e/Sampler/normalized-none-nearest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void test_normalized_none_nearest_sampler(image_channel_order ChanOrder,
122122

123123
// REPORT RESULTS
124124
size_t offset = 0;
125-
auto test_acc = testResults.get_access<access::mode::read>();
125+
auto test_acc = testResults.get_host_access();
126126

127127
std::cout << "read four pixels at low-boundary locations, sample: "
128128
"Normalized + None + Nearest"

sycl/test-e2e/Sampler/normalized-repeat-linear-float.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void test_normalized_repeat_linear_sampler(image_channel_order ChanOrder,
129129

130130
// REPORT RESULTS
131131
size_t offset = 0;
132-
auto test_acc = testResults.get_access<access::mode::read>();
132+
auto test_acc = testResults.get_host_access();
133133

134134
std::cout << "read three pixels at inner boundary locations, sample: "
135135
" Normalized + Repeat + Linear"

sycl/test-e2e/Sampler/normalized-repeat-nearest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void test_normalized_repeat_nearest_sampler(image_channel_order ChanOrder,
125125

126126
// REPORT RESULTS
127127
size_t offset = 0;
128-
auto test_acc = testResults.get_access<access::mode::read>();
128+
auto test_acc = testResults.get_host_access();
129129

130130
std::cout << "read four pixels at low-boundary locations, sample: "
131131
"Normalized + Repeat + Nearest"

sycl/test-e2e/Sampler/unnormalized-clamp-linear-float.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void test_unnormalized_clamp_linear_sampler(image_channel_order ChanOrder,
109109

110110
// REPORT RESULTS
111111
size_t offset = 0;
112-
auto test_acc = testResults.get_access<access::mode::read>();
112+
auto test_acc = testResults.get_host_access();
113113

114114
std::cout << "read six pixels, float coordinates, sample: "
115115
"NonNormalized + Clamp + Linear"

sycl/test-e2e/Sampler/unnormalized-clamp-nearest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void test_unnormalized_clamp_nearest_sampler(image_channel_order ChanOrder,
9090

9191
// REPORT RESULTS
9292
size_t offset = 0;
93-
auto test_acc = testResults.get_access<access::mode::read>();
93+
auto test_acc = testResults.get_host_access();
9494
std::cout << "read six pixels, sampler: UnNormalized + Clamp + Nearest"
9595
<< std::endl;
9696
check_pixels(test_acc, ref, offset);

sycl/test-e2e/Sampler/unnormalized-clampedge-linear-float.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void test_unnormalized_clampedge_linear_sampler(image_channel_order ChanOrder,
110110

111111
// REPORT RESULTS
112112
size_t offset = 0;
113-
auto test_acc = testResults.get_access<access::mode::read>();
113+
auto test_acc = testResults.get_host_access();
114114

115115
std::cout << "read six pixels, float coordinates, sample: "
116116
"NonNormalized + ClampEDGE + Linear"

sycl/test-e2e/Sampler/unnormalized-clampedge-nearest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void test_unnormalized_clampedge_nearest_sampler(image_channel_order ChanOrder,
9292

9393
// REPORT RESULTS
9494
size_t offset = 0;
95-
auto test_acc = testResults.get_access<access::mode::read>();
95+
auto test_acc = testResults.get_host_access();
9696
std::cout << "read six pixels, sampler: UnNormalized + ClampEdge + "
9797
"Nearest"
9898
<< std::endl;

sycl/test-e2e/Sampler/unnormalized-none-linear-float.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void test_unnormalized_none_linear_sampler(image_channel_order ChanOrder,
148148

149149
// REPORT RESULTS
150150
size_t offset = 0;
151-
auto test_acc = testResults.get_access<access::mode::read>();
151+
auto test_acc = testResults.get_host_access();
152152
std::cout << "read four pixels. no sampler" << std::endl;
153153
check_pixels(test_acc, ref_pixel, offset);
154154

sycl/test-e2e/Sampler/unnormalized-none-nearest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void test_unnormalized_none_nearest_sampler(image_channel_order ChanOrder,
8686

8787
// REPORT RESULTS
8888
size_t offset = 0;
89-
auto test_acc = testResults.get_access<access::mode::read>();
89+
auto test_acc = testResults.get_host_access();
9090
std::cout << "read four pixels, sample: NonNormalized + None + Nearest"
9191
<< std::endl;
9292
check_pixels(test_acc, ref, offset);

sycl/test-e2e/Scheduler/BasicSchedulerTests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ int main() {
5959
BufSize, [=](sycl::id<1> Id) { Buf1Acc[Id] = Buf2Acc[Id]; });
6060
});
6161

62-
auto Buf1HostAcc = Buf1.get_access<sycl_access_mode::read>();
63-
auto Buf2HostAcc = Buf2.get_access<sycl_access_mode::read>();
62+
auto Buf1HostAcc = Buf1.get_host_access();
63+
auto Buf2HostAcc = Buf2.get_host_access();
6464
});
6565

6666
} catch (...) {

sycl/test-e2e/Scheduler/HostAccDestruction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int main() {
2121
sycl::buffer<int, 1> buf(size);
2222
{
2323
sycl::queue q;
24-
auto host_acc = buf.get_access<sycl::access::mode::read_write>();
24+
auto host_acc = buf.get_host_access();
2525
q.submit([&](sycl::handler &cgh) {
2626
auto acc = buf.get_access<sycl::access::mode::read_write>(cgh);
2727
cgh.parallel_for<class SingleTask>(

sycl/test-e2e/Scheduler/MultipleDevices.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ int multidevice_test(queue MyQueue1, queue MyQueue2) {
6262
});
6363
});
6464

65-
auto FinalD = BufD.get_access<access::mode::read>();
65+
auto FinalD = BufD.get_host_access();
6666
std::cout << "Result:" << std::endl;
6767
for (size_t i = 0; i < N; i++) {
6868

sycl/test-e2e/Scheduler/ReleaseResourcesTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ int main() {
3333
[=](sycl::id<1> Id) { (void)BufAcc[Id]; });
3434
});
3535

36-
auto BufHostAcc = Buf.get_access<sycl_access_mode::read>();
36+
auto BufHostAcc = Buf.get_host_access();
3737

3838
Queue.wait_and_throw();
3939

0 commit comments

Comments
 (0)