Guest User

mexcuda gpu options file

a guest
Mar 15th, 2017
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.09 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!-- Copyright 2016 The MathWorks, Inc. -->
  3. <!-- CUDA MEX options for MSVC 2015 -->
  4. <config
  5. Name="NVIDIA CUDA Compiler"
  6. ShortName="nvcc"
  7. HostCompiler="MSVCPP140"
  8. Manufacturer="NVIDIA"
  9. Version="8.0"
  10. Language="CUDA"
  11. Priority="A"
  12. Location="$NVCC" >
  13. <Details
  14. CompilerExecutable="$COMPILER"
  15. CompilerDefines="$COMPDEFINES"
  16. CompilerFlags="$COMPFLAGS"
  17. OptimizationFlags="$OPTIMFLAGS"
  18. DebugFlags="$DEBUGFLAGS"
  19. IncludeFlags="$INCLUDE"
  20. LinkerExecutable="$LINKER"
  21. LinkerFlags="$LINKFLAGS $LINKTYPE"
  22. LinkerLibraries="$LINKLIBS"
  23. LinkerDebugFlags="$LINKDEBUGFLAGS"
  24. LinkerOptimizationFlags="$LINKOPTIMFLAGS"
  25. CommandLineShell="$VCVARSALLDIR\VCVARSALL.BAT "
  26. CommandLineShellArg="amd64"
  27. CompilerDefineFormatter="--compiler-options=/D%s"
  28. LinkerLibrarySwitchFormatter="lib%s.lib;%s.lib"
  29. LinkerPathFormatter="/LIBPATH:%s"
  30. LibrarySearchPath="$$LIB;$$LIBPATH;$$PATH;$$INCLUDE;$MATLABROOT\extern\lib\$ARCH\microsoft"
  31. />
  32. <!-- Switch guide: http://msdn.microsoft.com/en-us/library/fwkeyyhe(v=vs.71).aspx -->
  33. <!-- Note: "&& echo XXXX > NUL" on CMDLINE is ignored by OS and is present to help MEX identify compile and link stages -->
  34. <vars
  35. CMDLINE100="$COMPILER -c $COMPFLAGS $OPTIM $COMPDEFINES $INCLUDE $SRC -o $OBJ && echo /Fo > NUL"
  36. CMDLINE200="$LINKER $LINKFLAGS $LINKTYPE $LINKOPTIM $LINKEXPORTVER $OBJS $LINKLIBS /out:$EXE"
  37. CMDLINE250="mt -outputresource:$EXE;2 -manifest $MANIFEST"
  38. CMDLINE300="del $EXP $LIB $MANIFEST $ILK"
  39.  
  40. COMPILER="nvcc"
  41. COMPFLAGS="--compiler-options=/Zp8,/GR,/W3,/EHs,/nologo,/MD $ARCHFLAGS"
  42. ARCHFLAGS="-gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=&#92;&quot;sm_60,compute_60&#92;&quot; $NVCC_FLAGS"
  43. COMPDEFINES="--compiler-options=/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,$MATLABMEX"
  44. MATLABMEX="/DMATLAB_MEX_FILE"
  45. OPTIMFLAGS="--compiler-options=/O2,/Oy-,/DNDEBUG"
  46. INCLUDE="-I&quot;$MATLABROOT\extern\include&quot; -I&quot;$MATLABROOT\simulink\include&quot;"
  47. DEBUGFLAGS="--compiler-options=/Z7"
  48.  
  49. LINKER="link"
  50. LINKFLAGS="/nologo /manifest "
  51. LINKTYPE="/DLL"
  52. LINKEXPORT="/EXPORT:mexFunction"
  53. LINKEXPORTVER="/EXPORT:mexFunction /EXPORT:mexfilerequiredapiversion"
  54. LINKLIBS="/LIBPATH:&quot;$MATLABROOT\extern\lib\$ARCH\microsoft&quot; libmx.lib libmex.lib libmat.lib gpu.lib cudart.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
  55. LINKDEBUGFLAGS="/debug /PDB:&quot;$TEMPNAME$LDEXT.pdb&quot;"
  56. LINKOPTIMFLAGS=""
  57.  
  58. OBJEXT=".obj"
  59. LDEXT=".mexw64"
  60. SETENV="set COMPILER=$COMPILER
  61. set COMPFLAGS=/c $COMPFLAGS $COMPDEFINES $MATLABMEX
  62. set OPTIMFLAGS=$OPTIMFLAGS
  63. set DEBUGFLAGS=$DEBUGFLAGS
  64. set LINKER=$LINKER
  65. set LINKFLAGS=$LINKFLAGS /export:%ENTRYPOINT% $LINKTYPE $LINKLIBS $LINKEXPORT
  66. set LINKDEBUGFLAGS=/debug /PDB:&quot;%OUTDIR%%MEX_NAME%$LDEXT.pdb&quot;
  67. set NAME_OUTPUT=/out:&quot;%OUTDIR%%MEX_NAME%%MEX_EXT%&quot;"
  68. />
  69. <locationFinder>
  70. <VCROOT>
  71. <and>
  72. <or>
  73. <hklmExists path="SOFTWARE\Microsoft\VisualStudio\SxS\VS7" name="14.0" />
  74. <hkcuExists path="SOFTWARE\Microsoft\VisualStudio\SxS\VS7" name="14.0" />
  75. <hklmExists path="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" name="14.0" />
  76. <hkcuExists path="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" name="14.0" />
  77. </or>
  78. <fileExists name="$$\VC\bin\amd64\cl.exe" />
  79. <dirExists name="$$\..\.." />
  80. </and>
  81. </VCROOT>
  82. <SDKROOT>
  83. <or>
  84. <hklmExists path="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1" name="InstallationFolder" />
  85. <hkcuExists path="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1" name="InstallationFolder" />
  86. <hklmExists path="SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1" name="InstallationFolder" />
  87. <hkcuExists path="SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1" name="InstallationFolder" />
  88. </or>
  89. </SDKROOT>
  90. <VSINSTALLDIR>
  91. <or>
  92. <hklmExists path="SOFTWARE\Microsoft\VisualStudio\SxS\VS7" name="14.0" />
  93. <hkcuExists path="SOFTWARE\Microsoft\VisualStudio\SxS\VS7" name="14.0" />
  94. <hklmExists path="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" name="14.0" />
  95. <hkcuExists path="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" name="14.0" />
  96. </or>
  97. </VSINSTALLDIR>
  98. <VCINSTALLDIR>
  99. <or>
  100. <hklmExists path="SOFTWARE\Microsoft\VisualStudio\SxS\VC7" name="14.0" />
  101. <hkcuExists path="SOFTWARE\Microsoft\VisualStudio\SxS\VC7" name="14.0" />
  102. <hklmExists path="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7" name="14.0" />
  103. <hkcuExists path="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7" name="14.0" />
  104. </or>
  105. </VCINSTALLDIR>
  106. <PROF_ENV>
  107. <and>
  108. <envVarExists name="VS140COMNTOOLS" />
  109. <fileExists name="$$\..\IDE\devenv.exe" />
  110. </and>
  111. </PROF_ENV>
  112. <VCVARSALLDIR>
  113. <and>
  114. <or>
  115. <hklmExists path="SOFTWARE\Microsoft\VisualStudio\SxS\VS7" name="14.0" />
  116. <hkcuExists path="SOFTWARE\Microsoft\VisualStudio\SxS\VS7" name="14.0" />
  117. <hklmExists path="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" name="14.0" />
  118. <hkcuExists path="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" name="14.0" />
  119. </or>
  120. <fileExists name="$$\VC\vcvarsall.bat" />
  121. <dirExists name="$$"/>
  122. </and>
  123. </VCVARSALLDIR>
  124. <KITSROOT>
  125. <or>
  126. <hklmExists path="SOFTWARE\Microsoft\Windows Kits\Installed Roots" name="KitsRoot10" />
  127. <hkcuExists path="SOFTWARE\Microsoft\Windows Kits\Installed Roots" name="KitsRoot10" />
  128. <hklmExists path="SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots" name="KitsRoot10" />
  129. <hkcuExists path="SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots" name="KitsRoot10" />
  130. </or>
  131. </KITSROOT>
  132. <CUDA_LIB_PATH diagnostic="No CUDA toolkit installation could be found. If installed, set MW_NVCC_PATH environment variable to location of nvcc compiler." >
  133. <and>
  134. <or>
  135. <and>
  136. <envVarExists name="MW_NVCC_PATH"/>
  137. <fileExists name="$$\..\lib\x64\cudart.lib" />
  138. </and>
  139. <and>
  140. <envVarExists name="CUDA_LIB_PATH"/>
  141. <fileExists name="$$\cudart.lib" />
  142. </and>
  143. <and>
  144. <envVarExists name="CUDA_PATH"/>
  145. <fileExists name="$$\lib\x64\cudart.lib" />
  146. </and>
  147. <and>
  148. <fileExists name="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64\cudart.lib" />
  149. </and>
  150. </or>
  151. <dirExists name="$$" />
  152. </and>
  153. </CUDA_LIB_PATH>
  154. <CUDA_BIN_PATH diagnostic="Version 8.0 of the CUDA toolkit could not be found. If installed, set MW_NVCC_PATH environment variable to location of nvcc compiler." >
  155. <or>
  156. <!-- This section is for UNC paths. We can only execute nvcc --version with no quotes around a UNC path -->
  157. <and>
  158. <or>
  159. <and>
  160. <envVarExists name="MW_NVCC_PATH"/>
  161. <fileExists name="$$\nvcc.exe" />
  162. </and>
  163. <and>
  164. <envVarExists name="CUDA_BIN_PATH"/>
  165. <fileExists name="$$\nvcc.exe" />
  166. </and>
  167. <and>
  168. <envVarExists name="CUDA_PATH"/>
  169. <fileExists name="$$\bin\nvcc.exe" />
  170. </and>
  171. <and>
  172. <fileExists name="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe" />
  173. </and>
  174. </or>
  175. <!-- cmdReturns will replace all backslashes with a single backslash unless they are the very first characters -->
  176. <cmdReturns name="$$\nvcc --version | findstr /c:&quot;release 8.0&quot; > NUL && echo $$" />
  177. </and>
  178. <!-- For local paths, duplicate the same syntax in order to execute nvcc --version with quotes around the path, to handle spaces -->
  179. <and>
  180. <or>
  181. <and>
  182. <envVarExists name="MW_NVCC_PATH"/>
  183. <fileExists name="$$\nvcc.exe" />
  184. </and>
  185. <and>
  186. <envVarExists name="CUDA_BIN_PATH"/>
  187. <fileExists name="$$\nvcc.exe" />
  188. </and>
  189. <and>
  190. <envVarExists name="CUDA_PATH"/>
  191. <fileExists name="$$\bin\nvcc.exe" />
  192. </and>
  193. <and>
  194. <fileExists name="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe" />
  195. </and>
  196. </or>
  197. <cmdReturns name="&quot;$$\nvcc&quot; --version | findstr /c:&quot;release 8.0&quot; > NUL && echo $$" />
  198. </and>
  199. </or>
  200. </CUDA_BIN_PATH>
  201. </locationFinder>
  202. <env
  203. PATH="\$CUDA_BIN_PATH;$CUDA_BIN_PATH;$VCROOT\Bin\amd64;$VCROOT\Bin\VCPackages;$VCROOT\..\Common7\IDE;$VCROOT\..\Common7\Tools;$SDKROOT\Bin\x64;$SDKROOT\Bin\x86;"
  204. INCLUDE="$VCROOT\INCLUDE;$VCROOT\ATLMFC\INCLUDE;$KITSROOT\include\10.0.10150.0\ucrt;$SDKROOT\include\shared;$SDKROOT\include\um;$SDKROOT\include\winrt;$MATLABROOT\extern\include;$MATLABROOT\toolbox\distcomp\gpu\extern\include"
  205. LIB="$VCROOT\Lib\amd64;$VCROOT\ATLMFC\Lib\amd64;$KITSROOT\Lib\10.0.10150.0\ucrt\x64;$SDKROOT\lib\winv6.3\um\x64;$MATLABROOT\lib\$ARCH;$CUDA_LIB_PATH"
  206. LIBPATH="$VCROOT\Lib\amd64;$VCROOT\ATLMFC\Lib\amd64"
  207. />
  208. </config>
Advertisement
Add Comment
Please, Sign In to add comment