File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ struct sub_group_mask {
142
142
143
143
template <typename Type, size_t Size,
144
144
typename = sycl::detail::enable_if_t <std::is_integral<Type>::value>>
145
- void extract_bits (marray<Type, Size> &bits, id<1 > pos = 0 ) {
145
+ void extract_bits (marray<Type, Size> &bits, id<1 > pos = 0 ) const {
146
146
size_t cur_pos = pos.get (0 );
147
147
for (auto &elem : bits) {
148
148
if (cur_pos < size ()) {
Original file line number Diff line number Diff line change @@ -88,10 +88,15 @@ int main() {
88
88
b_const.extract_bits (r2bc, 16 );
89
89
assert (r2 == 128 );
90
90
assert (r2bc == 128 );
91
+
91
92
b[31 ] = true ;
92
- sycl::marray<char , 6 > r3{-1 };
93
+ const auto b_const2{b};
94
+ sycl::marray<char , 6 > r3{-1 }, r3bc{-1 };
93
95
b.extract_bits (r3, 14 );
96
+ b_const2.extract_bits (r3bc, 14 );
94
97
assert (r3[0 ] == 1 && r3[1 ] == 2 && r3[2 ] == 2 && !r3[3 ] && !r3[4 ] && !r3[5 ]);
98
+ assert (r3bc[0 ] == 1 && r3bc[1 ] == 2 && r3bc[2 ] == 2 && !r3bc[3 ] && !r3bc[4 ] &&
99
+ !r3bc[5 ]);
95
100
int ibits = 0b1010101010101010101010101010101 ;
96
101
b.insert_bits (ibits);
97
102
for (size_t i = 0 ; i < 32 ; i++) {
You can’t perform that action at this time.
0 commit comments