小编use*_*067的帖子

Thrust是同步还是异步?

我是新手使用Thrust,有一件事我不明白.Thrust是异步还是同步?

如果我写下面的代码,所用的时间不是0.但在其他标签中,其他用户报告的结果0.真相是什么?

clock_t start,end;

start=clock(); 
thrust::sort_by_key(vettore.begin(), vettore.end(), counter.begin()); 

end=clock();

double time=((double)(end-start))/CLOCKS_PER_SEC; 

cout<<"execution time"<<time<<endl;// the result is 0.327
Run Code Online (Sandbox Code Playgroud)

cuda thrust

5
推荐指数
1
解决办法
1646
查看次数

标签 统计

cuda ×1

thrust ×1