PDA

View Full Version : 16 bit integer Atomics



thesmileman
12-13-2011, 06:59 AM
This came up recently and seemed somewhat silly as we have 32bit and 64bit atomics. It was frustrating to have to send over a much larger buffer when all I needed was 16bit unsigned shorts.

david.garcia
12-13-2011, 04:43 PM
I doubt that support for 16-bit atomics is widespread on GPU hardware.

thesmileman
12-14-2011, 06:22 AM
I doubt that support for 16-bit atomics is widespread on GPU hardware.

Why? 16bit computations are commonplace these days.

ljbade
12-15-2011, 12:13 PM
You can always use masking combined with 32bit atomic ops to work with a 16bit buffer.

thesmileman
12-15-2011, 01:03 PM
You can always use masking combined with 32bit atomic ops to work with a 16bit buffer.

Hmmm...unless I am just crazy I don't see how that would work with atomic_inc?

david.garcia
12-15-2011, 03:22 PM
All atomic operations can be implemented with atom_cmpxchg(), albeit less efficiently. In particular, using masking like ljbade suggests may be a good option.