banner.gif adie's blog
主页 博客 胭脂泪,相留醉,几时重,自是人生长恨水长东
统计
日志总数: 127
评论总数: 123
日志分类
日志归档
最近日志
最近评论
订阅
rss2.gif

atom.gif

google_rss
yc.gif 【编程】 阅读 2818 次

CUDA 笔记

2020-05-08 16:02:58

1. nvcc  编译器工具 (使用 VS2017 Native X64命令行, nvcc 会调用 cl 编译器)

     -gencode arch=compute_75,code=sm_75 生成指定架构的二级制代码

     -cubin  生成 cubin 文件

     -ptx     生成 ptx 文件

2. nvprof 计时统计工具

    --metrics achiveed_ocupancy  内核占用率

    --metrics gld_throughput  内存读取效率

    --metrics gld_efficiency      全局加载吞吐量
    --metrics gld_transactions  全局内存加载效率

3. 分配设备内存: cudaMalloc/cudaFree

    拷贝: cudaMemcpy 

4. 分配不分页的主机内存:  cudaHostAlloc/cudaFreeHost/cudaHostRegister

   cudaHostAllocPortable/cudaHostRegisterPortable  分配的内存可在多个设备使用
   cudaHostAllocWriteCombined  分配的内存不使用 CPU 缓存, 可加速传输, 但在主机端读取非常慢
   cudaHostAllocMapped -> cudaHostGetDevicePointer  支持映射的内存, 零拷贝内存 

5. 流

  cudaStreamCreate
  cudaMemcpyAsync
  kernel<grid,block,0,streamid>(...)
  cudaStreamAddCallback
  cudaStreamSynchronize/cudaStreamWaitEvent/cudaSteamQuery
  cudaStreamDestroy 

6. 图

  cudaGraphCreate
  cudaGraphAddKernelNode
  cudaGraphAddDependencies

▲评论

X 正在回复:
姓 名: 留下更多信息
性 别:
邮 件:
主 页:
Q Q:
来 自:
职 业:
评 论:
验 证:


Valid HTML 4.01 Strict Valid CSS!
Copyleft.A!die Software Studio.ADSS
Power by webmaster@adintr.com