Skip to content

Commit 88b7d45

Browse files
[SYCL] Avoid using sycl::exception::get_cl_code() in tests (#13882)
This interface has been removed in SYCL 2020.
1 parent 16e0670 commit 88b7d45

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

sycl/test-e2e/ESIMD/dp4a.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int main(void) {
6969
e.wait();
7070
} catch (sycl::exception const &e) {
7171
std::cout << "SYCL exception caught: " << e.what() << '\n';
72-
return e.get_cl_code();
72+
return e.code().value();
7373
}
7474

7575
int err_cnt = 0;

sycl/test-e2e/ESIMD/fp_call_from_func.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int main(int argc, char **argv) {
5050
});
5151
} catch (sycl::exception const &e) {
5252
std::cout << "SYCL exception caught: " << e.what() << std::endl;
53-
return e.get_cl_code();
53+
return e.code().value();
5454
}
5555

5656
if (result != (in1 + in2)) {

sycl/test-e2e/ESIMD/fp_call_recursive.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int main(int argc, char **argv) {
5656
});
5757
} catch (sycl::exception const &e) {
5858
std::cout << "SYCL exception caught: " << e.what() << std::endl;
59-
return e.get_cl_code();
59+
return e.code().value();
6060
}
6161

6262
int etalon = in1;

sycl/test-e2e/ESIMD/noinline_call_recursive.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ int main(int argc, char **argv) {
5454
});
5555
} catch (sycl::exception const &e) {
5656
std::cout << "SYCL exception caught: " << e.what() << std::endl;
57-
return e.get_cl_code();
57+
return e.code().value();
5858
}
5959

6060
int etalon = in1;

sycl/test-e2e/ESIMD/regression/noinline_bypointers_vadd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ int main(void) {
7070
free(B, ctxt);
7171
free(C, ctxt);
7272

73-
return e.get_cl_code();
73+
return e.code().value();
7474
}
7575

7676
int err_cnt = 0;

sycl/test-e2e/KernelAndProgram/cache-build-result.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ void test() {
3333
});
3434
assert(false && "There must be compilation error");
3535
} catch (const sycl::compile_program_error &e) {
36-
fprintf(stderr, "Exception: %s, %d\n", e.what(), e.get_cl_code());
36+
fprintf(stderr, "Exception: %s, %d\n", e.what(), e.code().value());
3737
if (Idx == 0) {
3838
Msg = e.what();
39-
Result = e.get_cl_code();
39+
Result = e.code().value();
4040
} else {
4141
// Exception constantly adds info on its error code in the message
4242
assert(Msg.find_first_of(e.what()) == 0 &&
4343
"PI_ERROR_BUILD_PROGRAM_FAILURE");
44-
assert(Result == e.get_cl_code() && "Exception code differs");
44+
assert(Result == e.code().value() && "Exception code differs");
4545
}
4646
} catch (...) {
4747
assert(false && "There must be sycl::compile_program_error");

sycl/test-e2e/Plugin/retain_events.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void async_sycl_error(sycl::exception_list el) {
2828
try {
2929
std::rethrow_exception(*l);
3030
} catch (const sycl::exception &e) {
31-
fprintf(stderr, "what: %s code: %d\n", e.what(), e.get_cl_code());
31+
fprintf(stderr, "what: %s code: %d\n", e.what(), e.code().value());
3232
std::exit(-1);
3333
}
3434
}
@@ -75,7 +75,7 @@ int main() {
7575
}
7676
} catch (sycl::exception &e) {
7777
fprintf(stderr, "...sycl failed to entertain with \"%s\" (%d) \n", e.what(),
78-
e.get_cl_code());
78+
e.code().value());
7979
}
8080
return 0;
8181
}

sycl/test/invoke_simd/invoke_simd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ int main(void) {
134134
e.wait();
135135
} catch (sycl::exception const &e) {
136136
std::cout << "SYCL exception caught: " << e.what() << '\n';
137-
return e.get_cl_code();
137+
return e.code().value();
138138
}
139139

140140
int err_cnt = 0;

0 commit comments

Comments
 (0)