Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CUDA List of atomic operations

I was wondering if there is a complete list of atomic operations. I couldn't find something like that on the internet.

like image 595
soroosh.strife Avatar asked Aug 02 '12 07:08

soroosh.strife


People also ask

What is atomic operation CUDA?

Atomic Operations in CUDA • Performed by calling functions that are translated. into single instructions (a.k.a. intrinsic functions or. intrinsics) • Operation on one 32-bit or 64-bit word residing in. global or shared memory.

What are atomic memory operations?

What Is an Atomic Memory Operation? ▪ Uninterruptable read-modify-write memory operation. — Requested by threads. — Updates a value at a specific address. ▪ Serializes contentious updates from multiple threads.

Is AtomicAdd slow?

AtomicAdd in Shared memory is measured slower than in Global memory.

What are the three general section of CUDA program?

To execute any CUDA program, there are three main steps: Copy the input data from host memory to device memory, also known as host-to-device transfer. Load the GPU program and execute, caching data on-chip for performance. Copy the results from device memory to host memory, also called device-to-host transfer.


2 Answers

See the CUDA Programming Guide section on atomic functions.

like image 55
brano Avatar answered Sep 21 '22 05:09

brano


As of April 2020 (i.e. CUDA 10.2, Turing michroarchitecture), these are:

  • addition
  • subtraction
  • minimum
  • maximum
  • bitwise-and
  • bitwise-or
  • bitwise-xor
  • increment (with a wraparound value)
  • decrement (with a wraparound value)
  • compare-and-swap - which is perhaps the most significant, as you can "implement" essentially any atomic operation using compare-and-swap.

Note, however, that:

  • Only certain data types are directly supported (of size never above 8 bytes).
  • Earlier micro-architectures support less operations and/or less types.
  • CUDA memory only supports aligned accesses - whether they be regular or atomic.

For details, consult the Atomic Functions section of the CUDA Programming guide.

like image 39
einpoklum Avatar answered Sep 18 '22 05:09

einpoklum