Arrays for multidimensional function evaluation on grid.
X = gpuNdgrid(x, y)
[X Y] = gpuNdgrid(x, y)
Can be :
Pointer on the vector stored in device memory (GPU).
Pointer on the vector stored in host memory (CPU).
Matrix of size x by y, stored in GPU memory.
gpuNdgrid
is the GPU implementation of Scilab ndgrid function,
but work only on 2D.
x = 1:9; dx = gpuSetData(x); y = 1:5; dy = gpuSetData(y); [dX dY] = gpuNdgrid(dx,dy); gpuGetData(dX) gpuGetData(dY) [X Y] = ndgrid(x,y) clear dx; clear dy; clear dX; clear dY; | ![]() | ![]() |