필터 지우기
필터 지우기

Asynchronous GPU calculations

조회 수: 1 (최근 30일)
Gunnar Läthén
Gunnar Läthén 2012년 4월 17일
In the latest release, GPU calls execute asynchronously to the CPU. But do also GPU calls themselves run asynchronously? I.e. does multiple calls using e.g. feval(CUDA_kernel, ...) execute at the same time, or does the GPU wait for subsequent calls to finish? Does one need to impose wait() between feval to guarantee that the calls execute in order on the GPU? Experimental tests indicate that wait() is not needed, but it would be nice with a proper guarantee.

채택된 답변

Edric Ellis
Edric Ellis 2012년 4월 17일
The asynchronous nature of the kernel invocations should be completely transparent in terms of functionality (if it isn't, then that would be a bug), the "wait()" is required only when attempting to get timings for portions of code.
  댓글 수: 2
Gunnar Läthén
Gunnar Läthén 2012년 4월 17일
Ok, so then I can expect that my feval(CUDA_kernel, ...) calls get executed in order? To be more precise, the following code will be executed "properly" ?
A = feval(kernel, ...);
B = feval(kernel, A, ...);
C = feval(kernel, B, ...);
Also, if I add:
D = gather(C);
Will the gather() call wait for the last GPU evaluation to complete?
Thanks for your input!
Jill Reese
Jill Reese 2012년 4월 17일
Yes, this code will be executed properly. And gather does wait for the variable it is transferring to be completely evaluated before the transfer starts.

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

추가 답변 (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