Skip to content

Commit f6f537d

Browse files
LukeBoyercopybara-github
authored andcommitted
Rename fixture -> inference fixture. Just a rename, seems the diff is messed up a bit.
LiteRT-PiperOrigin-RevId: 818751992
1 parent 690aa5c commit f6f537d

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

litert/ats/BUILD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cc_test(
4040
deps = [
4141
":capture",
4242
":configure",
43-
":fixture",
43+
":inference_fixture",
4444
":register",
4545
"//litert/c:litert_logging",
4646
"//litert/c:litert_op_code",
@@ -133,9 +133,9 @@ cc_test(
133133
)
134134

135135
cc_library(
136-
name = "fixture",
136+
name = "inference_fixture",
137137
testonly = True,
138-
hdrs = ["fixture.h"],
138+
hdrs = ["inference_fixture.h"],
139139
deps = [
140140
":capture",
141141
":common",
@@ -190,7 +190,7 @@ cc_test(
190190
":capture",
191191
":common",
192192
":configure",
193-
":fixture",
193+
":inference_fixture",
194194
":register",
195195
"//litert/c:litert_op_code",
196196
"//litert/cc:litert_detail",

litert/ats/ats.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "absl/log/absl_check.h" // from @com_google_absl
2222
#include "litert/ats/capture.h"
2323
#include "litert/ats/configure.h"
24-
#include "litert/ats/fixture.h"
24+
#include "litert/ats/inference_fixture.h"
2525
#include "litert/ats/register.h"
2626
#include "litert/c/litert_logging.h"
2727
#include "litert/c/litert_op_code.h"
@@ -48,7 +48,7 @@ void RegisterNoOp(const AtsConf& options, size_t& test_id, size_t iters,
4848
AtsCapture::Ref cap) {
4949
// clang-format off
5050
RegisterCombinations<
51-
AtsTest,
51+
AtsInferenceTest,
5252
NoOp,
5353
SizeListC<1, 2, 3, 4>,
5454
TypeList<float, int32_t>>
@@ -60,7 +60,7 @@ void RegisterBinaryNoBroadcast(const AtsConf& options, size_t& test_id,
6060
size_t iters, AtsCapture::Ref cap) {
6161
// clang-format off
6262
RegisterCombinations<
63-
AtsTest,
63+
AtsInferenceTest,
6464
BinaryNoBroadcast,
6565
SizeListC<1, 2, 3, 4, 5, 6>,
6666
TypeList<float, int32_t>,
@@ -81,7 +81,7 @@ int Ats() {
8181

8282
RegisterNoOp(*options, test_id, /*iters=*/10, cap);
8383
RegisterBinaryNoBroadcast(*options, test_id, /*iters=*/10, cap);
84-
RegisterExtraModels<AtsTest>(test_id, *options, cap);
84+
RegisterExtraModels<AtsInferenceTest>(test_id, *options, cap);
8585

8686
// Preliminary report.
8787
{

litert/ats/check_ats.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "litert/ats/capture.h"
2929
#include "litert/ats/common.h"
3030
#include "litert/ats/configure.h"
31-
#include "litert/ats/fixture.h"
31+
#include "litert/ats/inference_fixture.h"
3232
#include "litert/ats/register.h"
3333
#include "litert/c/litert_op_code.h"
3434
#include "litert/cc/litert_detail.h"
@@ -56,8 +56,9 @@ int CheckAts() {
5656
// TODO(lukeboyer): Re-enable once the cpu reference is supported.
5757
// RegisterExtraModels<AtsTest>(test_id, *options, cap);
5858
static constexpr auto kIters = 1;
59-
RegisterCombinations<AtsTest, NoOp, SizeListC<1>, TypeList<float, int32_t>>(
60-
kIters, test_id, *options, cap);
59+
RegisterCombinations<AtsInferenceTest, NoOp, SizeListC<1>,
60+
TypeList<float, int32_t>>(kIters, test_id, *options,
61+
cap);
6162
const auto* unit_test = ::testing::UnitTest::GetInstance();
6263
ABSL_CHECK_EQ(unit_test->total_test_count(), 2);
6364
}
@@ -70,9 +71,9 @@ int CheckAts() {
7071
auto options = AtsConf::ParseFlagsAndDoSetup();
7172
ABSL_CHECK(options);
7273
// TODO(lukeboyer): Re-enable once the cpu reference is supported..
73-
// RegisterExtraModels<AtsTest>(test_id, *options, cap);
74+
// RegisterExtraModels<AtsInferenceTest>(test_id, *options, cap);
7475
static constexpr auto kIters = 1;
75-
RegisterCombinations<AtsTest, BinaryNoBroadcast, SizeListC<1>,
76+
RegisterCombinations<AtsInferenceTest, BinaryNoBroadcast, SizeListC<1>,
7677
TypeList<float>,
7778
OpCodeListC<kLiteRtOpCodeTflSub, kLiteRtOpCodeTflAdd>>(
7879
kIters, test_id, *options, cap);
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef THIRD_PARTY_ODML_LITERT_LITERT_ATS_FIXTURE_H_
16-
#define THIRD_PARTY_ODML_LITERT_LITERT_ATS_FIXTURE_H_
15+
#ifndef THIRD_PARTY_ODML_LITERT_LITERT_ATS_INFERENCE_FIXTURE_H_
16+
#define THIRD_PARTY_ODML_LITERT_LITERT_ATS_INFERENCE_FIXTURE_H_
1717

1818
#include <cstddef>
1919
#include <cstdint>
@@ -51,7 +51,8 @@ namespace litert::testing {
5151
using ::testing::RegisterTest;
5252
using ::testing::litert::MeanSquaredErrorLt;
5353

54-
class AtsTest : public RngTest {
54+
// Fixture for tests that test execution on a given graph.
55+
class AtsInferenceTest : public RngTest {
5556
public:
5657
template <typename T>
5758
using BufferView = typename SimpleBuffer::CView<T>;
@@ -91,11 +92,11 @@ class AtsTest : public RngTest {
9192
return;
9293
}
9394

94-
RegisterTest(names.suite.c_str(), names.test.c_str(), nullptr, nullptr,
95-
__FILE__, __LINE__,
96-
[graph = std::move(graph), conf, cap, names]() mutable {
97-
return new AtsTest(std::move(graph), conf, names, cap);
98-
});
95+
RegisterTest(
96+
names.suite.c_str(), names.test.c_str(), nullptr, nullptr, __FILE__,
97+
__LINE__, [graph = std::move(graph), conf, cap, names]() mutable {
98+
return new AtsInferenceTest(std::move(graph), conf, names, cap);
99+
});
99100
}
100101

101102
void SetUp() override {
@@ -221,8 +222,8 @@ class AtsTest : public RngTest {
221222

222223
AtsCaptureEntry& Cap() { return cap_.has_value() ? cap_->get() : dummy_cap_; }
223224

224-
AtsTest(TestGraph::Ptr graph, const AtsConf& conf, const Names& names,
225-
std::optional<AtsCaptureEntry::Ref> cap)
225+
AtsInferenceTest(TestGraph::Ptr graph, const AtsConf& conf,
226+
const Names& names, std::optional<AtsCaptureEntry::Ref> cap)
226227
: graph_(std::move(graph)), conf_(conf), names_(names), cap_(cap) {}
227228

228229
TestGraph::Ptr graph_;
@@ -235,4 +236,4 @@ class AtsTest : public RngTest {
235236

236237
} // namespace litert::testing
237238

238-
#endif // THIRD_PARTY_ODML_LITERT_LITERT_ATS_FIXTURE_H_
239+
#endif // THIRD_PARTY_ODML_LITERT_LITERT_ATS_INFERENCE_FIXTURE_H_

0 commit comments

Comments
 (0)