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

Function BM_ReadNum

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

Source from the content-addressed store, hash-verified

396
397template <typename T>
398void BM_ReadNum(int n, T multiplier) {
399 random::PhiloxRandom philox(301, 17);
400 random::SimplePhilox rnd(&philox);
401 // Use enough distinct values to confuse the branch predictor
402 constexpr int kValues = 64;
403 string values[kValues];
404 for (int i = 0; i < kValues; i++) {
405 T val = NextBits(&rnd, i % 64) * multiplier;
406 values[i] = OCWrite<T>(val);
407 }
408 uint32 index = 0;
409 while (n-- > 0) {
410 T val;
411 StringPiece s = values[index++ % kValues];
412 OCRead<T>(&s, &val);
413 }
414}
415
416#define BENCHMARK_NUM(name, T, multiplier) \
417 void BM_Write##name(int n) { BM_WriteNum<T>(n, multiplier); } \

Callers

nothing calls this directly

Calls 1

NextBitsFunction · 0.85

Tested by

no test coverage detected