[llvm] [mlgo] Support composite AOT-ed models (PR #96276)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 09:27:32 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));
----------------
mtrofin wrote:

I'd rather not. It seems to imply statefulness. This makes it clear, imho, that computing this hash is all there is to do here, there's no follow-up.

https://github.com/llvm/llvm-project/pull/96276


More information about the llvm-commits mailing list