CUDA中统一虚拟寻址(UVA)的信息/示例 [英] Information/example on Unified Virtual Addressing (UVA) in CUDA
问题描述
我想了解CUDA中统一虚拟寻址(UVA)的概念。我有两个问题:
I'm trying to understand the concept of Unified Virtual Addressing (UVA) in CUDA. I have two questions:
-
是否有任何示例(psudo)代码演示了这个概念?
Is there any sample (psudo)code available that demonstrates this concept?
我在CUDA C编程指南中读到,UVA只能用于64位操作系统。为什么会这样?
I read in the CUDA C Programming Guide that UVA can be used only with 64 bit operating systems. Why it is so?
推荐答案
A 将指针(值)和设备代码中使用的分配映射与指针组合在一起(值)和主机代码中使用的分配映射到单个统一空间中。
A unified virtual address space combines the pointer (values) and allocation mappings used in device code with the pointer (values) and allocation mappings used in host code into a single unified space.
1 - 是否有可用的展示这个概念?
1-Is there any sample (psudo)code available that demonstrate this concept?
这个方法的一个例子是使用 cudaMemcpyDefault
转移类型说明符,代替 cudaMemcpyDeviceToHost
或 cudaMemcpyHostToDevice
在 cudaMemcpy
操作。
One example of how this may be used is in the usage of the cudaMemcpyDefault
transfer kind specifier, in place of cudaMemcpyDeviceToHost
or cudaMemcpyHostToDevice
in cudaMemcpy
operations.
2 - 该编程指南仅与64位操作系统相关。为什么会这样?
2-Also I read in the programming guide that it is associated only with 64 bit operating system. Why it is so?
32位计算机的最大可寻址空间为4 GB。在现代GPU(可能具有多吉字节的存储器)和现代PC(可能具有多吉字节的存储器和I / O空间)中,这不是方便地具有在其中定义主机和设备存储器空间的足够空间。
A 32 bit machine has a maximum addressable space of 4 Gigabytes. In modern GPUs (with perhaps multiple gigabytes of memory) and modern PCs (with perhaps multiple gigabytes of memory and I/O space) this is not conveniently enough space to have both the host and device memory spaces defined in it.
这篇关于CUDA中统一虚拟寻址(UVA)的信息/示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!