フィルターのクリア

Error for Scripts on GPU

1 回表示 (過去 30 日間)
Maxime Rivard
Maxime Rivard 2019 年 9 月 12 日
回答済み: Rajani Mishra 2020 年 2 月 10 日
Hi,
I am building a function, and calling it with on gpu with @arrayfun(). That function calls another function inside of it, and I get this error: ''Error using gpuArray/arrayfun. Scripts are not supported on the GPU.''
But I have done it in the past and it works fine (Below, computeNewDelta() is a function I made, that I call)... What is my problem?
function [count,Zn]=computeMandelbrotIterationsByDeltaForImage(orbit,Xdelta0,Ydelta0,iteration)
refOrbitX=gpuArray(real(orbit));
refOrbitY=gpuArray(imag(orbit));
maxIterations=iteration;
function [count,Zn] = innerCompute(dx0,dy0)
deltaX = dx0;
deltaY = dy0;
count = 1;
Xn = refOrbitX(1,1)+deltaX;
Yn = refOrbitY(1,1)+deltaY;
while ( (Xn*Xn+Yn*Yn) < 10000 && count <= maxIterations )
Xn = refOrbitX(count,1)+deltaX;
Yn = refOrbitY(count,1)+deltaY;
[deltaX,deltaY] = computeNewDelta(Xn,deltaX,Yn,deltaY,dx0,dy0);
count = count + 1;
end
Zn=complex(Xn,Yn);
end
[count,Zn] = arrayfun( @innerCompute,Xdelta0,Ydelta0);
end

回答 (1 件)

Rajani Mishra
Rajani Mishra 2020 年 2 月 10 日
Possibly the cause for the error: “Error using gpuArray/arrayfun. Scripts are not supported on the GPU. is that not all the functions used in your script are GPU supported. Please check that the functions using gpuArrays as input arguments are GPU supported. You can refer to the following link for more information:

カテゴリ

Help Center および File ExchangeGPU Computing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by