eyalroz / cuda-kat

CUDA kernel author's tools
BSD 3-Clause "New" or "Revised" License
105 stars 8 forks source link

Pass arguments by value to atomic functions #15

Closed eyalroz closed 5 years ago

eyalroz commented 5 years ago

CUDA atomics apply to types of size at most 8 and which are trivially copyable. There is no benefit, therefore, from their wrappers taking constant references rather than actual value. In fact, this will mostly serve to cause problems if we try to pass rvalues.

So, let's just drop all that use of const &T in favor of Ts.

Also, this will mean most atomic wrappers only take a single address (pointer/reference), so we no longer need to mark them with __restrict__ (!).