MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BM_WriteNum

Function BM_WriteNum

tensorflow/core/lib/strings/ordered_code_test.cc:379–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377
378template <typename T>
379void BM_WriteNum(int n, T multiplier) {
380 constexpr int kValues = 64;
381 T values[kValues];
382 random::PhiloxRandom philox(301, 17);
383 random::SimplePhilox rnd(&philox);
384 // Use enough distinct values to confuse the branch predictor
385 for (int i = 0; i < kValues; i++) {
386 values[i] = NextBits(&rnd, n % 64) * multiplier;
387 }
388 string result;
389 int index = 0;
390 while (n-- > 0) {
391 result.clear();
392 OCWriteToString<T>(&result, values[index % kValues]);
393 index++;
394 }
395}
396
397template <typename T>
398void BM_ReadNum(int n, T multiplier) {

Callers

nothing calls this directly

Calls 2

NextBitsFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected