[Omp] CTOR/DTOR invocation for variables in emptyparalleldirectives?

Richard Henderson rth at twiddle.net
Thu Nov 3 13:19:32 PST 2005


On Thu, Nov 03, 2005 at 08:17:36AM -0800, Hoeflinger, Jay P wrote:
> Because of this, I believe that the compiler is free to dead-code any
> empty parallel region.

So you would contend that

  int x;
  #pragma omp threadprivate(x)

  void broadcast()
  {
  #pragma omp parallel copyin(x)
    ;
  }

Must instead be written

  void broadcast()
  {
  #pragma omp parallel
  #pragma omp single copyprivate(x)
    ;
  }

Or does your contention apply to *all* omp directives, and thus the
only way to correctly write this function is to somehow write a body
that the compiler can't optimize away.


r~




More information about the Omp mailing list