MATLAB Answers

how to rum m file with GPU

5 views (last 30 days)
hello guys i am asking for how to active the GPU to run the m file faster
what the i can do

Accepted Answer

Walter Roberson
Walter Roberson on 22 Jul 2020
You cannot do that. When MATLAB talks to the GPU, it mostly does so in terms of a bunch a specialized pre-compiled code kernels (that are in the binary programming language of the GPUs.) The GPU does not run MATLAB code, only the pre-compiled snippets.
You can do some processing on GPU by using GPU Coder product; but do not expect it to handle MATLAB code in general.
Walter Roberson
Walter Roberson on 22 Jul 2020
I wouldn't say that "the GPU does not run MATLAB code".
I would say it without hesitation, just as I would say that Intel x64 architecture chips do no run C code. The code has to be compiled to run on the target, with the instructions generally not even in the same order as implied by the original code.
gpuArray support is only available for the operations Mathworks has already pre-built GPU support for. Anything beyond that requires GPU Coder product.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!