API
 
Loading...
Searching...
No Matches
util.hpp File Reference
#include "/opt/MagAOX/vendor/TensorRT-10.0.0.6/include/NvInfer.h"
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstring>
#include <cuda_runtime_api.h>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ratio>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for util.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Stopwatch< Clock >
 
class  Logger
 
struct  InferDeleter
 

Functions

bool doesFileExist (const std::string &filepath)
 
void parseCSV (std::string filepath, float *fileData)
 
std::string locateFile (const std::string &filepathSuffix, const std::vector< std::string > &directories, bool reportError=true)
 
void enableDLA (nvinfer1::IBuilder *builder, nvinfer1::IBuilderConfig *config, int useDLACore, bool allowGPUFallback=true)
 
std::unique_ptr< cudaStream_t, decltype(StreamDeleter)> makeCudaStream ()
 

Variables

static auto StreamDeleter
 

Function Documentation

◆ doesFileExist()

bool doesFileExist ( const std::string &  filepath)
inline

Definition at line 54 of file util.hpp.

Referenced by TensorrtEngine::build().

◆ enableDLA()

void enableDLA ( nvinfer1::IBuilder *  builder,
nvinfer1::IBuilderConfig *  config,
int  useDLACore,
bool  allowGPUFallback = true 
)
inline

Definition at line 145 of file util.hpp.

◆ locateFile()

std::string locateFile ( const std::string &  filepathSuffix,
const std::vector< std::string > &  directories,
bool  reportError = true 
)
inline

Locate path to file, given its filename or filepath suffix and possible dirs it might lie in. Function will also walk back MAX_DEPTH dirs from CWD to check for such a file path.

Definition at line 85 of file util.hpp.

Referenced by TensorRTEngine::constructNetwork().

◆ makeCudaStream()

std::unique_ptr< cudaStream_t, decltype(StreamDeleter)> makeCudaStream ( )

Definition at line 188 of file util.hpp.

Referenced by TensorrtEngine::build().

◆ parseCSV()

void parseCSV ( std::string  filepath,
float *  fileData 
)
inline

Definition at line 59 of file util.hpp.

Variable Documentation

◆ StreamDeleter

auto StreamDeleter
static
Initial value:
= [](cudaStream_t* pStream) {
if (pStream)
{
static_cast<void>(cudaStreamDestroy(*pStream));
delete pStream;
}
}

Definition at line 180 of file util.hpp.

Referenced by makeCudaStream().