Example Linalg3: manually register the Linalg dialect

This dialect does not have a global constructor and has to be registered
    manually in `main`.  Also fix the way it is exercised in the test.

--

PiperOrigin-RevId: 242434886
This commit is contained in:
Alex Zinenko 2019-04-08 03:34:11 -07:00 committed by Mehdi Amini
parent 8e193e617c
commit adb0ca0732
1 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include "TestHarness.h" #include "TestHarness.h"
#include "linalg1/Common.h" #include "linalg1/Common.h"
#include "linalg1/Dialect.h"
#include "linalg2/Intrinsics.h" #include "linalg2/Intrinsics.h"
#include "linalg3/ConvertToLLVMDialect.h" #include "linalg3/ConvertToLLVMDialect.h"
#include "linalg3/Ops.h" #include "linalg3/Ops.h"
@ -27,6 +28,8 @@
#include "mlir/ExecutionEngine/ExecutionEngine.h" #include "mlir/ExecutionEngine/ExecutionEngine.h"
// RUN: %p/execution | FileCheck %s
using namespace mlir; using namespace mlir;
using namespace mlir::edsc; using namespace mlir::edsc;
using namespace mlir::edsc::intrinsics; using namespace mlir::edsc::intrinsics;
@ -150,6 +153,8 @@ TEST_FUNC(execution) {
} }
int main() { int main() {
mlir::registerDialect<linalg::LinalgDialect>();
// Initialize LLVM targets. // Initialize LLVM targets.
llvm::InitializeNativeTarget(); llvm::InitializeNativeTarget();
llvm::InitializeNativeTargetAsmPrinter(); llvm::InitializeNativeTargetAsmPrinter();