This repository was archived by the owner on Mar 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-11
lines changed Expand file tree Collapse file tree 2 files changed +25
-11
lines changed Original file line number Diff line number Diff line change 14
14
15
15
#include " ../esimd_test_utils.hpp"
16
16
17
- #include < algorithm>
18
- #include < cmath>
19
17
#include < numeric>
20
18
#include < sycl/ext/intel/esimd.hpp>
21
19
#include < sycl/sycl.hpp>
@@ -77,7 +75,7 @@ template <unsigned SIMDSize> int testAccessor(queue q) {
77
75
pred_disable);
78
76
});
79
77
});
80
- q.wait ();
78
+ q.wait_and_throw ();
81
79
buf_0.template get_access <access::mode::read_write>();
82
80
buf_1.template get_access <access::mode::read_write>();
83
81
buf_2.template get_access <access::mode::read_write>();
@@ -159,7 +157,7 @@ template <unsigned SIMDSize> int testUSM(queue q) {
159
157
pred_disable);
160
158
});
161
159
});
162
- q.wait ();
160
+ q.wait_and_throw ();
163
161
} catch (sycl::exception e) {
164
162
std::cout << " SYCL exception caught: " << e.what ();
165
163
sycl::free (vec_0, q);
Original file line number Diff line number Diff line change 16
16
17
17
#include " ../esimd_test_utils.hpp"
18
18
19
- #include < algorithm>
20
- #include < cmath>
21
19
#include < numeric>
22
20
#include < sycl/ext/intel/esimd.hpp>
23
21
#include < sycl/sycl.hpp>
@@ -79,7 +77,7 @@ template <unsigned SIMDSize> int testAccessor(queue q) {
79
77
pred_disable);
80
78
});
81
79
});
82
- q.wait ();
80
+ q.wait_and_throw ();
83
81
buf_0.template get_access <access::mode::read_write>();
84
82
buf_1.template get_access <access::mode::read_write>();
85
83
buf_2.template get_access <access::mode::read_write>();
@@ -91,10 +89,28 @@ template <unsigned SIMDSize> int testAccessor(queue q) {
91
89
92
90
auto error = 0 ;
93
91
for (auto i = 0 ; i != size; ++i) {
94
- error += vec_0[i] != 2 * i;
95
- error += vec_1[i] > 0 ;
96
- error += vec_2[i] != i;
97
- error += vec_3[i] != i;
92
+ if (vec_0[i] != 2 * i) {
93
+ ++error;
94
+ std::cout << " Accessor Test 1 out[" << i << " ] = 0x" << std::hex
95
+ << vec_0[i] << " vs etalon = 0x" << 2 * i << std::dec
96
+ << std::endl;
97
+ }
98
+ if (vec_1[i] > 0 ) {
99
+ ++error;
100
+ std::cout << " Accessor Test 2 out[" << i << " ] = 0x" << std::hex
101
+ << vec_1[i] << " vs etalon = 0x" << 0 << std::dec << std::endl;
102
+ }
103
+ if (vec_2[i] != i) {
104
+ ++error;
105
+ std::cout << " Accessor Test 3 out[" << i << " ] = 0x" << std::hex
106
+ << vec_2[i] << " vs etalon = 0x" << i << std::dec << std::endl;
107
+ }
108
+
109
+ if (vec_3[i] != i) {
110
+ ++error;
111
+ std::cout << " Accessor Test 4 out[" << i << " ] = 0x" << std::hex
112
+ << vec_3[i] << " vs etalon = 0x" << i << std::dec << std::endl;
113
+ }
98
114
}
99
115
std::cout << " Accessor lsc predicate test " ;
100
116
std::cout << (error != 0 ? " FAILED" : " passed" ) << std::endl;
You can’t perform that action at this time.
0 commit comments