用户
 找回密码
 立即注册
sunf71 该用户已被删除
发表于 2013-12-2 19:40:14
70931
大家好!
我想使用thrust的sort功能对设备端的数组进行排序:
  1. typedef struct hnode
  2. {
  3. unsigned int splitLevel;
  4.         unsigned int primStart;
  5.         unsigned int primStop;
  6.         unsigned int ID;       
  7. } hnode_t;
  8. void testSort()
  9. {
  10.        
  11.         int universeElementCount = 10;
  12.         thrust::device_vector<unsigned int> codes(universeElementCount,0);
  13.         thrust::device_vector<hnode_t> d_NODE(universeElementCount);
  14.         thrust::fill(codes.begin(),codes.end(),1);       
  15.         //其他赋值操作...
  16.         // sort by the
  17.         thrust::sort_by_key(codes.begin(), codes.end(), d_NODE.begin());

  18. }
复制代码
单步跟踪在调用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上的数组进行排序?
使用道具 举报 回复
发表于 2013-12-3 10:21:46
LZ您好:

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

祝您好运~
使用道具 举报 回复 支持 反对
发新帖
您需要登录后才可以回帖 登录 | 立即注册