CUDA / PTX 32位与64位 [英] CUDA/PTX 32-bit vs. 64-bit

查看:294
本文介绍了CUDA / PTX 32位与64位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CUDA编译器具有生成32位或64位PTX的选项。这些之间有什么区别?是否喜欢x86,NVidia GPU实际上有32位和64位ISA?

CUDA compilers have options for producing 32-bit or 64-bit PTX. What is the difference between these? Is it like for x86, NVidia GPUs actually have 32-bit and 64-bit ISAs? Or is it related to host code only?

推荐答案

指针肯定是最明显的区别。 64位机器型号启用64位指针。 64位指针支持多种功能,例如大于4GB的地址空间,统一虚拟寻址。统一虚拟寻址又启用其他功能,例如 GPUDirect对等-Peer CUDA IPC API 也取决于64位机器型号。

Pointers are certainly the most obvious difference. 64 bit machine model enables 64-bit pointers. 64 bit pointers enable a variety of things, such as address spaces larger than 4GB, and unified virtual addressing. Unified virtual addressing in turn enables other things, such as GPUDirect Peer-to-Peer. The CUDA IPC API also depends on 64 bit machine model.

x64 ISA与x86 ISA不是完全不同的,它大多是它的扩展。熟悉x86 ISA的人会发现x64 ISA熟悉,在需要时可以自然扩展64位。同样,64位机器模型是PTX ISA到64位的能力的扩展。

The x64 ISA is not completely different than the x86 ISA, it's mostly an extension of it. Those familiar with the x86 ISA will find the x64 ISA familiar, with natural extensions for 64-bits where needed. Likewise 64 bit machine model is an extension of the capabilities of the PTX ISA to 64-bits. Most PTX instructions work exactly the same way.

32位机器模型可以处理64位数据类型(例如 double long long ),因此经常不需要对正确编写的CUDA C / C ++源代码进行任何更改以编译32位机器型号或64位机器模型。如果您直接在PTX中编程,您可能需要考虑指针大小差异

32 bit machine model can handle 64 bit data types (such as double and long long), so frequently there don't need to be any changes to properly written CUDA C/C++ source code to compile for 32 bit machine model or 64 bit machine model. If you program directly in PTX, you may have to account for the pointer size differences, at least.

这篇关于CUDA / PTX 32位与64位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆