tvm
Loading...
Searching...
No Matches
Namespaces | Functions
tvm::codegen Namespace Reference

namespace for target translation and codegen. More...

Namespaces

namespace  attr
 
namespace  intrin
 

Functions

TVM_TIRX_DLL ffi::Module Build (IRModule mod, Target target)
 Build a runtime module from an IRModule for the requested target.
 
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 allow the DSO loader to automatically discover and import the dependency from the shared library.
 
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.
 

Detailed Description

namespace for target translation and codegen.

Function Documentation

◆ Build()

TVM_TIRX_DLL ffi::Module tvm::codegen::Build ( IRModule  mod,
Target  target 
)

Build a runtime module from an IRModule for the requested target.

Parameters
modThe Module to be built
targetThe target to be built.
Returns
The generated module.

◆ PackImportsToC()

TVM_TIRX_DLL ffi::String tvm::codegen::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 allow the DSO loader to automatically discover and import the dependency from the shared library.

Parameters
mThe host module with the imports.
system_libWhether expose as system library.
c_symbol_prefixOptional symbol prefix of the blob symbol.
Returns
cstr The C string representation of the file.

◆ PackImportsToObjectFile()

TVM_TIRX_DLL void tvm::codegen::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.

The generated object can be linked with the host library so that the DSO loader discovers its imported modules. Requires LLVM code generation support.

Parameters
modThe host module with imports.
system_libWhether to expose the packed imports as a system library.
llvm_target_stringFull LLVM target specification, including cross-compilation options.
file_nameOutput path; its extension selects the object format.
c_symbol_prefixOptional blob symbol prefix, valid only for system libraries.