Skip to content

Commit a844178

Browse files
committed
DFT - catch single exception type for scaling exception in commit
1 parent 2558f78 commit a844178

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tests/unit_tests/dft/include/compute_inplace_real_real.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ int DFT_Test<precision, domain>::test_in_place_real_real_USM() {
4848
try {
4949
commit_descriptor(descriptor, sycl_queue);
5050
}
51-
catch (...) { //BACKWARD_SCALE not supported, go with 1 and scale at check
51+
catch (oneapi::math::unimplemented&) {
52+
//BACKWARD_SCALE not supported, go with 1 and scale at check
5253
descriptor.set_value(oneapi::math::dft::config_param::BACKWARD_SCALE, 1.f);
5354
commit_descriptor(descriptor, sycl_queue);
5455
scale_at_check = true;
@@ -120,7 +121,8 @@ int DFT_Test<precision, domain>::test_in_place_real_real_buffer() {
120121
try {
121122
commit_descriptor(descriptor, sycl_queue);
122123
}
123-
catch (...) { //BACKWARD_SCALE not supported, go with 1 and scale at check
124+
catch (oneapi::math::unimplemented&) {
125+
//BACKWARD_SCALE not supported, go with 1 and scale at check
124126
descriptor.set_value(oneapi::math::dft::config_param::BACKWARD_SCALE, 1.f);
125127
commit_descriptor(descriptor, sycl_queue);
126128
scale_at_check = true;

tests/unit_tests/dft/include/compute_out_of_place_real_real.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ int DFT_Test<precision, domain>::test_out_of_place_real_real_USM() {
5050
try {
5151
commit_descriptor(descriptor, sycl_queue);
5252
}
53-
catch (...) { //BACKWARD_SCALE not supported, go with 1 and scale at check
53+
catch (oneapi::math::unimplemented&) {
54+
//BACKWARD_SCALE not supported, go with 1 and scale at check
5455
descriptor.set_value(oneapi::math::dft::config_param::BACKWARD_SCALE, 1.f);
5556
commit_descriptor(descriptor, sycl_queue);
5657
scale_at_check = true;
@@ -131,7 +132,8 @@ int DFT_Test<precision, domain>::test_out_of_place_real_real_buffer() {
131132
try {
132133
commit_descriptor(descriptor, sycl_queue);
133134
}
134-
catch (...) { //BACKWARD_SCALE not supported, go with 1 and scale at check
135+
catch (oneapi::math::unimplemented&) {
136+
//BACKWARD_SCALE not supported, go with 1 and scale at check
135137
descriptor.set_value(oneapi::math::dft::config_param::BACKWARD_SCALE, 1.f);
136138
commit_descriptor(descriptor, sycl_queue);
137139
scale_at_check = true;

0 commit comments

Comments
 (0)