tvm
Loading...
Searching...
No Matches
printer.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
23#ifndef TVM_SCRIPT_PRINTER_PRINTER_H_
24#define TVM_SCRIPT_PRINTER_PRINTER_H_
25
26#include <tvm/ffi/container/map.h>
27#include <tvm/ffi/optional.h>
29
30#include <optional>
31#include <string>
32
33namespace tvm {
34
41TVM_TIRX_DLL std::string Script(const ffi::ObjectRef& node,
42 const ffi::Optional<PrinterConfig>& config = std::nullopt);
43
44namespace script {
45namespace printer {
46
52TVM_TIRX_DLL void RegisterNamespaceAlias(const ffi::String& key, const ffi::String& default_alias);
53
55TVM_TIRX_DLL const ffi::Map<ffi::String, ffi::String>& GetNamespaceAliases();
56
57} // namespace printer
58} // namespace script
59} // namespace tvm
60
61#endif // TVM_SCRIPT_PRINTER_PRINTER_H_
Configuration object for the TVMScript printer.
TVM_TIRX_DLL const ffi::Map< ffi::String, ffi::String > & GetNamespaceAliases()
Read the registered namespace aliases.
TVM_TIRX_DLL void RegisterNamespaceAlias(const ffi::String &key, const ffi::String &default_alias)
Register a namespace alias during dialect static initialization.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
TVM_TIRX_DLL std::string Script(const ffi::ObjectRef &node, const ffi::Optional< PrinterConfig > &config=std::nullopt)
Print an IR object as TVMScript, using repr when no translation hook exists.
#define TVM_TIRX_DLL
Definition base.h:83