forked from daphne-project/daphne
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDistributedAllocationHelpers.h
More file actions
33 lines (27 loc) · 905 Bytes
/
Copy pathDistributedAllocationHelpers.h
File metadata and controls
33 lines (27 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef SRC_RUNTIME_LOCAL_DATASTRUCTURES_DISTRIBUTEDALLOCATIONHELPER_H
#define SRC_RUNTIME_LOCAL_DATASTRUCTURES_DISTRIBUTEDALLOCATIONHELPER_H
class DistributedIndex {
public:
DistributedIndex() : row_(0), col_(0) {}
DistributedIndex(size_t row, size_t col) : row_(row), col_(col) {}
size_t getRow() const { return row_; }
size_t getCol() const { return col_; }
bool operator<(const DistributedIndex rhs) const {
if (row_ < rhs.row_)
return true;
else if (row_ == rhs.row_)
return col_ < rhs.col_;
return false;
}
private:
size_t row_;
size_t col_;
};
struct DistributedData {
std::string identifier;
size_t numRows, numCols;
mlir::daphne::VectorCombine vectorCombine;
bool isPlacedAtWorker = false;
DistributedIndex ix;
};
#endif // SRC_RUNTIME_LOCAL_DATASTRUCTURES_DISTRIBUTEDALLOCATIONHELPER_H