A Guide to Using NVMEX tool

Download the nvmex tool from here, nvmex_tool.zip

The Zip file contains five files

·        nvmex.pl – copy this file to the MATLAB “bin” directory

·        nvmex_helper.m

·        nvmex.m

·        nvmexopts.bat - for MATLAB versions 2007 and up

·        nvmexopts_old.bat - for pre-2007 MATLAB versions

Invoke the nvmex command from inside MATLAB to compile .cu files

nvmex -f nvmexopts.bat sample.cu -IF:\cuda\include -LF:\cuda\lib -lcudart

Use the flags –I, -L and –l to provide additional include directories, library directories and link libraries used in the compilation process.

The sample.cu file will be compiled to the MEX file sample.mexw32