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_CODEGEN_CODEGEN_H_
25#define TVM_CODEGEN_CODEGEN_H_
26
27#include <tvm/ffi/extra/module.h>
28#include <tvm/ir/module.h>
29#include <tvm/runtime/base.h>
30#include <tvm/target/target.h>
31
32#include <string>
33
34namespace tvm {
36namespace codegen {
37
44TVM_TIRX_DLL ffi::Module Build(IRModule mod, Target target);
45
57TVM_TIRX_DLL ffi::String PackImportsToC(const ffi::Module& m, bool system_lib,
58 const ffi::String& c_symbol_prefix = "");
59
72TVM_TIRX_DLL void PackImportsToObjectFile(const ffi::Module& mod, bool system_lib,
73 const ffi::String& llvm_target_string,
74 const ffi::String& file_name,
75 const ffi::String& c_symbol_prefix = "");
76
77namespace attr {
78inline constexpr ffi::reflection::AttrKey<bool> kParallelStridePattern{
79 "codegen.parallel_stride_pattern"};
80} // namespace attr
81
82} // namespace codegen
83} // namespace tvm
84#endif // TVM_CODEGEN_CODEGEN_H_
#define TVM_TIRX_DLL
Definition base.h:55
Managed reference class to IRModuleObj.
Definition module.h:292
Managed reference class to TargetObj.
Definition target.h:155
IRModule that holds the functions and type definitions.
constexpr ffi::reflection::AttrKey< bool > kParallelStridePattern
Definition codegen.h:78
TVM_TIRX_DLL void PackImportsToObjectFile(const ffi::Module &mod, bool system_lib, const ffi::String &llvm_target_string, const ffi::String &file_name, const ffi::String &c_symbol_prefix="")
Pack imported device libraries into an object file using LLVM.
TVM_TIRX_DLL ffi::String PackImportsToC(const ffi::Module &m, bool system_lib, const ffi::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_TIRX_DLL ffi::Module Build(IRModule mod, Target target)
Build a runtime module from an IRModule for the requested target.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analysis.h:41
Compilation target object.