cudpp scan for MAX how to get the index of the max value

If I use cudppScan with op = CUDPP_MAX, I can get the max value of the array, but how can I get its index?

Thank you,

If I use cudppScan with op = CUDPP_MAX, I can get the max value of the array, but how can I get its index?

Thank you,

Hi

I do not quite understand your question. Can you state more precise what you want?

Hi

I do not quite understand your question. Can you state more precise what you want?

If I use cudppScan to do a scan to find the max value of an array, I can get the max value of this array which is the last value of the result array. But I still do not know the index of the max element of this array.

Example code:

CUDPPConfiguration config;

	config.op = CUDPP_MAX; 

	config.datatype = CUDPP_FLOAT;

	config.algorithm = CUDPP_SCAN;

	config.options = CUDPP_OPTION_FORWARD | CUDPP_OPTION_EXCLUSIVE;

	

	CUDPPHandle scanplan = 0;

	CUDPPResult result = cudppPlan(&scanplan, config, numElements, 1, 0);  

	// Run the scan

	cudppScan(scanplan, d_odata, d_idata, numElements);

	// now the max value is in d_odata[numElements - 1], but what is the index for it?

If I use cudppScan to do a scan to find the max value of an array, I can get the max value of this array which is the last value of the result array. But I still do not know the index of the max element of this array.

Example code:

CUDPPConfiguration config;

	config.op = CUDPP_MAX; 

	config.datatype = CUDPP_FLOAT;

	config.algorithm = CUDPP_SCAN;

	config.options = CUDPP_OPTION_FORWARD | CUDPP_OPTION_EXCLUSIVE;

	

	CUDPPHandle scanplan = 0;

	CUDPPResult result = cudppPlan(&scanplan, config, numElements, 1, 0);  

	// Run the scan

	cudppScan(scanplan, d_odata, d_idata, numElements);

	// now the max value is in d_odata[numElements - 1], but what is the index for it?