MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / operator()

Method operator()

include/cutlass/numeric_conversion.h:8025–8042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

clearMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected