File tree Expand file tree Collapse file tree 3 files changed +5
-14
lines changed
core/dev_api/openvino/runtime
plugins/intel_gpu/include/intel_gpu/graph/serialization Expand file tree Collapse file tree 3 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -118,9 +118,6 @@ class SharedStreamBuffer : public std::streambuf {
118118 explicit SharedStreamBuffer (const void * data, size_t size)
119119 : SharedStreamBuffer(reinterpret_cast <const char *>(data), size) {}
120120
121- const char * get_ptr () const { return m_data; }
122- size_t get_size () const { return m_size; }
123-
124121protected:
125122 // override std::streambuf methods
126123 std::streamsize xsgetn (char * s, std::streamsize count) override {
Original file line number Diff line number Diff line change @@ -222,15 +222,13 @@ InputModel::Ptr FrontEnd::load_impl(const std::vector<ov::Any>& variants) const
222222 weights = std::make_shared<ov::SharedBuffer<std::shared_ptr<MappedMemory>>>(mapped_memory->data (),
223223 mapped_memory->size (),
224224 mapped_memory);
225- } else if (ov::util::file_exists (weights_path)) {
226- ov::util::ParallelReadStreamBuf par_buf (weights_path);
227- std::istream bin_stream (&par_buf);
225+ } else if (std::ifstream bin_stream (weights_path, std::ios::binary); bin_stream.is_open ()) {
228226 bin_stream.seekg (0 , std::ios::end);
229- const size_t file_size = static_cast < size_t >( bin_stream.tellg () );
227+ size_t file_size = bin_stream.tellg ();
230228 bin_stream.seekg (0 , std::ios::beg);
231229
232230 auto aligned_weights_buffer = std::make_shared<ov::AlignedBuffer>(file_size);
233- bin_stream.read (aligned_weights_buffer->get_ptr <char >(), file_size );
231+ bin_stream.read (aligned_weights_buffer->get_ptr <char >(), aligned_weights_buffer-> size () );
234232
235233 weights = std::make_shared<ov::SharedBuffer<std::shared_ptr<ov::AlignedBuffer>>>(
236234 aligned_weights_buffer->get_ptr <char >(),
Original file line number Diff line number Diff line change 44
55#pragma once
66
7- #include < cstring>
8- #include < iostream>
7+ #include < sstream>
98#include < stdexcept>
10- #include < string>
119#include < type_traits>
1210#include < vector>
1311#include " buffer.hpp"
1412#include " helpers.hpp"
1513#include " bind.hpp"
16- #include " intel_gpu/runtime/itt.hpp"
1714
1815
1916namespace cldnn {
@@ -54,12 +51,11 @@ class BinaryInputBuffer : public InputBuffer<BinaryInputBuffer> {
5451 virtual ~BinaryInputBuffer () = default ;
5552
5653 virtual void read (void * const data, std::streamsize size) {
57- // Large-read parallelism is handled transparently by the streambuf layer
58- // (ParallelMemStreamBuf for mmap tensors, ParallelReadStreamBuf for file streams).
5954 auto const read_size = _stream.rdbuf ()->sgetn (reinterpret_cast <char *>(data), size);
6055 OPENVINO_ASSERT (read_size == size,
6156 " [GPU] Failed to read " + std::to_string (size) + " bytes from stream! Read " + std::to_string (read_size));
6257 }
58+
6359 void setKernelImplParams (void * impl_params) { _impl_params = impl_params; }
6460 void * getKernelImplParams () const { return _impl_params; }
6561
You can’t perform that action at this time.
0 commit comments