Hi all, I have programmed a function to be executed at GPU using arrayfun call. I need to debug it but when I set breakpoints the program does not stop!!. How can I execute it step by step on GPU?.

 채택된 답변

Edric Ellis
Edric Ellis 2016년 12월 23일

1 개 추천

The body of an arrayfun call is run on the GPU using a translation of the MATLAB code to a native form for the GPU. This gives much better performance, but does not allow debugging. Depending on your function, you might simply be able to call the function directly with gpuArray arguments, and debug that way. I.e. replace
out = arrayfun(@myFcn, in)
with
out = myFcn(in)
Obviously, this depends on whether your function can be run in vectorised form as well as element-wise form.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 GPU Computing에 대해 자세히 알아보기

태그

질문:

2016년 12월 22일

답변:

2016년 12월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by