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

 采纳的回答

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 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by