summaryrefslogtreecommitdiff
path: root/src/abstract_hardware_model.cc
diff options
context:
space:
mode:
authorDavit Grigoryan <[email protected]>2026-04-11 03:49:00 +0000
committerDavit Grigoryan <[email protected]>2026-04-11 03:49:00 +0000
commit8b3b5bbf710302ad3a835626477dc1bf2d317952 (patch)
tree3584f8937b4bb67a8b5bda3262e872a5e04c467a /src/abstract_hardware_model.cc
parent6fe5349343b27a8919734fb4900dd2324cdf6c60 (diff)
initial impl of mimd timing model
Diffstat (limited to 'src/abstract_hardware_model.cc')
-rw-r--r--src/abstract_hardware_model.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/abstract_hardware_model.cc b/src/abstract_hardware_model.cc
index 316b02b..ed91a44 100644
--- a/src/abstract_hardware_model.cc
+++ b/src/abstract_hardware_model.cc
@@ -96,6 +96,33 @@ unsigned warp_inst_t::num_active_simd_sets() const {
return count;
}
+void warp_inst_t::set_source_inst_on_sets(const inst_t *src) {
+ for (unsigned s = 0; s < m_simd_sets.size(); s++) {
+ if (m_simd_sets[s].valid) {
+ m_simd_sets[s].source_inst = src;
+ }
+ }
+}
+
+void warp_inst_t::merge_simd_sets(
+ const std::vector<simd_set_info> &other_sets) {
+ assert(m_simd_sets.size() == other_sets.size());
+ for (unsigned s = 0; s < other_sets.size(); s++) {
+ if (other_sets[s].valid && !m_simd_sets[s].valid) {
+ m_simd_sets[s] = other_sets[s];
+ }
+ }
+}
+
+bool warp_inst_t::simd_sets_overlap(const std::vector<simd_set_info> &a,
+ const std::vector<simd_set_info> &b) {
+ assert(a.size() == b.size());
+ for (unsigned s = 0; s < a.size(); s++) {
+ if (a[s].valid && b[s].valid) return true;
+ }
+ return false;
+}
+
checkpoint::checkpoint() {
struct stat st = {0};