thrust sort 自定义结构类型

大家好!
我想使用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上的数组进行排序?

LZ您好:

我不是thrust的用户,无法为您给出更多具体建议了,请其他熟悉thrust的人予以补充。

祝您好运~