@@ -68,19 +68,12 @@ int test(queue &Queue, PropertiesT Props, KernelType KernelFunc) {
68
68
69
69
Queue.submit ([&](handler &CGH) { CGH.ext_oneapi_graph (ExecGraph); });
70
70
Queue.wait_and_throw ();
71
- } catch (nd_range_error &E) {
72
- std::cerr << " Test case failed: unexpected "
73
- " nd_range_error exception: "
74
- << E.what () << std::endl;
75
- return 1 ;
76
- } catch (runtime_error &E) {
77
- std::cerr << " Test case failed: unexpected "
78
- " runtime_error exception: "
79
- << E.what () << std::endl;
71
+ } catch (exception &E) {
72
+ std::cerr << " Test case failed: unexpected exception: " << E.what ()
73
+ << std::endl;
80
74
return 1 ;
81
75
} catch (...) {
82
- std::cerr << " Test case failed: something unexpected "
83
- " has been caught"
76
+ std::cerr << " Test case failed: something unexpected has been caught"
84
77
<< std::endl;
85
78
return 1 ;
86
79
}
@@ -101,26 +94,21 @@ int test(queue &Queue, PropertiesT Props, KernelType KernelFunc) {
101
94
std::cerr << " Test case ReqdWGSizeNegativeA failed: no exception has been "
102
95
" thrown\n " ;
103
96
return 1 ; // We shouldn't be here, exception is expected
104
- } catch (nd_range_error &E) {
105
- if (std::string (E.what ()).find (
97
+ } catch (exception &E) {
98
+ if (E.code () != errc::nd_range ||
99
+ std::string (E.what ()).find (
106
100
" The specified local size " + rangeToString (repeatRange<Dims>(8 )) +
107
101
" doesn't match the required " +
108
102
" work-group size specified in the program source " +
109
103
rangeToString (range<Dims>(Is...))) == std::string::npos) {
110
104
std::cerr
111
- << " Test case ReqdWGSizeNegativeA failed: unexpected nd_range_error "
112
- " exception: "
105
+ << " Test case ReqdWGSizeNegativeA failed: unexpected exception: "
113
106
<< E.what () << std::endl;
114
107
return 1 ;
115
108
}
116
- } catch (runtime_error &E) {
117
- std::cerr << " Test case ReqdWGSizeNegativeA failed: unexpected "
118
- " nd_range_error exception: "
119
- << E.what () << std::endl;
120
- return 1 ;
121
109
} catch (...) {
122
- std::cerr << " Test case ReqdWGSizeNegativeA failed: something unexpected "
123
- " has been caught"
110
+ std::cerr << " Test case ReqdWGSizeNegativeA failed: something "
111
+ " unexpected has been caught"
124
112
<< std::endl;
125
113
return 1 ;
126
114
}
@@ -144,23 +132,18 @@ int test(queue &Queue, PropertiesT Props, KernelType KernelFunc) {
144
132
" has been "
145
133
" thrown\n " ;
146
134
return 1 ; // We shouldn't be here, exception is expected
147
- } catch (nd_range_error &E) {
148
- if (std::string (E.what ()).find (
135
+ } catch (exception &E) {
136
+ if (E.code () != errc::nd_range ||
137
+ std::string (E.what ()).find (
149
138
" The specified local size " + rangeToString (repeatRange<Dims>(8 )) +
150
139
" doesn't match the required " +
151
140
" work-group size specified in the program source " +
152
141
rangeToString (range<Dims>(Is...))) == std::string::npos) {
153
142
std::cerr << " Test case ReqdWGSizeNegativeA shortcut failed: unexpected "
154
- " nd_range_error "
155
143
" exception: "
156
144
<< E.what () << std::endl;
157
145
return 1 ;
158
146
}
159
- } catch (runtime_error &E) {
160
- std::cerr << " Test case ReqdWGSizeNegativeA shortcut failed: unexpected "
161
- " nd_range_error exception: "
162
- << E.what () << std::endl;
163
- return 1 ;
164
147
} catch (...) {
165
148
std::cerr << " Test case ReqdWGSizeNegativeA shortcut failed: something "
166
149
" unexpected has been caught"
0 commit comments