tvm
Classes | Namespaces | Macros | Functions | Variables
module.h File Reference

Runtime container of the functions generated by TVM, This is used to support dynamically link, load and save functions from different convention under unified API. More...

#include <dmlc/io.h>
#include <tvm/ffi/cast.h>
#include <tvm/ffi/extra/module.h>
#include <tvm/ffi/function.h>
#include <tvm/ffi/memory.h>
#include <tvm/ffi/string.h>
#include <tvm/runtime/base.h>
#include <tvm/runtime/object.h>
#include <utility>
Include dependency graph for module.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tvm::runtime::details::ModuleVTableEntryHelper< T >
 
struct  tvm::runtime::details::ModuleVTableEntryHelper< R(T::*)(Args...) const >
 
struct  tvm::runtime::details::ModuleVTableEntryHelper< R(T::*)(Args...)>
 
struct  tvm::runtime::details::ModuleVTableEntryHelper< void(T::*)(Args...) const >
 
struct  tvm::runtime::details::ModuleVTableEntryHelper< void(T::*)(Args...)>
 

Namespaces

 tvm
 Performance counters for profiling via the PAPI library.
 
 tvm::runtime
 
 tvm::runtime::symbol
 namespace for constant symbols
 
 tvm::runtime::details
 

Macros

#define TVM_MODULE_VTABLE_BEGIN(TypeKey)
 
#define TVM_MODULE_VTABLE_END()
 
#define TVM_MODULE_VTABLE_END_WITH_DEFAULT(MemFunc)
 
#define TVM_MODULE_VTABLE_ENTRY(Name, MemFunc)
 
#define TVM_MODULE_VTABLE_ENTRY_PACKED(Name, MemFunc)
 

Functions

bool tvm::runtime::RuntimeEnabled (const String &target)
 Check if runtime module is enabled for target. More...
 

Variables

constexpr const char * tvm::runtime::symbol::tvm_set_device = "__tvm_set_device"
 global function to set device More...
 
constexpr const char * tvm::runtime::symbol::tvm_global_barrier_state = "__tvm_global_barrier_state"
 Auxiliary counter to global barrier. More...
 
constexpr const char * tvm::runtime::symbol::tvm_prepare_global_barrier = "__tvm_prepare_global_barrier"
 Prepare the global barrier before kernels that uses global barrier. More...
 

Detailed Description

Runtime container of the functions generated by TVM, This is used to support dynamically link, load and save functions from different convention under unified API.

Macro Definition Documentation

◆ TVM_MODULE_VTABLE_BEGIN

#define TVM_MODULE_VTABLE_BEGIN (   TypeKey)
Value:
const char* kind() const final { return TypeKey; } \
::tvm::ffi::Optional<::tvm::ffi::Function> GetFunction(const String& _name) override { \
using SelfPtr = std::remove_cv_t<decltype(this)>; \
::tvm::ffi::ObjectPtr<::tvm::ffi::Object> _self = \
::tvm::ffi::GetObjectPtr<::tvm::ffi::Object>(this);

◆ TVM_MODULE_VTABLE_END

#define TVM_MODULE_VTABLE_END ( )
Value:
return std::nullopt; \
}

◆ TVM_MODULE_VTABLE_END_WITH_DEFAULT

#define TVM_MODULE_VTABLE_END_WITH_DEFAULT (   MemFunc)
Value:
{ \
auto f = (MemFunc); \
return (this->*f)(_name); \
} \
}

◆ TVM_MODULE_VTABLE_ENTRY

#define TVM_MODULE_VTABLE_ENTRY (   Name,
  MemFunc 
)
Value:
if (_name == Name) { \
return ffi::Function::FromPacked([_self](ffi::PackedArgs args, ffi::Any* rv) -> void { \
using Helper = ::tvm::runtime::details::ModuleVTableEntryHelper<decltype(MemFunc)>; \
SelfPtr self = static_cast<SelfPtr>(_self.get()); \
Helper::Call(rv, self, MemFunc, args); \
}); \
}

◆ TVM_MODULE_VTABLE_ENTRY_PACKED

#define TVM_MODULE_VTABLE_ENTRY_PACKED (   Name,
  MemFunc 
)
Value:
if (_name == Name) { \
return ffi::Function([_self](ffi::PackedArgs args, ffi::Any* rv) -> void { \
(static_cast<SelfPtr>(_self.get())->*(MemFunc))(args, rv); \
}); \
}
tvm::relax::Function Function
Definition: transform.h:42