CUDA:零拷贝主机内存
2024-09-01 16:56:46
The easy way to achieve copy/compute overlap!
1.Enable Host Mapping*
Runtime: cudaSetDeviceFlags() with cudaDeviceMapHost flag
Driver : cuCtxCreate() with CU_CTX_MAP_HOST
2.Allocate pinned CPU memory
Runtime: cudaHostAlloc(), use cudaHostAllocMapped flag
Driver : cuMemHostAlloc()use CUDA_MEMHOSTALLOC_DEVICEMAP
3.Get a CUDA device pointer to this memory
Runtime: cudaHostGetDevicePointer()
Driver : cuMemHostGetDevicePointer()
4.Just use that pointer in your kernels!
Zero-Copy Guidlines
•Data is transferred over the PCIe bus automatically, but it’s slow
•Use when data is only read/written once
•Use for very small amounts of data (new variables, CPU/GPU communication)
•Use when compute/memory ratio is very high and occupancy is high, so latency over PCIe is hidden
•Coalescing is critically important!
最新文章
- 【DP】HIHO 1078
- chrome浏览器插件的开启快捷键
- 从体系架构上分析PRINCE2和pmp的区别
- Angularjs 跳转页面并传递参数的方法总结
- sizeof进行结构体大小的判断
- vsphere平台windows虚拟机克隆的小插曲
- Eclipse中使用Junit编写测试用例
- 完美隐藏win7文件和文件夹
- Mysql多表查询(两张独立表,一张关系表)
- [FileStream] 使用
- Linux系统中如何添加自己的库文件路径
- Huffman 压缩和解压缩java实现
- 解callback嵌套
- ECMAScript 6 笔记(五)
- 如何选择适合的前端UI框架
- Python机器学习:5.6 使用核PCA进行非线性映射
- C++ 中 auto 与 decltype 的用法与区别
- mysql----------mysql的一些常用命令
- Spring切面编程实践【原创】
- ubuntu使用squid搭建代理
热门文章
- Delphi中@,^,#,$分别表示什么?
- VS2010 MFC中 给菜单项添加消息响应函数
- 传输层:TCP 协议
- foreach_break 面试记录
- 【前端阅读】——《活用PHP、MySQL建构Web世界》摘记之设计技巧
- 2017.2.16 开涛shiro教程-第十七章-OAuth2集成(二)客户端
- 2017.2.7 开涛shiro教程-第六章-Realm及相关对象(一)
- BZOJ 1878 SDOI2009 HH的项链 树状数组/莫队算法
- 手机APP自动化持续集成方案
- Codeforces Round #277.5 (Div. 2)(C题)