TVM  0.9.4
tvm::utils::internal Namespace Reference

Classes

class  NoConstant
 
struct  RefSelector
 
struct  RefSelector< NoConstant >
 
class  BufferedMatrix
 
class  IdLess
 
class  IdEqual
 
class  HashId
 
class  RHS
 

Typedefs

using IdentityType = decltype(Eigen::MatrixXd::Identity())
 
using MultIdentityType = decltype(2. *Eigen::MatrixXd::Identity())
 
using MinusIdentityType = decltype(-Eigen::MatrixXd::Identity())
 
template<typename Derived >
using RefSelector_t = typename RefSelector< Derived >::type
 
template<typename LhsType , typename RhsType >
using AddConstantsRetType = std::remove_const_t< std::remove_reference_t< decltype(std::declval< LhsType >()+std::declval< RhsType >())> >
 
template<typename KeyWithId , typename Value , typename Allocator = std::allocator<std::pair<const KeyWithId, Value>>>
using map = std::map< KeyWithId, Value, IdLess< KeyWithId >, Allocator >
 
template<typename KeyWithId , typename Value , typename Allocator = std::allocator<std::pair<const KeyWithId, Value>>>
using unordered_map = std::unordered_map< KeyWithId, Value, HashId< KeyWithId >, IdEqual< KeyWithId >, Allocator >
 

Enumerations

enum class  RHSType { Zero , Double , Vector }
 

Functions

template<typename RhsType >
const RhsType & operator+ (const NoConstant &, const Eigen::MatrixBase< RhsType > &rhs)
 
template<typename LhsType >
const LhsType & operator+ (const Eigen::MatrixBase< LhsType > &lhs, const NoConstant &)
 
auto operator+ (const NoConstant &, const NoConstant &)
 
template<typename MultType >
NoConstant operator* (const MultType &, const NoConstant &)
 
template<typename Tuple , size_t... Indices>
auto tupleUnaryMinus (const Tuple &tuple, std::index_sequence< Indices... >)
 
template<typename MultType , typename Tuple , size_t... Indices>
auto tuplePremult (const MultType &m, const Tuple &tuple, std::index_sequence< Indices... >)
 
template<typename Object , typename Output , typename... Args>
void parseSourcesAndOutputs (graph::CallGraph *g, std::shared_ptr< graph::internal::Inputs > user, std::shared_ptr< Object > obj, Output output, Args &&... args)
 
template<typename Object1 , typename Object2 , typename... Args>
void parseSourcesAndOutputs (graph::CallGraph *g, std::shared_ptr< graph::internal::Inputs > user, std::shared_ptr< Object1 > obj1, std::shared_ptr< Object2 > obj2, Args &&... args)
 
template<typename Object >
void parseSourcesAndOutputs (graph::CallGraph *g, std::shared_ptr< graph::internal::Inputs > user, std::shared_ptr< Object > obj)
 
TVM_DLLAPI bool is_malloc_allowed_ ()
 
TVM_DLLAPI bool set_is_malloc_allowed_ (bool allow)
 
TVM_DLLAPI void override_is_malloc_allowed_ (bool v)
 
TVM_DLLAPI void restore_is_malloc_allowed_ ()
 
void check_malloc_coherency ()
 
void enforce_malloc_coherency ()
 

Detailed Description

Copyright 2017-2020 CNRS-AIST JRL and CNRS-UM LIRMM

Typedef Documentation

◆ AddConstantsRetType

template<typename LhsType , typename RhsType >
using tvm::utils::internal::AddConstantsRetType = typedef std::remove_const_t<std::remove_reference_t<decltype(std::declval<LhsType>() + std::declval<RhsType>())> >

Result type for the addition of two constant parts, existing or not.

◆ IdentityType

using tvm::utils::internal::IdentityType = typedef decltype(Eigen::MatrixXd::Identity())

Type of Eigen::MatrixXd::Identity()

◆ map

template<typename KeyWithId , typename Value , typename Allocator = std::allocator<std::pair<const KeyWithId, Value>>>
using tvm::utils::internal::map = typedef std::map<KeyWithId, Value, IdLess<KeyWithId>, Allocator>

◆ MinusIdentityType

using tvm::utils::internal::MinusIdentityType = typedef decltype(-Eigen::MatrixXd::Identity())

Type of -Eigen::MatrixXd::Identity()

◆ MultIdentityType

using tvm::utils::internal::MultIdentityType = typedef decltype(2. * Eigen::MatrixXd::Identity())

Type of double*Eigen::MatrixXd::Identity()

◆ RefSelector_t

template<typename Derived >
using tvm::utils::internal::RefSelector_t = typedef typename RefSelector<Derived>::type

◆ unordered_map

template<typename KeyWithId , typename Value , typename Allocator = std::allocator<std::pair<const KeyWithId, Value>>>
using tvm::utils::internal::unordered_map = typedef std::unordered_map<KeyWithId, Value, HashId<KeyWithId>, IdEqual<KeyWithId>, Allocator>

Enumeration Type Documentation

◆ RHSType

Describe the type of a right-hand-side argument.

  • Zero: the rhs is the zero vector
  • Double: the rhs is a vector with all elements equal to a given double
  • Vector: the rhs is a general vector
Enumerator
Zero 
Double 
Vector 

Function Documentation

◆ check_malloc_coherency()

void tvm::utils::internal::check_malloc_coherency ( )
inline

◆ enforce_malloc_coherency()

void tvm::utils::internal::enforce_malloc_coherency ( )
inline

Ensure that Eigen::internal::is_malloc_allowed() and tvm::utils::is_malloc_allowed() are the same.

This function is not meant to be called directly (but doing so should not change anything).

◆ is_malloc_allowed_()

TVM_DLLAPI bool tvm::utils::internal::is_malloc_allowed_ ( )

◆ operator*()

template<typename MultType >
NoConstant tvm::utils::internal::operator* ( const MultType &  ,
const NoConstant  
)
inline

Overload for post-multiplying by NoConstant. In this case, we need to return NoConstant.

◆ operator+() [1/3]

template<typename LhsType >
const LhsType& tvm::utils::internal::operator+ ( const Eigen::MatrixBase< LhsType > &  lhs,
const NoConstant  
)
inline

Adding an existing constant part with an absent constant part.

◆ operator+() [2/3]

template<typename RhsType >
const RhsType& tvm::utils::internal::operator+ ( const NoConstant ,
const Eigen::MatrixBase< RhsType > &  rhs 
)
inline

Adding an absent constant part with an existing constant part.

◆ operator+() [3/3]

auto tvm::utils::internal::operator+ ( const NoConstant ,
const NoConstant  
)
inline

Adding two absent constant parts.

◆ override_is_malloc_allowed_()

TVM_DLLAPI void tvm::utils::internal::override_is_malloc_allowed_ ( bool  v)

◆ parseSourcesAndOutputs() [1/3]

template<typename Object >
void tvm::utils::internal::parseSourcesAndOutputs ( graph::CallGraph g,
std::shared_ptr< graph::internal::Inputs user,
std::shared_ptr< Object >  obj 
)
inline

Recursion over the sources and outputs. End of recursion.

◆ parseSourcesAndOutputs() [2/3]

template<typename Object , typename Output , typename... Args>
void tvm::utils::internal::parseSourcesAndOutputs ( graph::CallGraph g,
std::shared_ptr< graph::internal::Inputs user,
std::shared_ptr< Object >  obj,
Output  output,
Args &&...  args 
)
inline

Recursion over the sources and outputs. Case where the next element to parse is an output.

◆ parseSourcesAndOutputs() [3/3]

template<typename Object1 , typename Object2 , typename... Args>
void tvm::utils::internal::parseSourcesAndOutputs ( graph::CallGraph g,
std::shared_ptr< graph::internal::Inputs user,
std::shared_ptr< Object1 >  obj1,
std::shared_ptr< Object2 >  obj2,
Args &&...  args 
)
inline

Recursion over the sources and outputs. Case where the next element to parse is a source.

◆ restore_is_malloc_allowed_()

TVM_DLLAPI void tvm::utils::internal::restore_is_malloc_allowed_ ( )

◆ set_is_malloc_allowed_()

TVM_DLLAPI bool tvm::utils::internal::set_is_malloc_allowed_ ( bool  allow)

◆ tuplePremult()

template<typename MultType , typename Tuple , size_t... Indices>
auto tvm::utils::internal::tuplePremult ( const MultType &  m,
const Tuple &  tuple,
std::index_sequence< Indices... >   
)

Premultiplication by m of each element i of the input tuple where the i's are the elements given by the sequence of index.

◆ tupleUnaryMinus()

template<typename Tuple , size_t... Indices>
auto tvm::utils::internal::tupleUnaryMinus ( const Tuple &  tuple,
std::index_sequence< Indices... >   
)

Taking the opposite of each element i of the input tuple where the i's are the elements given by the sequence of index.