CUDPP: Finding index of the max. in an array

Hi!

Is it possible to get the index of the maximum of an array using CUDPP?

With Scan function provided by CUDPP library, it is possible to efficiently find the maximum of an array, but then… how to know it’s index?

I need to know which position in the array, the maximum occupies.

Any idea of how to do such a thing?

CUDPP doesn’t support general reductions yet (just prefix sum), you might want to look at Thrust:
http://code.google.com/p/thrust/

Specifically, you’ll want to use thrust::max_element():

http://code.google.com/p/thrust/source/bro…t/extrema.h#129

There’s also a tutorial to get started:

http://code.google.com/p/thrust/wiki/Tutorial

Thanks!