英文:
What's the replacement for cuModuleGetSurfRef and cuModuleGetTexRef?
问题
CUDA 12 表示这两个函数已弃用:
CUresult cuModuleGetSurfRef (CUsurfref* pSurfRef, CUmodule hmod, const char* name);
CUresult cuModuleGetTexRef (CUtexref* pTexRef, CUmodule hmod, const char* name);
这两个函数用于从已加载的模块中获取表面或纹理的引用。它们已被弃用。
它们被弃用,用什么代替?模块中的表面和纹理将以不同方式访问吗?它们将完全不在模块中吗?如果是后者,如何使用CUDA驱动程序API与它们一起工作?
英文:
CUDA 12 indicates that these two functions:
CUresult cuModuleGetSurfRef (CUsurfref* pSurfRef, CUmodule hmod, const char* name);
CUresult cuModuleGetTexRef (CUtexref* pTexRef, CUmodule hmod, const char* name);
which obtain a reference to surface or a texture, respectively, from a loaded module - are deprecated.
What are they deprecated in favor of? Are surfaces and textures in modules to be accessed differently? Will they be entirely out of modules? If it's the latter, how would one work with them using the CUDA driver API?
答案1
得分: 1
根据 @talonmies 的评论,看起来 "replacement" 是 "纹理对象" 和 "表面对象"。根据 API 中明显的区别,主要是新的 "对象" 具有更少的 API 调用,这些调用包含更丰富的描述符。因此,用户自己设置字段,而不需要大量的 cuTexRefGetXXXX
和 cuTexRefSetXXXX
调用。还有 "张量映射对象",从计算能力 9.0 及更高版本开始出现。
英文:
So, based on @talonmies' comment, it seems the "replacement" are "texture objects" and "surface objects". The main difference - as far as is evident in the API - is that the new "objects" have less API calls, which take richer descriptors. Thus, the user sets fields themselves, and does not need the large number of cuTexRefGetXXXX
and cuTexRefSetXXXX
calls. There are also "tensor map objects", appearing with Compute Capability 9.0 and later.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论