Skip to content

Commit 63322f3

Browse files
committed
[SYCL] Fix added deprecation warning test
Signed-off-by: Hu, Peisen <[email protected]>
1 parent 40f308c commit 63322f3

File tree

1 file changed

+24
-51
lines changed

1 file changed

+24
-51
lines changed

sycl/test/warnings/deprecated_get_backend_info.cpp

Lines changed: 24 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,17 @@
66
using namespace sycl;
77

88
int main() {
9-
#if (defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI != 0) || \
10-
!defined(_GLIBCXX_USE_CXX11_ABI) || TEST_ERRORS
119
try {
1210
// Test get_backend_info for sycl::platform
1311
std::vector<platform> platform_list = platform::get_platforms();
1412
for (const auto &platform : platform_list) {
15-
// expected-warning@+5 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
16-
// expected-warning@+4 {{'get_backend_info<sycl::info::device::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
17-
// expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
18-
// expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::device::version, $1 = (no value)]}}
13+
// expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
14+
// expected-warning@+2 {{'get_backend_info<sycl::info::device::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
1915
std::cout << " Backend device version: "
2016
<< platform.get_backend_info<info::device::version>()
2117
<< std::endl;
22-
// expected-warning@+5 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
23-
// expected-warning@+4 {{'get_backend_info<sycl::info::platform::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
24-
// expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
25-
// expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::platform::version, $1 = (no value)]}}
18+
// expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
19+
// expected-warning@+2 {{'get_backend_info<sycl::info::platform::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
2620
std::cout << " Backend platform version: "
2721
<< platform.get_backend_info<info::platform::version>()
2822
<< std::endl;
@@ -32,64 +26,48 @@ int main() {
3226
std::vector<device> device_list =
3327
device::get_devices(info::device_type::gpu);
3428
for (const auto &device : device_list) {
35-
// expected-warning@+5 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
36-
// expected-warning@+4 {{'get_backend_info<sycl::info::device::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
37-
// expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
38-
// expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::device::version, $1 = (no value)]}}
29+
// expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
30+
// expected-warning@+2 {{'get_backend_info<sycl::info::device::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
3931
std::cout << " Backend device version: "
4032
<< device.get_backend_info<info::device::version>()
4133
<< std::endl;
42-
// expected-warning@+5 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
43-
// expected-warning@+4 {{'get_backend_info<sycl::info::platform::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
44-
// expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
45-
// expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::platform::version, $1 = (no value)]}}
34+
// expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
35+
// expected-warning@+2 {{'get_backend_info<sycl::info::platform::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
4636
std::cout << " Backend platform version: "
4737
<< device.get_backend_info<info::platform::version>()
4838
<< std::endl;
4939
}
5040

5141
// Test get_backend_info for sycl::queue
5242
queue q;
53-
// expected-warning@+5 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
54-
// expected-warning@+4 {{'get_backend_info<sycl::info::device::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
55-
// expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
56-
// expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::device::version, $1 = (no value)]}}
43+
// expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
44+
// expected-warning@+2 {{'get_backend_info<sycl::info::device::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
5745
std::cout << " Backend device version: "
5846
<< q.get_backend_info<info::device::version>() << std::endl;
59-
// expected-warning@+5 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
60-
// expected-warning@+4 {{'get_backend_info<sycl::info::platform::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
61-
// expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
62-
// expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::platform::version, $1 = (no value)]}}
47+
// expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
48+
// expected-warning@+2 {{'get_backend_info<sycl::info::platform::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
6349
std::cout << " Backend platform version: "
6450
<< q.get_backend_info<info::platform::version>() << std::endl;
6551

6652
// Test get_backend_info for sycl::context
6753
context Ctx = q.get_context();
68-
// expected-warning@+5 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
69-
// expected-warning@+4 {{'get_backend_info<sycl::info::device::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
70-
// expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
71-
// expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::device::version, $1 = (no value)]}}
54+
// expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
55+
// expected-warning@+2 {{'get_backend_info<sycl::info::device::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
7256
std::cout << " Backend device version: "
7357
<< Ctx.get_backend_info<info::device::version>() << std::endl;
74-
// expected-warning@+5 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
75-
// expected-warning@+4 {{'get_backend_info<sycl::info::platform::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
76-
// expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
77-
// expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::platform::version, $1 = (no value)]}}
58+
// expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
59+
// expected-warning@+2 {{'get_backend_info<sycl::info::platform::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
7860
std::cout << " Backend platform version: "
7961
<< Ctx.get_backend_info<info::platform::version>() << std::endl;
8062

8163
// Test get_backend_info for sycl::event
8264
event e = q.single_task([=]() { return; });
83-
// expected-warning@+5 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
84-
// expected-warning@+4 {{'get_backend_info<sycl::info::device::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
85-
// expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
86-
// expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::device::version, $1 = (no value)]}}
65+
// expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
66+
// expected-warning@+2 {{'get_backend_info<sycl::info::device::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
8767
std::cout << " Backend device version: "
8868
<< e.get_backend_info<info::device::version>() << std::endl;
89-
// expected-warning@+5 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
90-
// expected-warning@+4 {{'get_backend_info<sycl::info::platform::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
91-
// expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
92-
// expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::platform::version, $1 = (no value)]}}
69+
// expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
70+
// expected-warning@+2 {{'get_backend_info<sycl::info::platform::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
9371
std::cout << " Backend platform version: "
9472
<< e.get_backend_info<info::platform::version>() << std::endl;
9573

@@ -104,16 +82,12 @@ int main() {
10482
auto acc = buf.get_access<access::mode::read_write>(cgh);
10583
cgh.single_task<class SingleTask>(krn, [=]() { acc[0] = acc[0] + 1; });
10684
});
107-
// expected-warning@+5 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
108-
// expected-warning@+4 {{'get_backend_info<sycl::info::device::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
109-
// expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
110-
// expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::device::version, $1 = (no value)]}}
85+
// expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
86+
// expected-warning@+2 {{'get_backend_info<sycl::info::device::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
11187
std::cout << " Backend device version: "
11288
<< krn.get_backend_info<info::device::version>() << std::endl;
113-
// expected-warning@+5 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
114-
// expected-warning@+4 {{'get_backend_info<sycl::info::platform::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
115-
// expected-error@*:* {{static assertion failed due to requirement 'False': This interface is incompatible with _GLIBCXX_USE_CXX11_ABI=0}}
116-
// expected-note@+2 {{while substituting deduced template arguments into function template 'get_backend_info' [with Param = info::platform::version, $1 = (no value)]}}
89+
// expected-warning@+3 {{'get_backend_info' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
90+
// expected-warning@+2 {{'get_backend_info<sycl::info::platform::version>' is deprecated: All current implementations of get_backend_info() are to be removed. Use respective variants of get_info() instead.}}
11791
std::cout << " Backend platform version: "
11892
<< krn.get_backend_info<info::platform::version>() << std::endl;
11993
} catch (exception e) {
@@ -132,6 +106,5 @@ int main() {
132106
assert(has_non_opencl_backend && "unexpected error code");
133107
}
134108
std::cout << " Backend info query tests passed" << std::endl;
135-
#endif
136109
return 0;
137110
}

0 commit comments

Comments
 (0)