tvm
Loading...
Searching...
No Matches
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/ffi/extra/module.h>
28#include <tvm/ir/module.h>
29#include <tvm/ir/prim/expr.h>
30#include <tvm/target/target.h>
31
32#include <string>
33
34namespace tvm {
36namespace codegen {
37
44ffi::Module Build(IRModule mod, Target target);
45
52std::string SerializeModuleToBytes(const ffi::Module& mod, bool export_dso = true);
53
59ffi::Module DeserializeModuleFromBytes(std::string blob);
60
72std::string PackImportsToC(const ffi::Module& m, bool system_lib,
73 const std::string& c_symbol_prefix = "");
74
88ffi::Module PackImportsToLLVM(const ffi::Module& m, bool system_lib,
89 const std::string& target_triple,
90 const std::string& c_symbol_prefix = "");
91
92} // namespace codegen
93} // namespace tvm
94#endif // TVM_TARGET_CODEGEN_H_
Managed reference class to IRModuleNode.
Definition module.h:255
Managed reference class to TargetNode.
Definition target.h:134
RAII wrapper function to enter and exit a context object similar to python's with syntax.
Definition with_context.h:59
TIR expressions.
IRModule that holds the functions and type definitions.
ffi::Module PackImportsToLLVM(const ffi::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...
std::string SerializeModuleToBytes(const ffi::Module &mod, bool export_dso=true)
Serialize runtime module including its submodules.
std::string PackImportsToC(const ffi::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...
ffi::Module Build(IRModule mod, Target target)
Build a module from array of lowered function.
ffi::Module DeserializeModuleFromBytes(std::string blob)
Deserialize runtime module including its submodules.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analyzer.h:40
Compilation target object.