| 1062 | } |
| 1063 | |
| 1064 | void BM_InputRangeHelper(int iters, const NodeDef& node_def, |
| 1065 | const char* input_name, int expected_start, |
| 1066 | int expected_stop) { |
| 1067 | Status status; |
| 1068 | auto device = absl::make_unique<DummyDevice>(Env::Default(), false); |
| 1069 | |
| 1070 | std::unique_ptr<OpKernel> op(CreateOpKernel(DEVICE_CPU, device.get(), |
| 1071 | cpu_allocator(), node_def, |
| 1072 | TF_GRAPH_DEF_VERSION, &status)); |
| 1073 | TF_CHECK_OK(status); |
| 1074 | |
| 1075 | testing::StartTiming(); |
| 1076 | for (int i = 0; i < iters; ++i) { |
| 1077 | int start; |
| 1078 | int stop; |
| 1079 | TF_CHECK_OK(op->InputRange(input_name, &start, &stop)); |
| 1080 | EXPECT_EQ(expected_start, start); |
| 1081 | EXPECT_EQ(expected_stop, stop); |
| 1082 | } |
| 1083 | testing::StopTiming(); |
| 1084 | } |
| 1085 | |
| 1086 | REGISTER_KERNEL_BUILDER(Name("ConcatV2").Device(DEVICE_CPU), DummyKernel); |
| 1087 | REGISTER_KERNEL_BUILDER(Name("Select").Device(DEVICE_CPU), DummyKernel); |
no test coverage detected