From 710896d2358cadf995125d470206fccf24f5213c Mon Sep 17 00:00:00 2001 From: Stefan Djordjevic <157365107+sdjordjevicTT@users.noreply.github.com> Date: Sun, 18 Aug 2024 13:42:06 +0200 Subject: [PATCH] Adding context option to print mlir stack trace on error (#130) --- pybuda/csrc/passes/mlir_compiler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pybuda/csrc/passes/mlir_compiler.cpp b/pybuda/csrc/passes/mlir_compiler.cpp index bda168640..37e8b84e9 100644 --- a/pybuda/csrc/passes/mlir_compiler.cpp +++ b/pybuda/csrc/passes/mlir_compiler.cpp @@ -42,6 +42,12 @@ namespace tt::passes // Create a context with all registered dialects. mlir::MLIRContext context(registry); + +#ifdef DEBUG + // Context setting to have mlir print out stacktrace whenever errors occur + context.printStackTraceOnDiagnostic(true); +#endif + // Load all available dialects context.loadAllAvailableDialects();