TensorRT  7.2.1.6
NVIDIA TensorRT
Looking for a C++ dev who knows TensorRT?
I'm looking for work. Hire me!
nvinfer1::IAlgorithmSelector Class Referenceabstract

Interface implemented by application for selecting and reporting algorithms of a layer provided by the builder. More...

Inheritance diagram for nvinfer1::IAlgorithmSelector:

Public Member Functions

virtual int32_t selectAlgorithms (const IAlgorithmContext &context, const IAlgorithm *const *choices, int32_t nbChoices, int32_t *selection)=0
 Select Algorithms for a layer from the given list of algorithm choices. More...
 
virtual void reportAlgorithms (const IAlgorithmContext *const *algoContexts, const IAlgorithm *const *algoChoices, int32_t nbAlgorithms)=0
 Called by TensorRT to report choices it made. More...
 
virtual ~IAlgorithmSelector ()
 

Detailed Description

Interface implemented by application for selecting and reporting algorithms of a layer provided by the builder.

Note
A layer in context of algorithm selection may be different from ILayer in INetworkDefiniton. For example, an algorithm might be implementing a conglomeration of multiple ILayers in INetworkDefinition.

Constructor & Destructor Documentation

◆ ~IAlgorithmSelector()

virtual nvinfer1::IAlgorithmSelector::~IAlgorithmSelector ( )
inlinevirtual

Member Function Documentation

◆ selectAlgorithms()

virtual int32_t nvinfer1::IAlgorithmSelector::selectAlgorithms ( const IAlgorithmContext context,
const IAlgorithm *const *  choices,
int32_t  nbChoices,
int32_t *  selection 
)
pure virtual

Select Algorithms for a layer from the given list of algorithm choices.

Returns
The number of choices selected from [0, nbChoices-1].
Parameters
contextThe context for which the algorithm choices are valid.
choicesThe list of algorithm choices to select for implementation of this layer.
nbChoicesNumber of algorithm choices.
selectionThe user writes indices of selected choices in to selection buffer which is of size nbChoices.
Note
TRT uses its default algorithm selection to choose from the list provided. If return value is 0, TRT’s default algorithm selection is used unless strict type constraints are set. The list of choices is valid only for this specific algorithm context.

Implemented in AlgorithmCacheWriter, MinimumWorkspaceAlgorithmSelector, and AlgorithmCacheReader.

◆ reportAlgorithms()

virtual void nvinfer1::IAlgorithmSelector::reportAlgorithms ( const IAlgorithmContext *const *  algoContexts,
const IAlgorithm *const *  algoChoices,
int32_t  nbAlgorithms 
)
pure virtual

Called by TensorRT to report choices it made.

Note
For a given optimization profile, this call comes after all calls to selectAlgorithms. algoChoices[i] is the choice that TensorRT made for algoContexts[i], for i in [0, nbAlgorithms-1]
Parameters
algoContextsThe list of all algorithm contexts.
algoChoicesThe list of algorithm choices made by TensorRT
nbAlgorithmsThe size of algoContexts as well as algoChoices.

Implemented in MinimumWorkspaceAlgorithmSelector, AlgorithmCacheReader, and AlgorithmCacheWriter.


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