Skip to content

Conversation

JiayiFeng
Copy link
Collaborator

@JiayiFeng JiayiFeng commented May 4, 2018

Correct misusing of TensorCopy in following ops or op tests:

concat_test
sequence_padding_test
multiplex_op
sequence_slice_op
lod_reset_op

@JiayiFeng JiayiFeng requested review from chengduoZH and reyoung May 4, 2018 10:18
Copy link
Contributor

@chengduoZH chengduoZH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we replace cudaMalloc with cudaMallocHost, the memory::Copy should have sync and async operation respectively, because someplace call memory::Copy directly. For example

memory::Copy(dst_place, dst_ptr,
boost::get<platform::CPUPlace>(src.place()), src_ptr, size);

@JiayiFeng
Copy link
Collaborator Author

In current design, memcpy takes an cudaStream_t argument. If this argument is nullptr, the memcpy will be synchronous. @chengduoZH

Copy link
Contributor

@chengduoZH chengduoZH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@JiayiFeng JiayiFeng merged commit b708ec0 into PaddlePaddle:develop May 7, 2018
@JiayiFeng JiayiFeng deleted the correct_TensorCopy_misuse branch May 7, 2018 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants