#include "thrust/device_ptr.h"
#include "thrust/extrema.h"
#include "thrust/system_error.h"
#include <iostream>
exern "C" int min_float_wrapper( float *data, int N)
{
try {
thrust::device_ptr <float> dev_ptr(data);
return thrust::min_element(dev_ptr, dev_ptr + N) - dev_ptr;
}
catch(thrust::system_error &e) {
std::cerr << "min_float_wrapper error " << e.what() << std::endl;
return -1;
}
}