calyxir / calyx

Intermediate Language (IL) for Hardware Accelerator Generators
https://calyxir.org
MIT License
450 stars 44 forks source link

Actually parallelize reduction trees #2000

Closed anshumanmohan closed 1 month ago

anshumanmohan commented 1 month ago

This PR fixes a silly mistake in old code: the reduction tree was designed to add up "columns" of the provided memories in parallel to get intermediate sums, and to then add up the intermediate sums to get the overall sum. It was incorrectly doing all of this in sequence.

anshumanmohan commented 1 month ago

Oh whoops, this was a bad idea. What I thought was a mistake was in fact a genuine restriction. The code was correct as written.