[Omp] atomic directive semantics
Shah, Sanjiv
sanjiv.shah at intel.com
Thu Sep 22 15:28:17 PDT 2005
So if I didn't answer your question directly, here goes:
Yes, complex is allowed to appear in an atomic.
Same with long double.
Just be careful that the performance may not be what you expect
depending on each implementation.
Sanjiv
--
Sanjiv, 217-403-4244
-----Original Message-----
From: Shah, Sanjiv
Sent: Thursday, September 22, 2005 5:06 PM
To: Richard Henderson; omp at openmp.org
Subject: RE: [Omp] atomic directive semantics
Hello Richard,
The OpenMP specifications have been written in a way that allows an
implementation the freedom to degrade a proper set of atomics to
critical sections based on the HW and SW support available.
Our intention was integer and real, and perhaps complex. Pointer can
also be done easily. It's really up to each implementation.
I hope that answers your question.
Sanjiv
--
Sanjiv, 217-403-4244
-----Original Message-----
From: Omp-bounces at openmp.org [mailto:Omp-bounces at openmp.org] On Behalf
Of Richard Henderson
Sent: Thursday, September 22, 2005 4:36 PM
To: omp at openmp.org
Subject: [Omp] atomic directive semantics
The section describing the atomic directive says "expression with
scalar type", without defining scalar type.
>From C99 6.2.5 paragraphs 21, 18 and 11 we get
(21) scalar types are arithmetic and pointer types
(18) arithmetic types are integer and floating types
(11) real floating and complex types are floating types
Which implies that complex types are scalars. I'd have preferred
that the C standard used "non-aggregate" instead, but there we are.
So the question is, does OpenMP think that atomic operations are
supposed to be supported for complex numbers, or does it in fact
use the more usual definition of the term "scalar" and mean
integral, pointer, and (non-complex) floating types?
For the most part, only 64-bit systems would be able to even implement
atomic operations on complex types, and even then only on complex float.
Along the same lines, how do compilers handle "long double"? As far
as I know, x86_64 is the only system with a compare-and-swap instruction
wide enough to implement this. Do compilers just print an error message
and leave it at that?
r~
_______________________________________________
Omp mailing list
Omp at openmp.org
http://openmp.org/mailman/listinfo/omp_openmp.org
More information about the Omp
mailing list