| 19 | |
| 20 | template <typename T> |
| 21 | std::vector<T> BinaryDumper::load(const std::string& filename) { |
| 22 | std::ifstream file(filename, std::ios::binary); |
| 23 | if (!file) return {}; |
| 24 | |
| 25 | // Read count |
| 26 | size_t count; |
| 27 | file.read(reinterpret_cast<char*>(&count), sizeof(count)); |
| 28 | |
| 29 | // Read T data |
| 30 | std::vector<T> data(count); |
| 31 | file.read(reinterpret_cast<char*>(data.data()), count * sizeof(T)); |
| 32 | |
| 33 | if (!file.good()) return {}; |
| 34 | return data; |
| 35 | } |
| 36 | |
| 37 | template std::vector<float> BinaryDumper::load(const std::string&); |
| 38 | template std::vector<f16_t> BinaryDumper::load(const std::string&); |
no outgoing calls
no test coverage detected