Results 1 to 6 of 6

Thread: 16 bit integer Atomics

  1. #1
    Junior Member
    Join Date
    Dec 2009
    Posts
    17

    16 bit integer Atomics

    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.

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: 16 bit integer Atomics

    I doubt that support for 16-bit atomics is widespread on GPU hardware.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Junior Member
    Join Date
    Dec 2009
    Posts
    17

    Re: 16 bit integer Atomics

    Quote Originally Posted by david.garcia
    I doubt that support for 16-bit atomics is widespread on GPU hardware.
    Why? 16bit computations are commonplace these days.

  4. #4
    Junior Member
    Join Date
    Dec 2010
    Posts
    18

    Re: 16 bit integer Atomics

    You can always use masking combined with 32bit atomic ops to work with a 16bit buffer.

  5. #5
    Junior Member
    Join Date
    Dec 2009
    Posts
    17

    Re: 16 bit integer Atomics

    Quote Originally Posted by ljbade
    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?

  6. #6
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: 16 bit integer Atomics

    All atomic operations can be implemented with atom_cmpxchg(), albeit less efficiently. In particular, using masking like ljbade suggests may be a good option.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. 128- bit integer atomics Support?
    By o4kareg2 in forum OpenCL
    Replies: 1
    Last Post: 08-30-2012, 02:28 PM
  2. Replies: 0
    Last Post: 08-02-2012, 09:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •