| 212 | template <typename T> Engine<T>::~Engine() { clearGpuBuffers(); } |
| 213 | |
| 214 | template <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 | |
| 225 | template <typename T> |
| 226 | bool Engine<T>::buildLoadNetwork(std::string onnxModelPath, const std::array<float, 3> &subVals, const std::array<float, 3> &divVals, |
nothing calls this directly
no test coverage detected