TensorRT  7.2.1.6
NVIDIA TensorRT
Looking for a C++ dev who knows TensorRT?
I'm looking for work. Hire me!
AlgorithmCacheReader Class Reference

Replicates the algorithm selection using a cache file. More...

Inheritance diagram for AlgorithmCacheReader:
Collaboration diagram for AlgorithmCacheReader:

Classes

struct  AlgorithmCacheItem
 

Public Member Functions

int32_t selectAlgorithms (const nvinfer1::IAlgorithmContext &algoContext, const nvinfer1::IAlgorithm *const *algoChoices, int32_t nbChoices, int32_t *selection) override
 Return value in [0, nbChoices] for a valid algorithm. More...
 
void reportAlgorithms (const nvinfer1::IAlgorithmContext *const *algoContexts, const nvinfer1::IAlgorithm *const *algoChoices, int32_t nbAlgorithms) override
 Called by TensorRT to report choices it made. More...
 
 AlgorithmCacheReader (const std::string &cacheFileName)
 

Static Private Member Functions

static bool areSame (const AlgorithmCacheItem &algoCacheItem, const IAlgorithm &algoChoice)
 The combination of implementation, tactic and input/output formats is unique to an algorithm, and can be used to check if two algorithms are same. More...
 

Private Attributes

std::unordered_map< std::string, AlgorithmCacheItemchoiceMap
 

Detailed Description

Replicates the algorithm selection using a cache file.

Constructor & Destructor Documentation

◆ AlgorithmCacheReader()

AlgorithmCacheReader::AlgorithmCacheReader ( const std::string &  cacheFileName)
inline

Use the cache file to create a map of algorithm choices.

Member Function Documentation

◆ selectAlgorithms()

int32_t AlgorithmCacheReader::selectAlgorithms ( const nvinfer1::IAlgorithmContext algoContext,
const nvinfer1::IAlgorithm *const *  algoChoices,
int32_t  nbChoices,
int32_t *  selection 
)
inlineoverridevirtual

Return value in [0, nbChoices] for a valid algorithm.

Use the map created from cache to select algorithms.

There must be only one algorithm selected.

Implements nvinfer1::IAlgorithmSelector.

Here is the call graph for this function:

◆ reportAlgorithms()

void AlgorithmCacheReader::reportAlgorithms ( const nvinfer1::IAlgorithmContext *const *  algoContexts,
const nvinfer1::IAlgorithm *const *  algoChoices,
int32_t  nbAlgorithms 
)
inlineoverridevirtual

Called by TensorRT to report choices it made.

Verifies that the algorithm used by TensorRT conform to the cache.

Implements nvinfer1::IAlgorithmSelector.

Here is the call graph for this function:

◆ areSame()

static bool AlgorithmCacheReader::areSame ( const AlgorithmCacheItem algoCacheItem,
const IAlgorithm algoChoice 
)
inlinestaticprivate

The combination of implementation, tactic and input/output formats is unique to an algorithm, and can be used to check if two algorithms are same.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ choiceMap

std::unordered_map<std::string, AlgorithmCacheItem> AlgorithmCacheReader::choiceMap
private

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