How to fast compile GPU coder application after making a minor change in main.cu?
조회 수: 1 (최근 30일)
이전 댓글 표시
I use GPU coder to compile Deep Learning based application. But, I made a slight change in main.cu (mainly in the file management and reading part). I then want to recompile the GPU coder application. but it takes so long to repeat converting deep learning models to cuda codes. Is there an easy way to recompile the GPU coder application faster?
댓글 수: 0
답변 (1개)
Hariprasad Ravishankar
2022년 12월 21일
If you generated an EXE by specifying main.cu as CustomSource similar to the example here, then you can can rebuild the executable by running make on the generated <entrypoint_function>_rtw.mk.
For example, if your entry point function is foo.m, you should see a file named foo_rtw.mk in the codegen folder on Linux devices.
You can then execute
make -f foo_rtw.mk
from the linux terminal by 'cd'ing to the codegen folder or from within MATLAB as follows:
!make -f foo_rtw.mk
On Windows, there is an equivalent "batch" file with the '.bat' extension that you can run to rebuild the files.
If you generated a DLL or LIB using the coder.gpuConfig, then you likely have a custom makefile to link to the library generated by coder. In that case you will need to remake your custom makefile.
Hari
댓글 수: 6
Hariprasad Ravishankar
2022년 12월 26일
On Windows, you can execute the batch file from within the codegen folder as follows:
>> system('<entryPointFcn>_rtw.bat');
For example, if the function you generated code for was named 'foo', then the batch file would be named 'foo_rtw.bat'.
참고 항목
카테고리
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!