1
1
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=cpu %t.out
3
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=gpu %t.out
4
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=acc %t.out
5
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=host %t.out
6
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=CPU %t.out
7
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=GPU %t.out
8
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=ACC %t.out
9
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=HOST %t.out
10
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=Cpu %t.out
11
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=Gpu %t.out
12
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=Acc %t.out
13
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=Host %t.out
14
- // RUN: env SYCL_BE =%sycl_be SYCL_DEVICE_TYPE=XPU %t.out
2
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=cpu %t.out
3
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=gpu %t.out
4
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=acc %t.out
5
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=host %t.out
6
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=CPU %t.out
7
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=GPU %t.out
8
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=ACC %t.out
9
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=HOST %t.out
10
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=Cpu %t.out
11
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=Gpu %t.out
12
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=Acc %t.out
13
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=Host %t.out
14
+ // RUN: env SYCL_DEVICE_FILTER =%sycl_be SYCL_DEVICE_TYPE=XPU %t.out
15
15
16
16
// ==------------------- device-check.cpp --------------------------==//
17
17
// This is a diagnostic test which ensures that
24
24
25
25
using namespace cl ::sycl;
26
26
27
-
28
27
int main () {
29
28
try {
30
29
queue q = queue ();
@@ -34,9 +33,11 @@ int main() {
34
33
}
35
34
36
35
catch (runtime_error &E) {
37
- if (std::string (E.what ()).find (
38
- " SYCL_DEVICE_TYPE is not recognized. Must be GPU, CPU, ACC or HOST." ) ==
39
- std::string::npos) {
36
+ if (std::string (E.what ()).find (" SYCL_DEVICE_TYPE is not recognized. Must "
37
+ " be GPU, CPU, ACC or HOST." ) ==
38
+ std::string::npos &&
39
+ std::string (E.what ()).find (" No device of requested type available." ) ==
40
+ std::string::npos) {
40
41
std::cout << " Test failed: received error is incorrect." << std::endl;
41
42
return 1 ;
42
43
} else {
0 commit comments