level 2
我是初学者,现在老板要我对一个项目代码性能进行测试,我测得的数据传输时间有问题,具体如下:
cudaEvent_t start , end;
cudaEventCreate(&start);
cudaEventCreate(&end);
********************************************省略若干***************
//start to record the time
cudaEventSynchronize(start);
cudaEventRecord(start,0);
cudaMemcpy(dest_h, dest_d, cmacRstLen*sizeof(float2), cudaMemcpyDeviceToHost);
cudaEventRecord(end,0);
cudaEventSynchronize(end);
********************************************省略若干***************
float msec;
cudaEventElapsedTime(&msec,start,end);
********************************************省略若干***************
该过程应该是没有问题的啊?但是求得的时间不对。
求大神指点。
2013年12月17日 05点12分
1
cudaEvent_t start , end;
cudaEventCreate(&start);
cudaEventCreate(&end);
********************************************省略若干***************
//start to record the time
cudaEventSynchronize(start);
cudaEventRecord(start,0);
cudaMemcpy(dest_h, dest_d, cmacRstLen*sizeof(float2), cudaMemcpyDeviceToHost);
cudaEventRecord(end,0);
cudaEventSynchronize(end);
********************************************省略若干***************
float msec;
cudaEventElapsedTime(&msec,start,end);
********************************************省略若干***************
该过程应该是没有问题的啊?但是求得的时间不对。
求大神指点。