arbor-sim / arbor

The Arbor multi-compartment neural network simulation library.
https://arbor-sim.org
BSD 3-Clause "New" or "Revised" License
105 stars 59 forks source link

fix gpu warp intrinsics #2247

Closed boeschf closed 6 months ago

boeschf commented 6 months ago

reduce_by_key depends on warp level intrinsics to transfer values between different threads (lanes) participating in the reduction. The pertinent intrinsic is __shfl_down_sync which is accessed through Arbor's wrapper function shfl_down. However, the contribution from each thread to the reduction was erroneously truncated to an integer value. This PR fixes the signature of the respective wrapper functions and modifies the unit test in order to check that floating point reductions are not truncated. While cleaning up the cuda code path, the workaround using two 32-bit shuffle instructions for 64 bit data types (doubles) was removed - this was probably a leftover from cuda versions prior to 9.0.