首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cuda thrust::remove_if为device_vector抛出"thrust::system::system_error“?

cuda thrust::remove_if为device_vector抛出"thrust::system::system_error“?
EN

Stack Overflow用户
提问于 2015-11-30 13:43:27
回答 1查看 874关注 0票数 1

我目前使用的数据自动化系统7.5下VS 2013。今天,我需要从device_vector中删除一些元素,从而决定使用remove_if。但是,不管我如何修改代码,程序只是编译得很好,但在运行时抛出"thrust::system::system_error“。

首先,我尝试了自己的代码:

代码语言:javascript
复制
int main()
{
    thrust::host_vector<int> AA(10, 1);
    thrust::sequence(AA.begin(), AA.end());
    thrust::host_vector<bool> SS(10,false);
    thrust::fill(SS.begin(), SS.begin() + 5, true);
    thrust::device_vector<int> devAA=AA;
    thrust::device_vector<bool> devSS = SS;
    thrust::device_vector<int>::iterator new_end = thrust::remove_if(thrust::device,
    devAA.begin(), devAA.end(), devSS.begin(), thrust::identity<int>());
}

但是它在运行时抛出了thrust::system::system_error。但是,如果我使用两个host_vector,即AASS来执行remove_if,那么一切都很好。

然后,我尝试了我在stackoverflow上找到的代码,Robert的答案中的代码看起来很好,但是在我的机器上,它仍然抛出thrust::system::system_error

新版本的推力有什么改变吗?还是我该试试别的办法?我正在用cmake来组织代码,有什么特别之处吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-12-02 02:52:51

问题似乎在于OP正在构建一个32位的项目。这个问题在切换到64位项目时得到了解决。

我对CUDA 7.5及以后的建议是只使用64位项目.如果您查看视窗linux上32位支持的当前状态,您会发现它是相当有限的。

纯属猜测,这个问题可能与推力问题#715有关。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34000054

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档