Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/common/util/include/openvino/util/file_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <functional>
#include <initializer_list>
#include <string>
#include <type_traits>
#include <vector>

#include "openvino/util/common_util.hpp"
Expand Down Expand Up @@ -295,7 +296,14 @@ void save_binary(const std::filesystem::path& path, const void* binary, size_t b
const char* trim_file_name(const char* const fname);

inline uint64_t get_id_for_file(const std::filesystem::path& path, size_t offset, size_t size) {
return util::u64_hash_combine(std::filesystem::hash_value(path), {offset, size});
using unsigned_value_type = std::make_unsigned_t<std::filesystem::path::value_type>;

uint64_t path_hash = 0;
for (const auto* value = path.c_str(); *value != 0; ++value) {
path_hash = util::u64_hash_combine(path_hash,
static_cast<uint64_t>(static_cast<unsigned_value_type>(*value)));
}
return util::u64_hash_combine(path_hash, {offset, size});
}
Comment on lines 298 to 307
Comment thread
praasz marked this conversation as resolved.

/**
Expand Down
Loading