cuda10+ 中 uint2 和 uint64_t 之间是否存在性能/存储差异?
我正在尝试优化 A100 GPU(安培代)的一段代码,现在我们使用 uint64_t,但我看到在一些 cuda 代码中使用了 uint2 数据类型。 uint2 在寄存器使用方面有优势吗?我知道 64 位寄存器的数量有限,uint2 是否将 x,y 整数拆分到 32 位寄存器中以获得更好的占用?我找不到有关这些数据类型的寄存器存储的任何具体信息,因此任何指向其文档的链接将不胜感激。
I'm trying to optimize a piece of code for A100 GPUs (ampere gen), right now we use uint64_t but I am seeing uint2 datatypes being used instead in some cuda code. Does the uint2 offer advantages for register usage? I know there are a limited number of 64-bit registers, does uint2 split the x,y ints across 32-bit registers for better occupancy? I couldn't find any specific information about register storage with these datatypes so any links to documentation for it would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不。
。极其有限,即零。据我所知,任何 CUDA 兼容 GPU 中都没有 64 位寄存器。当编译器遇到 64 位类型时,它将由两个相邻的 32 位寄存器组合而成。
不会。所有 CUDA 内置向量类型的存在都是为了内存带宽优化(PTX 中有向量加载/存储指令)以及与纹理/表面硬件的兼容性,纹理/表面硬件可以对其中一些类型进行过滤,这可以更好地表现。
No.
Indeed. Extremely limited, i.e. zero. There are no 64 bit registers in any CUDA compatible GPU I am aware of. When the compiler encounters a 64-bit type, it composites it from two adjacent 32-bit registers.
No. All the CUDA built-in vector types exist for memory bandwidth optimization (there are vector load/store instructions in PTX) and for compatibility with the texture/surface hardware which can do filtering on some of those types, which can be better for performance.