Pelles C > Feature requests

Support for atomic operations on doubles in OpenMP

(1/1)

Melirius:
Hey, I found out that atomic operations on doubles are not permitted on x64 architecture in Pelles C 9.00 giving error #2513. Example:


--- Code: ---double x[100] = {1}, sum = 0;
#pragma omp parallel for
for(int i = 0; i < 100; ++i)
#pragma omp atomic
  sum += x[i];

--- End code ---

Is it possible to implement them?

Pelle:
It should be possible, at least by (mis)using integer instructions, but it's too late for the upcoming version 10.
Will have to wait until another version (it's not exactly a five minute job).

(I think there were some concerns about floating-point atomics when _Atomic was added to C11, but I no longer remember the details.)

Melirius:
Thanks a lot! I'm using critical sections as a workaround, but atomics should be faster.

Navigation

[0] Message Index

Go to full version