This needs changes to GPURuntime to expose synchronization between host
and device.
- Needs better function naming, I want a better name than
"getOrCreateManagedDeviceArray"
- DeviceAllocations is used by both the managed memory and the
non-managed memory path. This exploits the fact that the two code paths
are never run together. I'm not sure if this is the best design decision
Only use braces in case there is more than one statement.