问题
I'm trying to understand the concept of Unified Virtual Addressing (UVA) in CUDA. I have two questions:
Is there any sample (psudo)code available that demonstrates this concept?
I read in the CUDA C Programming Guide that UVA can be used only with 64 bit operating systems. Why it is so?
回答1:
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-Is there any sample (psudo)code available that demonstrate this concept?
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-Also I read in the programming guide that it is associated only with 64 bit operating system. Why it is so?
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.
来源:https://stackoverflow.com/questions/19186998/information-example-on-unified-virtual-addressing-uva-in-cuda