Benchmark create+move a tensor, with an allocated buffer.
| 1488 | |
| 1489 | // Benchmark create+move a tensor, with an allocated buffer. |
| 1490 | void BM_CreateAndMoveCtrWithBuf(int iters) { |
| 1491 | TensorShape shape({10, 20}); |
| 1492 | Allocator* allocator = cpu_allocator(); |
| 1493 | while (--iters) { |
| 1494 | Tensor a(allocator, DT_FLOAT, shape); |
| 1495 | Tensor b(std::move(a)); |
| 1496 | } |
| 1497 | } |
| 1498 | BENCHMARK(BM_CreateAndMoveCtrWithBuf); |
| 1499 | |
| 1500 | // Benchmark creating and destroy a host-scalar tensor, using the allocator |
nothing calls this directly
no test coverage detected