Skip to content

Commit ae15b1e

Browse files
committed
Fix MLIR Toy tutorial JIT example and add a test to cover it
1 parent 9f4f6ac commit ae15b1e

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

mlir/examples/toy/Ch6/toyc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ int runJit(mlir::ModuleOp module) {
240240
auto &engine = maybeEngine.get();
241241

242242
// Invoke the JIT-compiled function.
243-
auto invocationResult = engine->invoke("main");
243+
auto invocationResult = engine->invokePacked("main");
244244
if (invocationResult) {
245245
llvm::errs() << "JIT invocation failed\n";
246246
return -1;

mlir/examples/toy/Ch7/toyc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ int runJit(mlir::ModuleOp module) {
241241
auto &engine = maybeEngine.get();
242242

243243
// Invoke the JIT-compiled function.
244-
auto invocationResult = engine->invoke("main");
244+
auto invocationResult = engine->invokePacked("main");
245245
if (invocationResult) {
246246
llvm::errs() << "JIT invocation failed\n";
247247
return -1;

mlir/test/Examples/Toy/Ch6/jit.toy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# RUN: toyc-ch6 -emit=jit %s
2+
3+
def main() {
4+
print([[1, 2], [3, 4]]);
5+
}

mlir/test/Examples/Toy/Ch7/jit.toy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# RUN: toyc-ch7 -emit=jit %s
2+
3+
def main() {
4+
print([[1, 2], [3, 4]]);
5+
}

0 commit comments

Comments
 (0)