better throughput scheduling with steady state cost model, now limited to spatial

This commit is contained in:
NiccoloN
2026-10-26 12:07:01 +01:00
parent fd493ae6e8
commit 4b53f6cf10
62 changed files with 4293 additions and 871 deletions
+32
View File
@@ -0,0 +1,32 @@
#pragma once
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include <cassert>
#include <cstdint>
namespace onnx_mlir {
// Emptiness is normalized after consumption. Capacity and consumed prefixes
// cannot affect virtual timing, readiness, or the remaining FIFO sequence.
class PimDependencyTokens {
llvm::SmallVector<uint64_t, 1> values;
size_t head = 0;
public:
void initialize(size_t distance) { values.assign(distance, 0); head = 0; }
bool empty() const { return values.empty(); }
void push(uint64_t time) { values.push_back(time); }
uint64_t consume() {
assert(!empty());
uint64_t time = values[head++];
if (head == values.size()) { values.clear(); head = 0; }
else if (head >= values.size() - head) {
values.erase(values.begin(), values.begin() + head);
head = 0;
}
return time;
}
llvm::ArrayRef<uint64_t> remaining() const { return llvm::ArrayRef(values).drop_front(head); }
};
} // namespace onnx_mlir