tvm
codegen.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  */
19 
24 #ifndef TVM_TARGET_CODEGEN_H_
25 #define TVM_TARGET_CODEGEN_H_
26 
27 #include <tvm/ir/module.h>
29 #include <tvm/target/target.h>
30 #include <tvm/tir/expr.h>
31 
32 #include <string>
33 
34 namespace tvm {
36 namespace codegen {
37 // use packed function from runtime.
39 using runtime::TVMArgs;
41 
49 
56 std::string SerializeModuleToBytes(const runtime::Module& mod, bool export_dso = true);
57 
64 
76 std::string PackImportsToC(const runtime::Module& m, bool system_lib,
77  const std::string& c_symbol_prefix = "");
78 
93  const std::string& target_triple,
94  const std::string& c_symbol_prefix = "");
95 
96 } // namespace codegen
97 } // namespace tvm
98 #endif // TVM_TARGET_CODEGEN_H_
Managed reference class to IRModuleNode.
Definition: module.h:366
Managed reference class to TargetNode.
Definition: target.h:200
Module container of TVM.
Definition: module.h:79
Packed function is a type-erased function. The arguments are passed by packed format.
Definition: packed_func.h:141
Arguments into TVM functions.
Definition: packed_func.h:394
Return Value container, Unlike TVMArgValue, which only holds reference and do not delete the underlyi...
Definition: packed_func.h:946
IRModule that holds the functions and type definitions.
runtime::Module PackImportsToLLVM(const runtime::Module &m, bool system_lib, const std::string &target_triple, const std::string &c_symbol_prefix="")
Pack imported device library to a LLVM module. Compile the LLVM module and link with the host library...
runtime::Module Build(IRModule mod, Target target)
Build a module from array of lowered function.
std::string SerializeModuleToBytes(const runtime::Module &mod, bool export_dso=true)
Serialize runtime module including its submodules.
runtime::Module DeserializeModuleFromBytes(std::string blob)
Deserialize runtime module including its submodules.
std::string PackImportsToC(const runtime::Module &m, bool system_lib, const std::string &c_symbol_prefix="")
Pack imported device library to a C file. Compile the C file and link with the host library will allo...
tvm::PrimExpr mod(const tvm::PrimExpr &a, const tvm::PrimExpr &b)
Definition: broadcast.h:290
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Type-erased function used across TVM API.
Compilation target object.
TIR expressions.