CPU下的计时与GPU计时对比
来源:互联网 发布:centos git ssh配置 编辑:程序博客网 时间:2024/05/16 18:29
1.CPU下:使用clock_t统计时间
clock_t start;clock_t end;start=clock();filter2D (outimage,B,-1,fx);//这是要统计时间的函数end=clock();double time=(double)(end-start)/CLOCKS_PER_SEC;printf("\n");cout<<"原函数 filter2D 的执行时间 is: "<<time*1000<<"ms"<<endl;
- GPU下:使用cudaEventCreate统计时间
cudaEventCreate(&start);cudaEventCreate(&stop);cudaEventRecord(start,0);kernel_filter2D<<<grid, block>>>(width,height,byteCount,d_src_imgbuf,d_filter2D_imgbuf);cudaEventRecord(stop, 0);cudaEventSynchronize(start);cudaEventSynchronize(stop);cudaEventElapsedTime(&time,start,stop);cudaEventDestroy(start);cudaEventDestroy(stop);printf("GPU下 filter2D 的执行时间:%f(ms)\n",time);
阅读全文
0 0
- CPU下的计时与GPU计时对比
- Linux下的计时
- 计时
- 计时
- 计时
- 计时
- 计时
- Linux下的计时函数
- Window下的时间计时
- Linux下Shell的计时
- linux的时间与计时
- GPU与CPU对比测试
- CPU与GPU的内存带宽对比(CPU vs CUDA GPU memory bandwidth)
- GPU与CPU版本的矩阵乘法对比
- GPU与CPU版本的矩阵乘法对比
- 快速排序与堆排序效率对比(TimeSpan计时)
- windows下的精确计时函数
- Linux平台多线程下的计时
- Qt中QThread线程与主线程的数据传送以及lineEdit的显示
- am命令基本知识
- ==和equals的区别
- TensorFlow实战:Chapter-5(CNN-3-经典卷积神经网络(GoogleNet))
- 执行Class.forName 报错 com.mysql.jdbc.Driverjava.lang.NullPointerException
- CPU下的计时与GPU计时对比
- 对nginx学习记录
- 交叉编译工具链的构建原理
- New Year and Days
- python基础第二篇
- Android插件化与其构建流程
- SQL-SERVER2008 存储过程-子过程回滚
- MySql错误:[Err] 1292
- POJ 1258 Agri-Net(最小生成树-Prim)