19
19
20
20
#include < iostream>
21
21
22
- template <typename String, typename _T1, typename _T2>
23
- int ASSERT_EQUAL (String msg, _T1&& X, _T2&& Y, bool skip_pass_msg = false ) {
24
- if (X!=Y) {
22
+ template <typename String, typename _T1, typename _T2>
23
+ int
24
+ ASSERT_EQUAL (String msg, _T1&& X, _T2&& Y, bool skip_pass_msg = false )
25
+ {
26
+ if (X != Y)
27
+ {
25
28
std::cout << " FAIL: " << msg << " - (" << X << " ," << Y << " )" << std::endl;
26
29
return 1 ;
27
30
}
28
- else if (!skip_pass_msg){
31
+ else if (!skip_pass_msg)
32
+ {
29
33
std::cout << " PASS: " << msg << std::endl;
30
34
}
31
35
return 0 ;
@@ -148,11 +152,11 @@ test_permutation_iterator()
148
152
dpct::device_pointer<T> begin_res (data_res, 0 );
149
153
dpct::device_pointer<T> end_res (data_res, 1024 );
150
154
#else
151
- dpct::device_pointer<T> data (1024 * sizeof (T));
155
+ dpct::device_pointer<T> data (1024 * sizeof (T));
152
156
dpct::device_pointer<T> begin (data);
153
157
dpct::device_pointer<T> end (data + 1024 );
154
158
155
- dpct::device_pointer<T> data_res (1024 * sizeof (T));
159
+ dpct::device_pointer<T> data_res (1024 * sizeof (T));
156
160
dpct::device_pointer<T> begin_res (data_res);
157
161
dpct::device_pointer<T> end_res (data_res + 1024 );
158
162
#endif
@@ -164,14 +168,17 @@ test_permutation_iterator()
164
168
return ASSERT_EQUAL_N (" device_ptr in permutation_iterator" , begin_res, dpct::make_constant_iterator (T (1 )), 1024 );
165
169
}
166
170
167
- int main () {
171
+ int
172
+ main ()
173
+ {
168
174
int failed_tests = 0 ;
169
175
failed_tests += test_device_ptr_manipulation ();
170
176
failed_tests += test_device_ptr_iteration ();
171
177
failed_tests += test_permutation_iterator ();
172
178
173
179
std::cout << std::endl << failed_tests << " failing test(s) detected." << std::endl;
174
- if (failed_tests == 0 ) {
180
+ if (failed_tests == 0 )
181
+ {
175
182
return 0 ;
176
183
}
177
184
return 1 ;
0 commit comments