| 237 | BENCHMARK(BM_RoundFloatToBFloat16); |
| 238 | |
| 239 | static void BM_BFloat16ToFloat(int iters) { |
| 240 | testing::StopTiming(); |
| 241 | static const int N = 32 << 20; |
| 242 | const int64 tot = static_cast<int64>(iters) * N; |
| 243 | testing::ItemsProcessed(tot); |
| 244 | testing::BytesProcessed(tot * (sizeof(float) + sizeof(bfloat16))); |
| 245 | |
| 246 | bfloat16* inp = new bfloat16[N]; |
| 247 | float* out = new float[N]; |
| 248 | |
| 249 | testing::StartTiming(); |
| 250 | while (iters--) { |
| 251 | BFloat16ToFloat(inp, out, N); |
| 252 | } |
| 253 | delete[] inp; |
| 254 | delete[] out; |
| 255 | } |
| 256 | BENCHMARK(BM_BFloat16ToFloat); |
| 257 | |
| 258 | } // namespace |
nothing calls this directly
no test coverage detected