大家好!
我想使用thrust的sort功能对设备端的数组进行排序:
typedef struct hnode
{
unsigned int splitLevel;
unsigned int primStart;
unsigned int primStop;
unsigned int ID;
} hnode_t;
void testSort()
{
int universeElementCount = 10;
thrust::device_vector<unsigned int> codes(universeElementCount,0);
thrust::device_vector<hnode_t> d_NODE(universeElementCount);
thrust::fill(codes.begin(),codes.end(),1);
//其他赋值操作...
// sort by the
thrust::sort_by_key(codes.begin(), codes.end(), d_NODE.begin());
}
单步跟踪在调用sort_by_key后出现:Microsoft C++ 异常: 内存位置 0x00bff4fc 处的 thrust::system::system_error。
在synchronize.inl文件中“ throw thrust::system_error(error, thrust::cuda_category(), std::string("synchronize: ") + message);”
请问这是怎么回事?如何对自定义类型的device上的数组进行排序?