From 3bafa42b1afe10aa6ab712d1d258bb079ac814ea Mon Sep 17 00:00:00 2001 From: qijun Date: Thu, 31 Aug 2017 18:08:44 +0800 Subject: [PATCH] fix tensor copyfrom bug --- paddle/framework/tensor_impl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paddle/framework/tensor_impl.h b/paddle/framework/tensor_impl.h index 7d7263b899a..7893e233b77 100644 --- a/paddle/framework/tensor_impl.h +++ b/paddle/framework/tensor_impl.h @@ -117,6 +117,8 @@ inline void Tensor::CopyFrom(const Tensor& src, memory::Copy(boost::get(dst_place), dst_ptr, boost::get(src_place), src_ptr, size, 0); } + PADDLE_ENFORCE(cudaStreamSynchronize(0), + "cudaStreamSynchronize failed in Tensor CopyFrom"); #endif } -- GitLab