[CUDA,OpenCL] Simplify the copying code

7 jobs for blocks-in-ram in 56 minutes and 19 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #180208032
build-clang-cuda

00:02:54

passed #180208033
build-clang-nocuda

00:01:26

passed #180208030
build-gcc-cuda

00:02:38

passed #180208031
build-gcc-nocuda

00:01:38

passed #180208034
update-pocl

00:01:50

 
  Test
passed #180208036
test-clang-nocuda

00:52:11

passed #180208035
test-gcc-nocuda

00:53:24