Skip to content

Commit

Permalink
[Barrier] Update parallel initialize barriers
Browse files Browse the repository at this point in the history
  • Loading branch information
yichao-zh committed Sep 14, 2023
1 parent 97dfabd commit 8a55131
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions software/runtime/synchronization.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ void mempool_barrier_init(uint32_t core_id) {
if (core_id == 0) {
// Initialize the barrier
barrier = 0;
for (uint32_t i = 0; i < NUM_CORES * 4; i++) {
log_barrier[i] = 0;
}
for (uint32_t i = 0; i < NUM_CORES * 4; i++) {
partial_barrier[i] = 0;
}
wake_up_all();
mempool_wfi();
} else {
mempool_wfi();
}
// Initialize log-barriers synch variables in parallel
for (uint32_t i = core_id; i < NUM_CORES * 4; i += NUM_CORES) {
log_barrier[i] = 0;
partial_barrier[i] = 0;
}
mempool_barrier(NUM_CORES);
}

void mempool_barrier(uint32_t num_cores) {
Expand Down

0 comments on commit 8a55131

Please sign in to comment.