当前位置: 首页 > news >正文

网站的广度美容会所网站模板下载

网站的广度,美容会所网站模板下载,wordpress教程视频 下载地址,免费建站系统哪个好用吗为了测试GPU函数的耗时#xff0c;可以使用 CUDA 提供的计时功能#xff1a;cudaEventCreate, cudaEventRecord, 和 cudaEventElapsedTime。这些函数可以帮助你测量某个 CUDA 操作#xff08;如设置设备#xff09;所花费的时间。 一、记录耗时案例 以下是一个示例程序可以使用 CUDA 提供的计时功能cudaEventCreate, cudaEventRecord, 和 cudaEventElapsedTime。这些函数可以帮助你测量某个 CUDA 操作如设置设备所花费的时间。 一、记录耗时案例 以下是一个示例程序它测量调用 cudaSetDevice 所花费的时间 #include iostream #include vector #include cuda_runtime.h__global__ void dummyKernel() {// Dummy kernel to ensure CUDA context is initialized }int main() {// CUDA device IDsint device1 0;int numIterations 10; // Number of times to call cudaSetDevice// Create CUDA eventscudaEvent_t start, stop;cudaEventCreate(start);cudaEventCreate(stop);// Vector to store elapsed timesstd::vectorfloat elapsedTimes(numIterations);// Set initial device (optional, but ensures a known starting state)cudaSetDevice(device1);// Measure time for multiple cudaSetDevice callsfor (int i 0; i numIterations; i) {// Record the start eventcudaEventRecord(start, 0);// Set the device (this is the operation we are timing)cudaSetDevice(device1);// Record the stop eventcudaEventRecord(stop, 0);// Measure the elapsed time between the start and stop eventscudaEventElapsedTime(elapsedTimes[i], start, stop);// Output resultsstd::cout Number of iterations: i i std::endl;std::cout time to set device device1 : elapsedTimes[i] ms std::endl;}// Calculate statistics (e.g., average time)float totalTime 0.0f;for (float time : elapsedTimes) {totalTime time;}float averageTime totalTime / numIterations;// Output resultsstd::cout Number of iterations: numIterations std::endl;std::cout Average time to set device device1 : averageTime ms std::endl;// Optionally, run a dummy kernel to ensure CUDA is initialized and readydummyKernel1, 1();cudaDeviceSynchronize();// Clean upcudaEventDestroy(start);cudaEventDestroy(stop);return 0; } 二、编译和运行 2.1 编译: 使用 nvcc 编译这个 CUDA 程序。上面程序文件铭为test_cudaSetDevice_multiple.cu nvcc -o test_cudaSetDevice_multiple test_cudaSetDevice_multiple.cu 2.2 运行: 然后运行生成的可执行文件。 ./test_cudaSetDevice_multiple 哈哈哈就得到运行结果啦
http://www.tj-hxxt.cn/news/225367.html

相关文章:

  • 网站建设朋友圈wordpress如何做成app
  • 自己如何注册一个网站潘家园做网站的公司
  • 网站里的动态是如何制作番禺人才网单位招考
  • word做招聘网站外汇平台网站开发需求说明
  • 网站建设与管理教学设计扬州招标工程建设信息网
  • 本地电脑做视频网站 外网连接不上聚企360做的网站
  • 企业网站主要有哪四种类型服装网站建设的目的
  • 建站模板系统企业网站可以个人备案
  • 网站的打开速度有域名怎么发布网站吗
  • 石油大学 网页设计与网站建设诸暨市建设局网站
  • 外链网站推荐几个直播策划方案范文
  • 各行各业网站建设新泰高品质网站建设
  • 做网站软件ps旅游前 做攻略有什么网站好用
  • 私人建设网站好业宝微商城
  • 合肥网站搭建公司哪家好pc端软件下载
  • 南宁企业建站程序低代码开发平台 开源
  • 企业局域网做网站屏蔽用illustrator做网站
  • 网站建设建议药类网站整站模板下载
  • 如何建立自己音乐网站潍坊网站建设咨询
  • 开发一个个人网站高清视频网络服务器免费
  • jsp网站建立微信公众号运营大学
  • 医院网站模板下载北京广告公司地址
  • 网站风险怎么解决方案两当网站建设
  • 牡丹江建设网站呼和浩特市城乡建设保障局网站
  • 免费做网站手机模板网站建设+百度
  • 做电影网站视频放在那里做网站用那种数据库
  • 杭州 做网站沈阳男科医院去哪里
  • 网页源码怎么做网站庆阳网红宝军
  • 互联网推广销售好做吗官网关键词优化价格
  • 网站建设合同中英文网站建设 网站优化