From 527c85970bcc16fae2598f984baa6d648fde4052 Mon Sep 17 00:00:00 2001 From: liaogang Date: Wed, 19 Jul 2017 22:51:27 +0800 Subject: [PATCH] Fix H2D and D2H order --- paddle/memory/memory.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/memory/memory.cc b/paddle/memory/memory.cc index 5c7b3bb15e..67d2ae1bbd 100644 --- a/paddle/memory/memory.cc +++ b/paddle/memory/memory.cc @@ -88,7 +88,7 @@ void Copy(platform::CPUPlace, void* dst, platform::GPUPlace, const void* src, size_t num, cudaStream_t stream) { - platform::GpuMemcpyAsync(dst, src, num, cudaMemcpyHostToDevice, stream); + platform::GpuMemcpyAsync(dst, src, num, cudaMemcpyDeviceToHost, stream); } template <> @@ -96,7 +96,7 @@ void Copy(platform::GPUPlace, void* dst, platform::CPUPlace, const void* src, size_t num, cudaStream_t stream) { - platform::GpuMemcpyAsync(dst, src, num, cudaMemcpyDeviceToHost, stream); + platform::GpuMemcpyAsync(dst, src, num, cudaMemcpyHostToDevice, stream); } template <> -- GitLab