TVM  0.9.2
tvm::graph::abstract::OutputSelector< OutputProvider, Base > Class Template Reference

#include <tvm/graph/abstract/OutputSelector.h>

Public Member Functions

template<typename... Args>
 OutputSelector (Args &&... args)
 
void lock ()
 
void unlock ()
 
bool isLocked () const
 

Protected Member Functions

template<typename EnumT >
void disableOutput (EnumT e)
 
template<typename EnumT , typename... Args>
void disableOutput (EnumT e, Args... args)
 
template<typename EnumT >
void enableOutput (EnumT e)
 
template<typename EnumT , typename... Args>
void enableOutput (EnumT e, Args... args)
 
bool isOutputCustomEnabled (int e) const override
 

Detailed Description

template<typename OutputProvider, typename Base = OutputProvider>
class tvm::graph::abstract::OutputSelector< OutputProvider, Base >

This class adds to its template argument the capability to enable or disable some of its outputs.

We use here a bit of template meta-programming to take care of the following problem: imagine we have the following inheritance structure class A class B : public OutputSelector class C : public B class D : public OutputSelector<C> We want D to hold a single vector of bool for tracking enabled outputs and a single bool for lock. In our example, this means that OutputSelector holds the data, and OutputSelector<C> reuse the same data. We implement this by checking if the template parameter is a derived class of OutputSelector. If it is not (case of A in our example) we make OutputSelector inherit from SelectorMembers<true> so that it inherits the data. If it is (case of C), we make OutputSelector inherit from SelectorMembers<false> so that no data is added.

Constructor & Destructor Documentation

◆ OutputSelector()

template<typename OutputProvider , typename Base = OutputProvider>
template<typename... Args>
tvm::graph::abstract::OutputSelector< OutputProvider, Base >::OutputSelector ( Args &&...  args)
inline

Constructor. Simply forward the arguments for constructing OutputProvider

Member Function Documentation

◆ disableOutput() [1/2]

template<typename OutputProvider , typename Base = OutputProvider>
template<typename EnumT >
void tvm::graph::abstract::OutputSelector< OutputProvider, Base >::disableOutput ( EnumT  e)
inlineprotected

Disable an output. The enum must refer to an existing output.

◆ disableOutput() [2/2]

template<typename OutputProvider , typename Base = OutputProvider>
template<typename EnumT , typename... Args>
void tvm::graph::abstract::OutputSelector< OutputProvider, Base >::disableOutput ( EnumT  e,
Args...  args 
)
inlineprotected

Multi-argument version of disableOutput.

◆ enableOutput() [1/2]

template<typename OutputProvider , typename Base = OutputProvider>
template<typename EnumT >
void tvm::graph::abstract::OutputSelector< OutputProvider, Base >::enableOutput ( EnumT  e)
inlineprotected

Enable an output. The enum must refer to an existing output.

◆ enableOutput() [2/2]

template<typename OutputProvider , typename Base = OutputProvider>
template<typename EnumT , typename... Args>
void tvm::graph::abstract::OutputSelector< OutputProvider, Base >::enableOutput ( EnumT  e,
Args...  args 
)
inlineprotected

Multi-argument version of enableOutput.

◆ isLocked()

template<typename OutputProvider , typename Base = OutputProvider>
bool tvm::graph::abstract::OutputSelector< OutputProvider, Base >::isLocked ( ) const
inline

Check if the outputs are locked.

◆ isOutputCustomEnabled()

template<typename OutputProvider , typename Base = OutputProvider>
bool tvm::graph::abstract::OutputSelector< OutputProvider, Base >::isOutputCustomEnabled ( int  e) const
inlineoverrideprotected

Override the method of Outputs to get the desired enable/disable behavior.

◆ lock()

template<typename OutputProvider , typename Base = OutputProvider>
void tvm::graph::abstract::OutputSelector< OutputProvider, Base >::lock ( )
inline

Lock the outputs, preventing them to be enabled or disabled.

◆ unlock()

template<typename OutputProvider , typename Base = OutputProvider>
void tvm::graph::abstract::OutputSelector< OutputProvider, Base >::unlock ( )
inline

Unlock the outputs, allowing them to be enabled or disabled.


The documentation for this class was generated from the following file: