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

Function BM_FloatToBFloat16

tensorflow/core/framework/bfloat16_test.cc:193–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193static void BM_FloatToBFloat16(int iters) {
194 testing::StopTiming();
195 static const int N = 32 << 20;
196 const int64 tot = static_cast<int64>(iters) * N;
197 testing::ItemsProcessed(tot);
198 testing::BytesProcessed(tot * (sizeof(float) + sizeof(bfloat16)));
199
200 float* inp = new float[N];
201 bfloat16* out = new bfloat16[N];
202
203 testing::StartTiming();
204 while (iters--) {
205 FloatToBFloat16(inp, out, N);
206 }
207 delete[] inp;
208 delete[] out;
209}
210BENCHMARK(BM_FloatToBFloat16);
211
212void RoundFloatToBFloat16(const float* src, bfloat16* dst, int64 size) {

Callers

nothing calls this directly

Calls 5

StopTimingFunction · 0.85
ItemsProcessedFunction · 0.85
BytesProcessedFunction · 0.85
StartTimingFunction · 0.85
FloatToBFloat16Function · 0.70

Tested by

no test coverage detected