What ties the implementation of the atomic types to associative operations? I looked at a few C++11 references and saw that atomic is only implemented for integral, pointer, and Boolean types, but I didn't find anything about associativity being essential to the guarantee of atomicity. (Java also doesn't offer atomic floating-point types, and I've always wondered why not.)
This comment was marked helpful 0 times.
It's mostly an issue of ensuring consistent results across different execution schedules. In other words, one definitely could implement hardware that provided atomic operations for non-associative operations (like floating-point addition), but then a program using them could generate different results across different runs (which is an undesirable property, in most cases.)
In other words, if some memory location had a value A and then two threads did atomic floating-point addition of values B and C, respectively, to A, one execution schedule could cause a series of operations ordered like:
A = (A + B) + C
and another schedule could cause:
A = (A + C) + B
which may give a different final value for A, with floating-point. For rendering, we may not care about this, but I think the general philosophy is that most application areas do care about consistency in this area.
FWIW in core/parallel.h in the PBRT code there's an atomic floating-point add built on top of atomic compare and exchange, which everyone does support for floats (since it's all just bits in that respect...)