Does copying from gpu to host generally take longer than copying from host to gpu?

조회 수: 1 (최근 30일)
Hi,
I am using the parallel computing toolbox, and it seems like copying data to a gpu using gpuArray() generally takes much longer than copying data back to the host using gather(). For example, if I try:
A = rand(500,500, 50);
tic,
B=gpuArray(A);
toc,
tic,
gather(B);
toc,
Then the gather() takes about 0.055 seconds while the gpuArray() takes only 0.018 seconds. Is this behavior expected? Am I using the wrong method to time this?
Thanks.

채택된 답변

Jill Reese
Jill Reese 2013년 5월 16일
I think you have arrived at the same conclusion as this blog post on GPU performance. It provides a lot of detail on how to properly benchmark GPU operations in MATLAB.
  댓글 수: 1
Adam
Adam 2013년 5월 16일
Thanks for the tip! That blog is very helpful. Does anyone have any idea why the gpu to host copy should be so much slower?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by