Child pages
  • Hyak MATLAB GPU
Skip to end of metadata
Go to start of metadata

 

This will only work if your group owns a GPU node.

See below link for how to get a GPU node:

 Mox_gpu

module load matlab_2015b

matlab

%allocate matrix X on the CPU

X=rand(1000,1000);

%send the matrix X to a matrix G on the GPU

G = gpuArray(X);

%multiply G by G on the GPU. S is a matrix on the GPU.

S = G*G;

% Get the result S back to the CPU. Y is a matrix on the CPU.

Y = gather(S);

More details are at below links

https://www.mathworks.com/help/distcomp/gpu-computing.html

https://www.mathworks.com/help/distcomp/gpu-computing-in-matlab.html

https://www.mathworks.com/help/distcomp/run-built-in-functions-on-a-gpu.html

 

  • No labels