Dhondtguido / PaStiX4CalculiX

Other
16 stars 7 forks source link

SpMVCSR.h: CUDA replacement of __shfl functions #20

Open surajchandran1 opened 8 months ago

surajchandran1 commented 8 months ago

As per the CUDA programming guide:

Removal Notice: When targeting devices with compute capability 7.x or higher, __shfl, __shfl_up, __shfl_down, and __shfl_xor are no longer available and their sync variants (i.e. __shfl_sync, __shfl_up_sync, __shfl_down_sync, and __shfl_xor_sync) should be used instead.

SpMVCSR.h makes some calls to the warp primitives that need to be replaced when targeting newer GPU hardware. The sync variants take an extra first positional argument which is a mask on the GPU threads; the non-sync functionality can be obtained by passing -1 here (e.g. replace __shfl(row, 0) in line 75 with __shfl_sync(-1, row, 0)). Making this change in the codebase could, however, affect backwards compatibility.