Jorge
Jorge

Reputation: 30

Parallel algorithm in OpenACC to find Median

Is there any parallel algorithm that can be implemented in OpenACC to find the median of a vector?

Upvotes: 0

Views: 92

Answers (1)

Richard
Richard

Reputation: 61429

Finding the median requires having a sorted representation of the data.

OpenACC doesn't have a good way to achieve this. However, you could use Thrust to sort the data on the GPU and then continue working using OpenACC. It is likely that, with some fiddling, you can get this to work using device pointers with OpenACC without moving memory between the CPU and GPU.

Upvotes: 1

Related Questions