MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / initLibrary

Function initLibrary

samples/trtexec/trtexec.cpp:108–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106
107template <typename FetchPtrs>
108bool initLibrary(LibraryPtr& libPtr, std::string const& libName, FetchPtrs fetchFunc)
109{
110 if (libPtr != nullptr)
111 {
112 return true;
113 }
114 try
115 {
116 libPtr.reset(new DynamicLibrary{libName});
117 fetchFunc(libPtr.get());
118 }
119 catch (std::exception const& e)
120 {
121 libPtr.reset();
122 sample::gLogError << "Could not load library " << libName << ": " << e.what() << std::endl;
123 return false;
124 }
125 catch (...)
126 {
127 libPtr.reset();
128 sample::gLogError << "Could not load library " << libName << std::endl;
129 return false;
130 }
131
132 return true;
133}
134#endif // !TRT_STATIC
135
136bool initNvinfer()

Callers 3

initNvinferFunction · 0.85
initNvonnxparserFunction · 0.85
initNvparsersFunction · 0.85

Calls 2

resetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected