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?
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.
One example of how this may be used is in the usage of the
cudaMemcpyDefault
transfer kind specifier, in place ofcudaMemcpyDeviceToHost
orcudaMemcpyHostToDevice
incudaMemcpy
operations.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.