Skip to content

Commit 51a061d

Browse files
authored
[SYCL][E2E] Remove use of deprecated exceptions in USM e2e tests (#14098)
1 parent 2e1f14a commit 51a061d

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

sycl/test-e2e/USM/memcpy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void check_on_device(queue q, int *arr) {
8686
[&](handler &cgh) { cgh.memcpy(nullptr, ARR, sizeof(int) * N); }); \
8787
q.wait_and_throw(); \
8888
assert(false && "Expected error from copying to nullptr"); \
89-
} catch (runtime_error e) { \
89+
} catch (exception e) { \
9090
} \
9191
/* Copying to nullptr should throw. */ \
9292
q.submit([&](handler &cgh) { cgh.memcpy(nullptr, ARR, 0); }); \

sycl/test-e2e/USM/memset.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ int main() {
127127
q.submit([&](handler &cgh) { cgh.memset(nullptr, 0, N * sizeof(char)); });
128128
q.wait_and_throw();
129129
assert(false && "Expected error from writing to nullptr");
130-
} catch (runtime_error e) {
130+
} catch (exception e) {
131131
}
132132

133133
// Filling to nullptr is skipped if the number of bytes to fill is 0.

sycl/test-e2e/USM/pointer_query.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ int main() {
9090
}
9191
try {
9292
D = get_pointer_device(array, ctxt);
93-
} catch (runtime_error) {
93+
} catch (exception) {
9494
free(array);
9595
return 0;
9696
}

sycl/test-e2e/USM/queue_wait.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ int main() {
3636
Q.memset(nullptr, 42, Size);
3737
Q.wait_and_throw();
3838
assert(false && "Expected to have an exception throw instead of assert");
39-
} catch (runtime_error e) {
39+
} catch (exception e) {
4040
}
4141
try {
4242
Q.memcpy(nullptr, DevArr, Size);
4343
Q.wait_and_throw();
4444
assert(false && "Expected to have an exception throw instead of assert");
45-
} catch (runtime_error e) {
45+
} catch (exception e) {
4646
}
4747

4848
Q.memset(nullptr, 42, 0);

0 commit comments

Comments
 (0)