Atomic operation in shared memory


are the operations on shared memory atomic?
For example: If I have a variable sum=0 in shared memory
and every thread adds 1 to it.
Is it guaranteed, that, for a thread block,
at the end, sum has the value of #numberofthreads?

If no, are there any atomic functions for shared mem, as for global memory?

Regards yez


atomic functions with shared memory are supported only from 1.2 device capabilities, see Appendix C in NVIDIA CUDA Programming Guide