Functions | |
cudaError_t | cudaPointerGetAttributes (struct cudaPointerAttributes *attributes, void *ptr) |
Returns attributes about a specified pointer. |
Unified addressing is automatically enabled in 64-bit processes on devices with compute capability greater than or equal to 2.0.
Unified addressing is not yet supported on Windows Vista or Windows 7 for devices that do not use the TCC driver model.
Because pointers are unique, it is not necessary to specify information about the pointers specified to cudaMemcpy() and other copy functions. The copy direction cudaMemcpyDefault may be used to specify that the CUDA runtime should infer the location of the pointer from its value.
The pointer value through which allocated host memory may be accessed in kernels on all devices that support unified addressing is the same as the pointer value through which that memory is accessed on the host. It is not necessary to call cudaHostGetDevicePointer() to get the device pointer for these allocations.
Note that this is not the case for memory allocated using the flag cudaHostAllocWriteCombined, as discussed below.
Upon enabling direct access from a device that supports unified addressing to another peer device that supports unified addressing using cudaDeviceEnablePeerAccess() all memory allocated in the peer device using cudaMalloc() and cudaMallocPitch() will immediately be accessible by the current device. The device pointer value through which any peer's memory may be accessed in the current device is the same pointer value through which that memory may be accessed from the peer device.
This device address may be queried using cudaHostGetDevicePointer() when a device using unified addressing is current. Either the host or the unified device pointer value may be used to refer to this memory in cudaMemcpy() and similar functions using the cudaMemcpyDefault memory direction.