mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Summary: fix windows build broke in https://github.com/pytorch/pytorch/pull/156508 Test Plan: ci Rollback Plan: Differential Revision: D77080420 Pull Request resolved: https://github.com/pytorch/pytorch/pull/156565 Approved by: https://github.com/zhxchen17
25 lines
533 B
C++
25 lines
533 B
C++
#include <torch/nativert/executor/memory/Bump.h>
|
|
|
|
namespace torch::nativert {
|
|
|
|
LayoutPlan BumpAllocationPlanner(
|
|
const std::vector<AllocationSpec>& allocation_specs) {
|
|
LayoutPlan plan;
|
|
|
|
auto& allocations = plan.allocations;
|
|
auto& total_size = plan.total_size;
|
|
|
|
allocations.reserve(allocation_specs.size());
|
|
for (const auto& spec : allocation_specs) {
|
|
allocations.push_back(Allocation{
|
|
spec.size,
|
|
total_size,
|
|
});
|
|
total_size += spec.size;
|
|
}
|
|
|
|
return plan;
|
|
}
|
|
|
|
} // namespace torch::nativert
|