Modified code examples for book Suh, Kim: Accelerating MATLAB with GPU Computing: A Primer with Examples.
In the official implementation (download), codes are organized and compiled in a pipeline as below:
-
include
*.hin.*cuand*.cpp -
run
nvcc -c *.cuin cmd ->*.obj -
mex *.cpp *.obj -lcudart -L".../lib/x64"->*.mexw64 -
call the mex executable through
*.m
However, in this repo, all CUDA codes are integrated into one *.cu file and can be straightforward compiled via:
(CUDA accelerated function)
mexcuda *.cu
or (C++ implemented function)
mex *.cpp