MCPcopy Create free account
hub / github.com/cyrusbehr/tensorrt-cpp-api / clearGpuBuffers

Method clearGpuBuffers

src/engine.h:214–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212template <typename T> Engine<T>::~Engine() { clearGpuBuffers(); }
213
214template <typename T> void Engine<T>::clearGpuBuffers() {
215 if (!m_buffers.empty()) {
216 // Free GPU memory of outputs
217 const auto numInputs = m_inputDims.size();
218 for (int32_t outputBinding = numInputs; outputBinding < m_engine->getNbIOTensors(); ++outputBinding) {
219 Util::checkCudaErrorCode(cudaFree(m_buffers[outputBinding]));
220 }
221 m_buffers.clear();
222 }
223}
224
225template <typename T>
226bool Engine<T>::buildLoadNetwork(std::string onnxModelPath, const std::array<float, 3> &subVals, const std::array<float, 3> &divVals,

Callers

nothing calls this directly

Calls 1

checkCudaErrorCodeFunction · 0.85

Tested by

no test coverage detected