Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 CUarray,它是通过 cuGraphicsSubResourceGetMappedArray() 从我的 OpenGL 上下文中获得的。是否可以将它与 cuMemset*() 一起使用?
没有。您无法将设备指针放入 CUDA 数组(传递给 cuMemset*()),并且 NVIDIA 从未为 CUDA 数组提供 memset 函数。
您必须将一些主机内存清零并在 CUDA 数组中执行 memcpy(或 memcpy),或者(如果您的应用程序仅在 SM 2.0 或更高版本上运行)使用表面存储自行滚动。