From 3bcfe051e4793116e4591fdfedc4cc8292a90b46 Mon Sep 17 00:00:00 2001 From: Stefan Djordjevic Date: Fri, 16 Aug 2024 16:44:12 +0000 Subject: [PATCH] Adding context option to print mlir stactrace on error --- 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();