我刚开始使用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