使用 nvprof 分析 CUDA 程序。
我再次发布问题。
与nvprof --events tex0_cache_sector_queries --replay-mode kernel ./matrixMul
,
或 nvprof --events tex0_cache_sector_queries --replay-mode application ./matrixMul
,
我们可以收集事件值结果:
==40013== Profiling application: ./matrixMul
==40013== Profiling result:
==40013== Event result:
"Device","Kernel","Invocations","Event Name","Min","Max","Avg","Total"
"Tesla K80 (0)","void matrixMulCUDA<int=32>(float*, float*, float*, int, int)",301,"tex0_cache_sector_queries",0,30,24,7224
以上结果为总结。内核函数matrixMulCUDA调用tex0_cache_sector_queries的301次调用值。它只有 301 次调用的min, max, avg, 总值,即汇总结果。
我想从每次调用 matrixMulCUDA 时收集完整的 301 次 tex0_cache_sector_queries 值。另一方面,每次调用内核函数 matrixMulCUDA 时,我都想收集 tex0_cache_sector_queries 事件值。如何收集?