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

Method readCalibrationCache

src/engine.cpp:109–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void const *Int8EntropyCalibrator2::readCalibrationCache(size_t &length) noexcept {
110 std::cout << "Searching for calibration cache: " << m_calibTableName << std::endl;
111 m_calibCache.clear();
112 std::ifstream input(m_calibTableName, std::ios::binary);
113 input >> std::noskipws;
114 if (m_readCache && input.good()) {
115 std::cout << "Reading calibration cache: " << m_calibTableName << std::endl;
116 std::copy(std::istream_iterator<char>(input), std::istream_iterator<char>(), std::back_inserter(m_calibCache));
117 }
118 length = m_calibCache.size();
119 return length ? m_calibCache.data() : nullptr;
120}
121
122void Int8EntropyCalibrator2::writeCalibrationCache(const void *ptr, std::size_t length) noexcept {
123 std::cout << "Writing calib cache: " << m_calibTableName << " Size: " << length << " bytes" << std::endl;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected