These methods are needed in addition to the above template methods because pybind does not allow us to expose template methods to Python with gcc on Linux.
| 154 | // because pybind does not allow us to expose template methods to |
| 155 | // Python with gcc on Linux. |
| 156 | py::array_t<int8_t> MilStoragePythonReader::read_int4_data(uint64_t offset) { |
| 157 | // First read packed data using MILBlob reader, and restore to int8 values which represents int4. |
| 158 | auto int4SpanData = m_reader->GetDataView<MILBlob::Int4>(offset); |
| 159 | MILBlob::Util::Span<const uint8_t> packedValuesSpan = MILBlob::Util::CastFromBitSpan<const MILBlob::Int4>(int4SpanData); |
| 160 | auto unpackedInt4Data = MILBlob::UnPackSubByteVec<MILBlob::Int4>({packedValuesSpan.begin(), packedValuesSpan.end()}, int4SpanData.Size()); |
| 161 | return py::array_t<int8_t>(unpackedInt4Data.size(), reinterpret_cast<int8_t*>(unpackedInt4Data.data())); |
| 162 | } |
| 163 | |
| 164 | py::array_t<uint8_t> MilStoragePythonReader::read_uint1_data(uint64_t offset) { |
| 165 | return readUnsignedSubByteData<MILBlob::UInt1>(*m_reader, offset); |