MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / longToBitString

Function longToBitString

runtime/common/SampleResult.cpp:20–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18#include <vector>
19
20static std::string longToBitString(int size, long x) {
21 std::string s(size, '0');
22 int counter = 0;
23 do {
24 s[counter] = '0' + (x & 1);
25 counter++;
26 } while (x >>= 1);
27 std::reverse(s.begin(), s.end());
28 return s;
29}
30
31static void
32deserializeCounts(std::vector<std::size_t> &data, std::size_t &stride,

Callers 1

deserializeCountsFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected