I do not think that #include needed. Atomic operations are not available on Compute Capability 1.0 ( sm_10 ) sm_10 that you request nvcc to compile (by default).
To use atomicMax in your code, specify at least -arch=sm_11 on the command line:
$nvcc -arch=sm_11 glmax.cu -o glmax
Further, refer to Appendix F of the CUDA C Programming Guide for information on which atomic operations are available on specific computing capability platforms.
Of course, to run the code you will need a sm_11 GPU. My impression is that they are prevalent by now.
Jared hoberock
source share