automatic code-reformat
All checks were successful
Validate Operations / validate-operations (push) Successful in 18m22s

This commit is contained in:
NiccoloN
2026-04-09 14:27:23 +02:00
parent 1a0192d1f9
commit 9e0d31af50
16 changed files with 88 additions and 103 deletions

View File

@@ -485,7 +485,7 @@ DCPAnalysisResult GraphDCP::getResult() {
size_t i = 0;
for (auto node : nodes) {
ret.computeToCPUMap[node->getSpatWeightedCompute()] = cpu;
if (i++ == nodes.size() - 1){
if (i++ == nodes.size() - 1) {
ret.isLastComputeOfACpu.insert(node->getSpatWeightedCompute());
ret.cpuToLastComputeMap[cpu] = node->getSpatWeightedCompute();
}

View File

@@ -43,7 +43,5 @@ bool TaskDCP::hasDescendent(TaskDCP* child) {
return false;
}
//TODO fare qualcosa di sensato
int TaskDCP::computeWeight(GraphDCP* graph, CPU cpu) {
return orig_weight;
}
// TODO fare qualcosa di sensato
int TaskDCP::computeWeight(GraphDCP* graph, CPU cpu) { return orig_weight; }

View File

@@ -75,11 +75,11 @@ public:
alst = val;
}
bool hasDescendent(TaskDCP* child);
int64_t Id() const { return (int64_t)spatWeightedCompute.getAsOpaquePointer(); }
int64_t Id() const { return (int64_t) spatWeightedCompute.getAsOpaquePointer(); }
bool isCP() const { return alst == aest; }
bool isScheduled() const { return scheduledCPU.has_value(); }
onnx_mlir::spatial::SpatWeightedCompute getSpatWeightedCompute(){return spatWeightedCompute;}
onnx_mlir::spatial::SpatWeightedCompute getSpatWeightedCompute() { return spatWeightedCompute; }
friend std::optional<Edge_pair> addEdge(TaskDCP* parent, TaskDCP* child, Weight_t weight);
friend void removeEdge(TaskDCP* parent, TaskDCP* child);

View File

@@ -71,12 +71,7 @@ public:
return true;
}
auto begin() {
return storage.begin();
}
auto end() {
return storage.end();
}
auto begin() { return storage.begin(); }
auto end() { return storage.end(); }
};

View File

@@ -1,7 +1,9 @@
#pragma once
#include "mlir/IR/BuiltinTypeInterfaces.h"
#include "llvm/Support/Casting.h"
#include <algorithm>
#include <cstdint>
#include <utility>
@@ -50,10 +52,9 @@ inline int64_t getSpatWeightCompute(onnx_mlir::spatial::SpatWeightedCompute spat
int64_t tot = 0;
for (auto& region : spatWeightedCompute.getBody()) {
for (auto& inst : region) {
for(auto result : inst.getResults()){
if(auto element = llvm::dyn_cast<mlir::ShapedType>(result.getType()))
tot += onnx_mlir::getSizeInBytes(element);
}
for (auto result : inst.getResults())
if (auto element = llvm::dyn_cast<mlir::ShapedType>(result.getType()))
tot += onnx_mlir::getSizeInBytes(element);
}
}
return tot;

View File

@@ -413,7 +413,7 @@ struct ChannelBroadcastReceiveOpInterface
outputTensor,
rewriter.getI32IntegerAttr(numElements * elementSize),
rewriter.getI32IntegerAttr(srcCoreId.value()))
.getOutput();
.getOutput();
replaceOpWithBufferizedValues(rewriter, op, newValue);