From 82ffe2b7da62c17feb8270adbbe2486d480af370 Mon Sep 17 00:00:00 2001 From: Vincent Wells Date: Mon, 18 Nov 2024 13:22:54 -0600 Subject: [PATCH] Add TTOPInterface funcs for supportsCPUExecution + supportsOnlyCPUExecution (#1310) --- .../Dialect/TTIR/IR/TTIROpsInterfaces.td | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/ttmlir/Dialect/TTIR/IR/TTIROpsInterfaces.td b/include/ttmlir/Dialect/TTIR/IR/TTIROpsInterfaces.td index 5dbf3aa15..cbc005673 100644 --- a/include/ttmlir/Dialect/TTIR/IR/TTIROpsInterfaces.td +++ b/include/ttmlir/Dialect/TTIR/IR/TTIROpsInterfaces.td @@ -41,6 +41,26 @@ def TTIROpInterface : OpInterface<"TTIROp"> { /*methodBody=*/"", /*defaultImplementation=*/"return ::mlir::tt::getCurrentScopeDevice($_op);" >, + InterfaceMethod< + /*desc=*/[{ + Return whether op can be run on CPU. + }], + /*retTy=*/"bool", + /*methodName=*/"supportsCPUExecution", + /*args=*/(ins), + /*methodBody=*/"", + /*defaultImplementation=*/"return false;" + >, + InterfaceMethod< + /*desc=*/[{ + Return whether op must be run on CPU. + }], + /*retTy=*/"bool", + /*methodName=*/"supportsOnlyCPUExecution", + /*args=*/(ins), + /*methodBody=*/"", + /*defaultImplementation=*/"return false;" + >, ]; }