| 38 | constexpr int64_t kScalarCount = 1 << 10; |
| 39 | |
| 40 | inline ScalarVector ToScalars(std::shared_ptr<Array> arr) { |
| 41 | ScalarVector scalars{static_cast<size_t>(arr->length())}; |
| 42 | int64_t i = 0; |
| 43 | for (auto& scalar : scalars) { |
| 44 | scalar = arr->GetScalar(i++).ValueOrDie(); |
| 45 | } |
| 46 | return scalars; |
| 47 | } |
| 48 | |
| 49 | void BM_CastDispatch(benchmark::State& state) { |
| 50 | // Repeatedly invoke a trivial Cast: the main cost should be dispatch |
no test coverage detected