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

如何做竞价网站数据监控云主机免费

如何做竞价网站数据监控,云主机免费,做网站需要交接什么,wordpress商城插件收费接上篇文章,可以发现使用CUDA提供的API进行前缀和扫描时,第一次运行的时间不如共享内存访问,猜测是使用到了全局内存。 首先看调用逻辑: 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_base<DerivedPolicy>& 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_policy<Derived>& 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_policy<Derived>& policy, InputIt first, InputIt last, OutputIt result, ScanOp scan_op)
{using diff_t           = typename thrust::iterator_traits<InputIt>::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_policy<Derived>& policy, InputIt first, Size num_items, OutputIt result, ScanOp scan_op)
{using AccumT     = typename thrust::iterator_traits<InputIt>::value_type;using Dispatch32 = cub::DispatchScan<InputIt, OutputIt, ScanOp, cub::NullType, std::int32_t, AccumT>;using Dispatch64 = cub::DispatchScan<InputIt, 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_array<std::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.yayakq.cn/news/744258/

相关文章:

  • 网站建设创意文案百度安装应用
  • 网站建设进度及实施过程礼品网站建设公司
  • 优秀的定制网站建设制作商wordpress 新建数据库
  • 网站建设流js做网站跳转
  • 河北中冶润丰建设股份有限公司网站网站方案制作
  • 盘锦网站建设多少钱网站内容页301如何做
  • 临沂营销型网站建设wordpress 4.7
  • 外贸移动端网站模板wordpress 标签链接
  • 个人网站免费域名竞价培训班
  • 深圳网站优化效果温岭高端网站设计哪家好
  • 企业网站源码带后台管理众筹网站建设费用
  • 衡阳市做网站百度推广外包
  • 销售行业怎样做网站网站备案和不备案的区别
  • 南宁网站建设策划外包宁国做网站的
  • 个人建设任务网站门户网站建设方案中信息公开
  • 网站建设就找桥三科技网站建设参考文献作者
  • 工业和信息化部网站备案永兴县网站建设推广公司
  • 哪个网站的课件做的好石景山网站建设公司排行
  • 做网站的手机软件宁波电商网站建设开发
  • 成都装饰公司网站建设海外平台有哪些
  • 有关网站开发的创意手机英文网站大全
  • 建筑工地网站网站制作目标及要求
  • 企业网站销售电商会学着做网站呢
  • 做网站制作一般多少钱腾讯云可以做网站
  • 网站维护哪些贵阳seo网站推广
  • 部队网站模板开发公司五证
  • 男周志做网站完全自定义纯代码打造你的wordpress站点侧边栏
  • 建设银行联号查询网站学字体网站
  • 免费手机端网站模板下载安装公众号wordpress
  • 电商平台网站建设策划书做商品抬价是什么兼职网站