Skip to content

Commit

Permalink
Partially reenable 'no_skip' optimisation
Browse files Browse the repository at this point in the history
The most vital conditional is still left as a TODO since it requires a single
loop unrolling
  • Loading branch information
SSoelvsten committed Jun 14, 2024
1 parent 5ea9051 commit eb84061
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/adiar/bdd/apply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace adiar
/// \brief Whether this policy may introduce skipping of nodes.
///
/// \detail This variable can be used at compile-time to prune conditional statements.
static constexpr bool no_skip = false;
static constexpr bool no_skip = true;
};

//////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
5 changes: 4 additions & 1 deletion src/adiar/internal/algorithms/prod2.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ namespace adiar::internal
inline void
operator()(const Request& req) const
{
if (Policy::no_skip || !req.data.source.is_nil()) {
// TODO: Use 'Policy::no_skip'
if (!req.data.source.is_nil()) {
this->_aw.push_internal({ req.data.source, this->_out_uid });
}
}
Expand Down Expand Up @@ -298,6 +299,7 @@ namespace adiar::internal
// Set up cross-level priority queue
PriorityQueue_1 prod_pq({ in_pq, in_ra }, pq_memory, max_pq_size, stats_prod2.lpq);
prod_pq.push({ { v_pq.uid(), in_nodes_ra.root() }, {}, { ptr_uint64::nil() } });
// TODO: Allow using 'Policy::no_skip' when pushing; the ptr_uint64::nil() above breaks this!

out_arcs->max_1level_cut = prod_pq.size();

Expand Down Expand Up @@ -421,6 +423,7 @@ namespace adiar::internal
// Set up cross-level priority queue
PriorityQueue_1 prod_pq_1({ in_0, in_1 }, pq_1_memory, max_pq_1_size, stats_prod2.lpq);
prod_pq_1.push({ { v0.uid(), v1.uid() }, {}, { ptr_uint64::nil() } });
// TODO: Allow using 'Policy::no_skip' when pushing; the ptr_uint64::nil() above breaks this!

// Set up per-level priority queue
PriorityQueue_2 prod_pq_2(pq_2_memory, max_pq_2_size);
Expand Down

0 comments on commit eb84061

Please sign in to comment.