tvm
|
#include <index_map.h>
Public Member Functions | |
IndexMap (Array< Var > initial_indices, Array< PrimExpr > final_indices, Optional< IndexMap > inverse_index_map=NullOpt) | |
The constructor. More... | |
IndexMap | Inverse (Array< Range > initial_ranges) const |
Generate the inverse mapping. More... | |
IndexMap | RenameVariables (const std::function< Optional< String >(const Var &var)> &f_name_map=nullptr) const |
Rename the variables in the index map and ensure the names are unique. More... | |
std::pair< IndexMap, PrimExpr > | NonSurjectiveInverse (Array< Range > initial_ranges) const |
Generate the inverse mapping. More... | |
TVM_DEFINE_OBJECT_REF_METHODS (IndexMap, ObjectRef, IndexMapNode) | |
![]() | |
ObjectRef ()=default | |
default constructor More... | |
ObjectRef (ObjectPtr< Object > data) | |
Constructor from existing object ptr. More... | |
bool | same_as (const ObjectRef &other) const |
Comparator. More... | |
bool | operator== (const ObjectRef &other) const |
Comparator. More... | |
bool | operator!= (const ObjectRef &other) const |
Comparator. More... | |
bool | operator< (const ObjectRef &other) const |
Comparator. More... | |
bool | defined () const |
const Object * | get () const |
const Object * | operator-> () const |
bool | unique () const |
int | use_count () const |
template<typename ObjectType > | |
const ObjectType * | as () const |
Try to downcast the internal Object to a raw pointer of a corresponding type. More... | |
Static Public Member Functions | |
static IndexMap | FromFunc (int ndim, runtime::TypedPackedFunc< Array< PrimExpr >(Array< Var >)> func, Optional< IndexMap > inverse_index_map=NullOpt) |
Create an index map from a packed function. More... | |
Additional Inherited Members | |
![]() | |
using | ContainerType = Object |
type indicate the container type. More... | |
![]() | |
static constexpr bool | _type_is_nullable = true |
![]() | |
Object * | get_mutable () const |
![]() | |
template<typename T > | |
static T | DowncastNoCheck (ObjectRef ref) |
Internal helper function downcast a ref without check. More... | |
static void | FFIClearAfterMove (ObjectRef *ref) |
Clear the object ref data field without DecRef after we successfully moved the field. More... | |
template<typename ObjectType > | |
static ObjectPtr< ObjectType > | GetDataPtr (const ObjectRef &ref) |
Internal helper function get data_ as ObjectPtr of ObjectType. More... | |
![]() | |
ObjectPtr< Object > | data_ |
Internal pointer that backs the reference. More... | |
tvm::tir::IndexMap::IndexMap | ( | Array< Var > | initial_indices, |
Array< PrimExpr > | final_indices, | ||
Optional< IndexMap > | inverse_index_map = NullOpt |
||
) |
The constructor.
initial_indices | Variables representing the indices prior to remapping |
final_indices | Expressions defining the indices after remapping. |
inverse_index_map | The optional pre-defined inverse index map |
|
static |
Create an index map from a packed function.
ndim | The number of dimensions |
func | The function to be applied |
inverse_index_map | The optional pre-defined inverse index map |
Generate the inverse mapping.
The range of the input indices is required in order to ensure that the transformation is bijective over the input domain.
If the user has supplied an inverse_index_map
, that map is assumed to be correct and bijective, and is returned.
std::pair<IndexMap, PrimExpr> tvm::tir::IndexMap::NonSurjectiveInverse | ( | Array< Range > | initial_ranges | ) | const |
Generate the inverse mapping.
Determine the inverse, where the output range may contain addresses that do not correspond to an address in the input range.
IndexMap tvm::tir::IndexMap::RenameVariables | ( | const std::function< Optional< String >(const Var &var)> & | f_name_map = nullptr | ) | const |
Rename the variables in the index map and ensure the names are unique.
Construct a new index map with the same transformation, but with name_hint of variables to be guaranteed unique. The optional f_name_map can be provided to rename the variables.
f_name_map | The optional name map to rename the variables. |
tvm::tir::IndexMap::TVM_DEFINE_OBJECT_REF_METHODS | ( | IndexMap | , |
ObjectRef | , | ||
IndexMapNode | |||
) |