summaryrefslogtreecommitdiff
path: root/src/abstract_hardware_model.cc
diff options
context:
space:
mode:
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};