23 #ifndef TVM_NODE_SCRIPT_PRINTER_H_
24 #define TVM_NODE_SCRIPT_PRINTER_H_
26 #include <tvm/ffi/any.h>
27 #include <tvm/ffi/container/array.h>
28 #include <tvm/ffi/container/map.h>
29 #include <tvm/ffi/reflection/access_path.h>
30 #include <tvm/ffi/reflection/registry.h>
31 #include <tvm/ffi/string.h>
126 refl::ObjectDef<PrinterConfigNode>()
151 static constexpr
const char*
_type_key =
"script.PrinterConfig";
157 explicit PrinterConfig(Map<String, ffi::Any> config_dict = Map<String, ffi::Any>());
167 static std::string
Script(
const ObjectRef& node,
const Optional<PrinterConfig>& cfg);
173 #define TVM_OBJECT_ENABLE_SCRIPT_PRINTER() \
174 std::string Script(const Optional<PrinterConfig>& config = std::nullopt) const { \
175 return TVMScriptPrinter::Script(GetRef<ObjectRef>(this), config.value_or(PrinterConfig())); \
A dynamically dispatched functor on the type of the first argument.
Definition: functor.h:65
Definition: script_printer.h:40
Array< ffi::reflection::AccessPath > path_to_underline
Definition: script_printer.h:116
static constexpr const char * _type_key
Definition: script_printer.h:151
std::string tir_prefix
The prefix of TIR nodes.
Definition: script_printer.h:49
bool print_line_numbers
Whether to print line numbers.
Definition: script_printer.h:72
Array< String > GetBuiltinKeywords()
DataType int_dtype
Default data type of integer literals.
Definition: script_printer.h:60
bool verbose_expr
Whether or not to verbose print expressions.
Definition: script_printer.h:68
bool syntax_sugar
Whether to output with syntax sugar, set false for complete printing.
Definition: script_printer.h:76
Array< ObjectRef > obj_to_underline
Object to be underlined.
Definition: script_printer.h:120
bool show_all_struct_info
In Relax, whether to show all StructInfo annotations.
Definition: script_printer.h:113
bool show_object_address
Whether variable names should include the object's address.
Definition: script_printer.h:78
Map< ffi::reflection::AccessPath, String > path_to_annotate
Object path to be annotated.
Definition: script_printer.h:118
int indent_spaces
Number of spaces used for indentation.
Definition: script_printer.h:70
int num_context_lines
Number of context lines to print around the underlined text.
Definition: script_printer.h:74
bool show_meta
Whether or not to show metadata.
Definition: script_printer.h:45
std::string relax_prefix
The prefix of Relax nodes.
Definition: script_printer.h:51
Map< ObjectRef, String > obj_to_annotate
Object to be annotated.
Definition: script_printer.h:122
Array< String > binding_names
A stack that tracks the names of the binding hierarchy.
Definition: script_printer.h:43
DataType float_dtype
Default data type of float literals. Right now we always print out the explicit type of floating poin...
Definition: script_printer.h:66
std::string module_alias
The alias of the current module at cross-function call.
Definition: script_printer.h:56
static void RegisterReflection()
Definition: script_printer.h:124
DataType buffer_dtype
Default data type of TIR buffer.
Definition: script_printer.h:58
TVM_DECLARE_FINAL_OBJECT_INFO(PrinterConfigNode, Object)
std::string ir_prefix
The prefix of IR nodes.
Definition: script_printer.h:47
Definition: script_printer.h:155
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(PrinterConfig, runtime::ObjectRef, PrinterConfigNode)
PrinterConfig(Map< String, ffi::Any > config_dict=Map< String, ffi::Any >())
Legacy behavior of ReprPrinter.
Definition: script_printer.h:164
static std::string Script(const ObjectRef &node, const Optional< PrinterConfig > &cfg)
Runtime primitive data type.
Definition: data_type.h:47
static DataType Float(int bits, int lanes=1)
Construct an float type.
Definition: data_type.h:291
static DataType Int(int bits, int lanes=1)
Construct an int type.
Definition: data_type.h:274
static DataType Void()
Construct a Void type.
Definition: data_type.h:397
Defines the Functor data structures.
Definition: repr_printer.h:91
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37