| 252 | } |
| 253 | |
| 254 | static void BM_Adam(int iters, int params, int is_multi_threaded) { |
| 255 | const int64 tot = static_cast<int64>(iters) * params; |
| 256 | testing::ItemsProcessed(tot); |
| 257 | testing::BytesProcessed(tot * sizeof(float)); |
| 258 | Graph* init; |
| 259 | Graph* train; |
| 260 | Adam(params, &init, &train); |
| 261 | if (is_multi_threaded) { |
| 262 | // Use max thread number if test performance. |
| 263 | test::Benchmark("cpu", train, nullptr, init).Run(iters); |
| 264 | } else { |
| 265 | test::Benchmark("cpu", train, GetOptions(), init).Run(iters); |
| 266 | } |
| 267 | } |
| 268 | BENCHMARK(BM_Adam)->ArgPair(128 << 10, 0)->ArgPair(256 << 10, 0); |
| 269 | BENCHMARK(BM_Adam)->ArgPair(256 << 5, 1)->ArgPair(256 << 16, 1); |
| 270 |
nothing calls this directly
no test coverage detected