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.
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 functionshfl_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.