| 8023 | |
| 8024 | CUTLASS_HOST_DEVICE |
| 8025 | result_type operator()(bool const predicates[]) { |
| 8026 | |
| 8027 | result_type packed; |
| 8028 | packed.clear(); |
| 8029 | |
| 8030 | int const kWordSize = 8; |
| 8031 | uint8_t *bytes = reinterpret_cast<uint8_t *>(packed.data()); |
| 8032 | |
| 8033 | CUTLASS_PRAGMA_UNROLL |
| 8034 | for (int i = 0; i < N; ++i) { |
| 8035 | int word_idx = (i / kWordSize); |
| 8036 | int bit_idx = (i % kWordSize); |
| 8037 | |
| 8038 | uint8_t mask = static_cast<uint8_t>((predicates[i] ? 1u : 0u) << bit_idx); |
| 8039 | bytes[word_idx] = (bytes[word_idx] | mask); |
| 8040 | } |
| 8041 | return packed; |
| 8042 | } |
| 8043 | }; |
| 8044 | |
| 8045 | /// Packs predicates into an array |