1919
2020#include < iostream>
2121
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+ {
2528 std::cout << " FAIL: " << msg << " - (" << X << " ," << Y << " )" << std::endl;
2629 return 1 ;
2730 }
28- else if (!skip_pass_msg){
31+ else if (!skip_pass_msg)
32+ {
2933 std::cout << " PASS: " << msg << std::endl;
3034 }
3135 return 0 ;
@@ -148,11 +152,11 @@ test_permutation_iterator()
148152 dpct::device_pointer<T> begin_res (data_res, 0 );
149153 dpct::device_pointer<T> end_res (data_res, 1024 );
150154#else
151- dpct::device_pointer<T> data (1024 * sizeof (T));
155+ dpct::device_pointer<T> data (1024 * sizeof (T));
152156 dpct::device_pointer<T> begin (data);
153157 dpct::device_pointer<T> end (data + 1024 );
154158
155- dpct::device_pointer<T> data_res (1024 * sizeof (T));
159+ dpct::device_pointer<T> data_res (1024 * sizeof (T));
156160 dpct::device_pointer<T> begin_res (data_res);
157161 dpct::device_pointer<T> end_res (data_res + 1024 );
158162#endif
@@ -164,14 +168,17 @@ test_permutation_iterator()
164168 return ASSERT_EQUAL_N (" device_ptr in permutation_iterator" , begin_res, dpct::make_constant_iterator (T (1 )), 1024 );
165169}
166170
167- int main () {
171+ int
172+ main ()
173+ {
168174 int failed_tests = 0 ;
169175 failed_tests += test_device_ptr_manipulation ();
170176 failed_tests += test_device_ptr_iteration ();
171177 failed_tests += test_permutation_iterator ();
172178
173179 std::cout << std::endl << failed_tests << " failing test(s) detected." << std::endl;
174- if (failed_tests == 0 ) {
180+ if (failed_tests == 0 )
181+ {
175182 return 0 ;
176183 }
177184 return 1 ;
0 commit comments