BVLC/caffe — pull request #555 by shelhamer (2014-06-28 01:52:24+00:00)
Title: Switch to Unified Virtual Address memory copies

CUDA [Unified Virtual Addressing](http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#unified-virtual-address-space) makes host-device, device-host, and device-device communication transparent by distinguishing the cases through virtual addresses of the pointers. Switching to this mode is intended as a useful abstraction for parallelism so that blob data can be transferred by the same interface regardless of source and destination.

Here all `cudaMemcpy` calls are switched to `cudaMemcpyDefault` mode used by virtual addressing.

A counter-argument is that this makes host / device communication less explicit and perhaps confusing. However, the pointers and our practice of `{cpu,gpu}` prefixes keep this clear. Provided we continue in the direction of device abstraction, needing to explicitly reference cpu or gpu operation should go away on its own with the exception of data layers and future host / device parallelism.

Follow-up question: should all `memcpy` be replaced with `caffe_copy` (in its cpu / gpu variations)?