Custom reduction operators in OpenMP

General OpenMP discussion

Custom reduction operators in OpenMP

Postby Ally » Wed Oct 24, 2007 4:58 am

Hi

Is it possible to implement your own reduction operators on classes/structs using OpenMP?

For example, suppose I have defined a new data-type with an associative binary operation, op (say), can I tell OpenMP about this and write something like:

#pragma omp parallel for reduction (op:i)

...

?

Thanks

Ally
Ally
 

Re: Custom reduction operators in OpenMP

Postby Federico » Wed Oct 24, 2007 6:45 am

No, you can't. Even overloading existing operators in C++ is not supported.
Look at the Restrictions part of Section 2.8.3.6 in the current 2.5specs.

Federico
Federico
 
Posts: 22
Joined: Wed Oct 24, 2007 6:39 am

Re: Custom reduction operators in OpenMP

Postby Ally » Wed Aug 13, 2008 11:45 pm

Thanks for the reply, and for the link to the standard.

Ally
Ally
 
Posts: 3
Joined: Wed Oct 24, 2007 5:22 am


Return to Using OpenMP

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 8 guests