diff --git a/qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h b/qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h index 152df14..4658c67 100755 --- a/qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h +++ b/qdp_project/src/benchmark/pipelines/MAX_scan_filter_pipe.h @@ -232,7 +232,7 @@ private: public: void scan_b(size_t gid, size_t gcnt, size_t tid) { - size_t tcnt = thread_count_fc; + size_t tcnt = thread_count_ag; assert(chunk_size_w % tcnt == 0); assert(chunk_size_w % 16 == 0); assert(chunk_size_w % tcnt * 16 == 0); @@ -254,15 +254,18 @@ public: if constexpr (caching) { const auto data = cache_.Access(reinterpret_cast(chunk_ptr), chunk_size_b / tcnt); - data->WaitOnCompletion(); + data->WaitOnCompletion(); } pvc->stop("scan_b", tid * gcnt + gid); trt->stop_timer(1, tid * gcnt + gid); bt->timed_wait(*(*sync_barrier)[barrier_idx], 1, tid * gcnt + gid); + + if constexpr (caching) (*(*sync_barrier)[barrier_idx]).arrive_and_drop(); } - (*(*sync_barrier)[barrier_idx]).arrive_and_drop(); + + if constexpr (!caching) (*(*sync_barrier)[barrier_idx]).arrive_and_drop(); } void scan_a(size_t gid, size_t gcnt, size_t tid) { @@ -291,8 +294,11 @@ public: pvc->stop("scan_a", tid * gcnt + gid); trt->stop_timer(0, tid * gcnt + gid); bt->timed_wait(*(*sync_barrier)[barrier_idx], 0, tid * gcnt + gid); + + if constexpr (caching) (*(*sync_barrier)[barrier_idx]).arrive_and_drop(); } - (*(*sync_barrier)[barrier_idx]).arrive_and_drop(); + + if constexpr (!caching) (*(*sync_barrier)[barrier_idx]).arrive_and_drop(); } void aggr_j(size_t gid, size_t gcnt, size_t tid) { @@ -332,8 +338,8 @@ public: // even after waiting, so this must be checked if (data_ptr == nullptr) { - std::cerr << "[x] Cache Miss!" << std::endl; - exit(-1); + std::cerr << "[x] Cache Miss!" << std::endl; + exit(-1); } } else {