GPU coder,CUDA in MATLAB
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi All
I have used GPU coder and convert m file to CUDA code. But I could not run CUDA code.
Could you please help me how can I run it?
댓글 수: 0
답변 (1개)
Ram Kokku
2022년 10월 25일
Thanks for reaching out. Can you say more about where you want to run the generated code, with in MATLAB or outside MATLAB?
If you want to call generated CUDA code from MATLAB, you can use MEX to so. Here is an example for this : https://www.mathworks.com/help/gpucoder/gs/gpu-code-generation-the-mandelbrot-set.html
If you want to run the generated CUDA code outside MATLAB, you can generate a exe from GPU Coder by setting BuildType. Note that you may want to modify the generated main() function to your needs. This document points to steps to do that for C/C++. but steps are similar for CUDA as well. https://www.mathworks.com/help/coder/ug/standalone-c-c-executables-from-matlab-code.html.
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with GPU Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!