Is it possible to do a reduction on an array with openmp?

前端 未结 5 655
一整个雨季
一整个雨季 2020-12-15 05:57

Does OpenMP natively support reduction of a variable that represents an array?

This would work something like the following...

float* a = (float*) c         


        
5条回答
  •  执笔经年
    2020-12-15 06:35

    OpenMP cannot perform reductions on array or structure type variables (see restrictions).

    You also might want to read up on private and shared clauses. private declares a variable to be private to each thread, where as shared declares a variable to be shared among all threads. I also found the answer to this question very useful with regards to OpenMP and arrays.

提交回复
热议问题