How to use GPU Coder and how to better write the main function
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
HUA
el 24 de Mayo de 2024
Comentada: HUA
el 26 de Mayo de 2024
I was recently studying GPU coder to generate executables. I wrote a simple code photo.m, after generate, I did not send any valid code after the MATLAB conversion in photo.cu. Although I haven't changed the main function,such ashttps://ww2.mathworks.cn/help/coder/nvidia/ug/build-run-on-nvidia-hardware.html, this seems to have no effect on the photo.cu file.
So was my code converted successfully? Or not?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1702921/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1702926/image.png)
0 comentarios
Respuesta aceptada
Justin Hontz
el 24 de Mayo de 2024
The functions that you are using (e.g. plot) are not supported for code generation. This isn't a limitation for GPU Coder specifically, but MATLAB Coder in general. Since these function calls do not have any effect on the output(s) computed by your application, they are omitted when generating standalone code. However, when generating a MEX instead, you can still generate extrinsic calls to these functions. Please see the link below for more information:
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with GPU Coder en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!