Closed GoogleCodeExporter closed 9 years ago
Original comment by harr...@gmail.com
on 6 Jul 2011 at 2:36
This is fixed in trunk, will be included in the CUDPP 2.0 release. Simply
specify the CUDPP_OPTION_BACKWARD option when creating the plan for
cudppRadixSort.
Original comment by harr...@gmail.com
on 7 Jul 2011 at 7:58
I don't know what you're talking about. This doesn't work.
void sortOnGPU(float* arrayToSort,unsigned int numElements, Order order){
cout<<"sorting has begun"<<endl;
long startTime_,now_;
startTime_ = GetTickCount();
now_ = GetTickCount() - startTime_;
cout<<"it took "<<now_<<endl;//zero here
const int sortByLeastSignificant = 8*sizeof(float);//8 is the number of bits in a byte
unsigned int memSize = sizeof( float) * numElements;
float* d_idata;
CUDPPConfiguration config;
config.op = CUDPP_ADD;
config.datatype = CUDPP_FLOAT;
config.algorithm = CUDPP_SORT_RADIX;
if(order == Ascending){
config.options = CUDPP_OPTION_KEYS_ONLY;
}
else{//order == Descending
config.options = CUDPP_OPTION_KEYS_ONLY | CUDPP_OPTION_BACKWARD;
}
CUDPPHandle scanplan = 0;
CUDPPResult plan = cudppPlan(&scanplan, config, numElements, 1, 0);
if (CUDPP_SUCCESS != plan){
cout<<"error in sortOnGpu"<<endl;
printf("Error creating CUDPPPlan\n");
exit(-1);
}
//cout<<"now sorting."<<endl;
startTime_ = GetTickCount();
CUDPPResult result = cudppSort(plan,arrayToSort,arrayToSort,sortByLeastSignificant,numElements);
if (CUDPP_SUCCESS != result){
printf("Error sorting\n");
exit(-1);
}
// now_ = GetTickCount() - startTime_;
// cout<<"sorting took "<<now_<<" milliseconds"<<endl;
}
call to sortOnGPU works fine with order==Ascending (sorts in ascending order)
and sorts also in ascending order with order==Descending.
Original comment by noamz...@gmail.com
on 26 Jul 2011 at 6:34
Howdy, are you running the trunk version (from svn) of CUDPP? I'm not quite
sure you are looking at the code you sent.
Original comment by jow...@gmail.com
on 27 Jul 2011 at 11:47
Original issue reported on code.google.com by
liuxiaod...@gmail.com
on 18 May 2011 at 6:49