Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
2417 Discussions

atomic<float> only support fetch_and_store but not support fetch_and_add?

1 Reply
RafSchietekat
Black Belt
139 Views
That would be nice and orthogonal, but neither TBB nor C++11 provide arithmetic operations for floating-point types, so they require you to cobble those together yourself (note that with TBB you'll have to be extra careful when evaluating the result of compare_and_swap, as plus zero and minus zero are different bit patterns but compare as equal for the equality operator).
Reply