Skip to content

Commit

Permalink
[NVIDIA] Moved MemorySolver to API 2.0 (openvinotoolkit#730)
Browse files Browse the repository at this point in the history
* [NVIDIA] Moved MemorySolver to API 2.0

* [NVIDIA] Aligned name convention check: snake case
  • Loading branch information
a-sidorova authored Nov 30, 2023
1 parent dcc05cb commit 4baa7ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ void MemoryModelBuilder::addAllocation(BufferID id, int producerIndex, int lastC
auto res = offsets_.emplace(id, 0);
OPENVINO_ASSERT(res.second, "ID is not unique!"); // Verify that "id" is unique.
const int64_t aligned_size = static_cast<int64_t>(applyAllignment(bsize));
boxes_.emplace_back(MemorySolver::Box{producerIndex, lastConsumerIndex, aligned_size, id});
boxes_.emplace_back(ov::MemorySolver::Box{producerIndex, lastConsumerIndex, aligned_size, id});
}

MemoryModel::Ptr MemoryModelBuilder::build() {
MemorySolver solver{boxes_};
ov::MemorySolver solver{boxes_};
const size_t blob_size = solver.solve();
for (auto& pair : offsets_) pair.second = solver.getOffset(pair.first);
for (auto& pair : offsets_) pair.second = solver.get_offset(pair.first);

return std::make_shared<MemoryModel>(blob_size, offsets_);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "memory_manager/model/cuda_memory_model.hpp"
#include "memory_solver.hpp"
#include "openvino/runtime/memory_solver.hpp"

namespace ov {
namespace nvidia_gpu {
Expand Down Expand Up @@ -37,7 +37,7 @@ class MemoryModelBuilder {
MemoryModel::Ptr build();

private:
std::vector<MemorySolver::Box> boxes_;
std::vector<ov::MemorySolver::Box> boxes_;
std::unordered_map<BufferID, ptrdiff_t> offsets_;
};

Expand Down

0 comments on commit 4baa7ed

Please sign in to comment.