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

南昌网站建设优化自媒体短视频制作教程

南昌网站建设优化,自媒体短视频制作教程,麻章手机网站建设,网站建设从入门pdf接上篇文章#xff0c;可以发现使用CUDA提供的API进行前缀和扫描时#xff0c;第一次运行的时间不如共享内存访问#xff0c;猜测是使用到了全局内存。 首先看调用逻辑#xff1a; thrust::inclusive_scan(thrust::device, d_x, d_x N, d_x);第一个参数指定了设备#x…接上篇文章可以发现使用CUDA提供的API进行前缀和扫描时第一次运行的时间不如共享内存访问猜测是使用到了全局内存。 首先看调用逻辑 thrust::inclusive_scan(thrust::device, d_x, d_x N, d_x);第一个参数指定了设备根据实参数量和类型找到对应的函数是scan.h中的如下函数 template typename DerivedPolicy, typename InputIterator, typename OutputIterator _CCCL_HOST_DEVICE OutputIterator inclusive_scan(const thrust::detail::execution_policy_baseDerivedPolicy exec,InputIterator first,InputIterator last,OutputIterator result); 其实现位于thrust\thrust\system\cuda\detail\scan.h 注意路径可能与实际有偏差可以在/usr/local/下使用find . -name xx查找对应的文件 template typename Derived, typename InputIt, typename OutputIt _CCCL_HOST_DEVICE OutputIt inclusive_scan(thrust::cuda_cub::execution_policyDerived policy, InputIt first, InputIt last, OutputIt result) {return thrust::cuda_cub::inclusive_scan(policy, first, last, result, thrust::plus{}); }将操作指定为plus 然后执行同一文件下的此函数 template typename Derived, typename InputIt, typename OutputIt, typename ScanOp _CCCL_HOST_DEVICE OutputIt inclusive_scan(thrust::cuda_cub::execution_policyDerived policy, InputIt first, InputIt last, OutputIt result, ScanOp scan_op) {using diff_t typename thrust::iterator_traitsInputIt::difference_type;diff_t const num_items thrust::distance(first, last);return thrust::cuda_cub::inclusive_scan_n(policy, first, num_items, result, scan_op); }最终找到主要的执行逻辑 _CCCL_EXEC_CHECK_DISABLE template typename Derived, typename InputIt, typename Size, typename OutputIt, typename ScanOp _CCCL_HOST_DEVICE OutputIt inclusive_scan_n_impl(thrust::cuda_cub::execution_policyDerived policy, InputIt first, Size num_items, OutputIt result, ScanOp scan_op) {using AccumT typename thrust::iterator_traitsInputIt::value_type;using Dispatch32 cub::DispatchScanInputIt, OutputIt, ScanOp, cub::NullType, std::int32_t, AccumT;using Dispatch64 cub::DispatchScanInputIt, OutputIt, ScanOp, cub::NullType, std::int64_t, AccumT;cudaStream_t stream thrust::cuda_cub::stream(policy);cudaError_t status;// Determine temporary storage requirements:size_t tmp_size 0;{THRUST_INDEX_TYPE_DISPATCH2(status,Dispatch32::Dispatch,Dispatch64::Dispatch,num_items,(nullptr, tmp_size, first, result, scan_op, cub::NullType{}, num_items_fixed, stream));thrust::cuda_cub::throw_on_error(status,after determining tmp storage requirements for inclusive_scan);}// Run scan:{// Allocate temporary storage:thrust::detail::temporary_arraystd::uint8_t, Derived tmp{policy, tmp_size};THRUST_INDEX_TYPE_DISPATCH2(status,Dispatch32::Dispatch,Dispatch64::Dispatch,num_items,(tmp.data().get(), tmp_size, first, result, scan_op, cub::NullType{}, num_items_fixed, stream));thrust::cuda_cub::throw_on_error(status, after dispatching inclusive_scan kernel);thrust::cuda_cub::throw_on_error(thrust::cuda_cub::synchronize_optional(policy), inclusive_scan failed to synchronize);}return result num_items; }可以看到此处thrust调用了cub的Dispatchscan操作而cub中是使用全局内存的因此造成了效率还不如手动编写使用共享内存的算法。
http://www.w-s-a.com/news/555913/

相关文章:

  • 网站建设 管理系统开发仿租号网站源码网站开发
  • 怎么自己弄网站免费网站设计用什么软件
  • 网站分几种access做网站数据方法
  • 网站默认图片s001网站建设公司
  • 淘宝的电子商务网站的建设东莞哪里有网站制作公司
  • 西安网站制作怎么联系wordpress登陆界面打开慢
  • 高端工作网站网站推广seo代理
  • 一般找素材都是做哪几个网站呢推广引流工具
  • 必须做网站等级保护html网页设计题库
  • 移动端网站开发 float手机在线建网站
  • 教育网站模板下载做汽车网站开题报告的意义
  • 网站首页做后台链接昌平网站制作
  • 营销型门户网站建设浏览器下载免费大全
  • 快三网站开发推广普通话手抄报内容50字
  • 沈阳专业做网站开发公司asp网站搭建教程
  • 网站建设代码福州小程序开发平台
  • 了解做房产广告的网站手机版官方网站的建设
  • 如何与别的网站做友情链接做网站排名大概要多少钱
  • 东莞市锂电池网站建设HTML5怎么做自适应网站
  • 江苏城乡建设学校网站群晖建立wordpress
  • wordpress导入网站模板seo自学网官网
  • 购物网站服务器带宽北京网站开发周期
  • 同性做视频网站网站怎么添加栏目
  • 新余网站设计seo自学网站
  • 新乡个人网站建设价格wordpress数据插件
  • 你是网站设计有限公司的项目经理网站推广的重要性
  • 网站定制开发怎么写泸州设计公司有哪些
  • 上海网站建设zj kt迅速编程做网站
  • 郑州服装 网站建设网站栏目合理性
  • 平面设计在线网站最新汽油价格调整最新消息