File tree Expand file tree Collapse file tree 6 files changed +118
-0
lines changed
src/plugins/intel_npu/src/plugin Expand file tree Collapse file tree 6 files changed +118
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright (C) 2018-2025 Intel Corporation
2+ // SPDX-License-Identifier: Apache-2.0
3+ //
4+
5+ #pragma once
6+
7+ #include < cinttypes>
8+ #include < unordered_map>
9+ #include < unordered_set>
10+ #include < vector>
11+
12+ #include " intel_npu/common/igraph.hpp"
13+ #include " isection.hpp"
14+
15+ namespace intel_npu {
16+
17+ class BlobReader {
18+ public:
19+ BlobReader ();
20+ };
21+
22+ } // namespace intel_npu
Original file line number Diff line number Diff line change 1+ // Copyright (C) 2018-2025 Intel Corporation
2+ // SPDX-License-Identifier: Apache-2.0
3+ //
4+
5+ #pragma once
6+
7+ #include < cinttypes>
8+ #include < unordered_map>
9+ #include < unordered_set>
10+ #include < vector>
11+
12+ #include " intel_npu/common/igraph.hpp"
13+ #include " isection.hpp"
14+
15+ namespace intel_npu {
16+
17+ using CREToken = uint16_t ;
18+
19+ class BlobWriter {
20+ public:
21+ BlobWriter ();
22+
23+ void register_section (const ISection& section);
24+
25+ void register_offset_in_table (const ISection::SectionID id, const uint64_t offset);
26+
27+ void write (std::ostream& stream, const std::shared_ptr<IGraph>& graph);
28+
29+ void append_compatibility_requirement (const CREToken requirement_token);
30+
31+ private:
32+ void register_cre ();
33+
34+ void write_persistent_format_region ();
35+
36+ std::unordered_set<ISection::SectionID> registered_sections_ids;
37+ std::vector<ISection> registered_sections;
38+ std::unordered_map<ISection::SectionID, uint64_t > offsets_table;
39+ std::vector<CREToken> cre;
40+ };
41+
42+ } // namespace intel_npu
Original file line number Diff line number Diff line change 1+ // Copyright (C) 2018-2025 Intel Corporation
2+ // SPDX-License-Identifier: Apache-2.0
3+ //
4+
5+ #pragma once
6+
7+ #include < cinttypes>
8+ #include < unordered_map>
9+ #include < unordered_set>
10+ #include < vector>
11+
12+ #include " blob_reader.hpp"
13+ #include " blob_writer.hpp"
14+
15+ namespace intel_npu {
16+
17+ class ISection {
18+ public:
19+ using SectionID = uint16_t ;
20+
21+ ISection (const SectionID section_id);
22+
23+ virtual void write (std::ostream& stream, BlobWriter* writer) = 0;
24+
25+ // virtual void read(BlobReader* reader) = 0;
26+
27+ SectionID get_section_id ();
28+
29+ private:
30+ SectionID section_id;
31+ };
32+
33+ } // namespace intel_npu
Original file line number Diff line number Diff line change 1+ // Copyright (C) 2018-2025 Intel Corporation
2+ // SPDX-License-Identifier: Apache-2.0
3+ //
4+
5+ #include " blob_reader.hpp"
6+
7+ namespace intel_npu {} // namespace intel_npu
Original file line number Diff line number Diff line change 1+ // Copyright (C) 2018-2025 Intel Corporation
2+ // SPDX-License-Identifier: Apache-2.0
3+ //
4+
5+ #include " blob_writer.hpp"
6+
7+ namespace intel_npu {} // namespace intel_npu
Original file line number Diff line number Diff line change 1+ // Copyright (C) 2018-2025 Intel Corporation
2+ // SPDX-License-Identifier: Apache-2.0
3+ //
4+
5+ #include " isection.hpp"
6+
7+ namespace intel_npu {} // namespace intel_npu
You can’t perform that action at this time.
0 commit comments