| 107 | } |
| 108 | |
| 109 | void 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 | |
| 122 | void Int8EntropyCalibrator2::writeCalibrationCache(const void *ptr, std::size_t length) noexcept { |
| 123 | std::cout << "Writing calib cache: " << m_calibTableName << " Size: " << length << " bytes" << std::endl; |
nothing calls this directly
no outgoing calls
no test coverage detected