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?.

 Risposta accettata

Edric Ellis
Edric Ellis il 23 Dic 2016
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.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by