opencl Atomic Operations

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Syntax

  • int atomic_add ( volatile __global int *p , int val)

  • unsigned int atomic_add ( volatile __global unsigned int *p , unsigned int val)

  • int atomic_add ( volatile __local int *p , int val)

  • unsigned int atomic_add ( volatile __local unsigned int *p ,unsigned int val)

Parameters

pval
pointer to celladded to cell

Remarks

Performance depends on atomic operations number and memory space. Doing serial work almost always slows kernel execution because of gpu being a SIMD array and each unit in an array waits other units if they don't do same type of work.

enter image description here



Got any opencl Question?