[llvm] [mlgo] Support composite AOT-ed models (PR #96276)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 24 09:42:09 PDT 2024
================
@@ -60,6 +65,64 @@ class MockAOTModel final {
}
}
};
+
+class AdditionAOTModel final : public MockAOTModelBase {
+public:
+ AdditionAOTModel() = default;
+ void Run() override { R = A + B; }
+};
+
+class DiffAOTModel final : public MockAOTModelBase {
+public:
+ DiffAOTModel() = default;
+ void Run() override { R = A - B; }
+};
+
+static const char *M1Selector = "the model that subtracts";
+static const char *M2Selector = "the model that adds";
+
+static auto Hash1 = MD5::hash(arrayRefFromStringRef(M1Selector));
+static auto Hash2 = MD5::hash(arrayRefFromStringRef(M2Selector));
----------------
boomanaiden154 wrote:
Sounds good re reasoning for not using `MD5::update` (after offline discussion).
Same comment regarding explicitly typing instead of `auto` though unless there's some compelling reason to not explicitly type as `MD5Result`.
https://github.com/llvm/llvm-project/pull/96276
More information about the llvm-commits
mailing list