hi, everyone. I don’t know how to deal with this situation. pls help me~ Thank you
here is the code:
float *d_scores = 0;
cudaMalloc((void **) &d_scores, batchSize * scoresLength * sizeof(float));
... d_scores = value;
int *d_scoresIndex = 0;
cudaMalloc((void **) &d_scoresIndex, batchSize * scoresLength * sizeof(int));
... d_scoresIndex = kes;
thrust::device_ptr<float> thrust_d_scores(d_scores);
thrust::device_ptr<int> thrust_d_scoresIndex(d_scoresIndex);
for (int i = 0; i < batchSize; ++i)
{
std::cout << "for trust i:" << i << std::endl;
thrust::stable_sort_by_key(thrust_d_scores + i * scoresLength,
thrust_d_scores + i * scoresLength + scoresLength,
thrust_d_scoresIndex + i * scoresLength,
thrust::greater<float>());
}
runtime error information:
terminate called after throwing an instance of ‘thrust::system::system_error’
what(): radix_sort: failed to get memory buffer: invalid configuration argument
Aborted (core dumped)
when I use this code, just change float to int, still core dump.
thrust::stable_sort_by_key(thrust_d_scores + i * scoresLength,
thrust_d_scores + i * scoresLength + scoresLength,
thrust_d_scoresIndex + i * scoresLength,
thrust::greater<
int>());
runtime error information changed to :
terminate called after throwing an instance of ‘thrust::system::system_error’
what(): merge_sort: failed to get memory buffer: invalid configuration argument
Aborted (core dumped)