统计时间问题:想记录GPU核函数的计算耗时,不同方法得到的结果差别较大,暂不知何种原因
核函数:
__global__ void addKernel(int *c, const int *a, const int *b) //GPU核函数
{
int tid = blockIdx.x;
while(tid<N){
{
if(tid<N/4)
{
c[tid] = a[tid] + b[tid];
}
if(!(tid<N/4))
{