<div dir="ltr">I'm trying to get CUDA working with ITK. I have cuda code that works already, but I need to incorporate my CUDA functions into an optimization framework and I want to use ITK's functions.<div><br></div>
<div>Normally when I want to write an application using a programming library, I just build up from a simple example. However, merging ITK and CUDA simple examples has been tricky.</div><div><br></div><div>I am using VS2010 (I have no choice about this). I am using Cmake 2.8, ITK 4.5, CUDA 5.5<br>
</div><div><br></div><div>Here is my CMakeLists.txt file. </div><div><br></div><div><div><font size="1" face="courier new, monospace"># This is the root ITK CMakeLists file.</font></div><div><font size="1" face="courier new, monospace">CMAKE_MINIMUM_REQUIRED(VERSION 2.6)</font></div>
<div><font size="1" face="courier new, monospace">IF(COMMAND CMAKE_POLICY)</font></div><div><font size="1" face="courier new, monospace"> CMAKE_POLICY(SET CMP0003 NEW)</font></div><div><font size="1" face="courier new, monospace">ENDIF(COMMAND CMAKE_POLICY)</font></div>
<div><font size="1" face="courier new, monospace"><br></font></div><div><font size="1" face="courier new, monospace"><br></font></div><div><font size="1" face="courier new, monospace"># This project is designed to be built outside the Insight source tree.</font></div>
<div><font size="1" face="courier new, monospace">PROJECT(myproject)</font></div><div><font size="1" face="courier new, monospace"><br></font></div><div><font size="1" face="courier new, monospace">FIND_PACKAGE(CUDA)</font></div>
<div><font size="1" face="courier new, monospace"><br></font></div><div><font size="1" face="courier new, monospace"># Find ITK.</font></div><div><font size="1" face="courier new, monospace">FIND_PACKAGE(ITK REQUIRED)</font></div>
<div><font size="1" face="courier new, monospace">INCLUDE(${ITK_USE_FILE})</font></div><div><font size="1" face="courier new, monospace"><br></font></div><div><font size="1" face="courier new, monospace">#Add cuda executables</font></div>
<div><font size="1" face="courier new, monospace">CUDA_ADD_EXECUTABLE(</font><span style="font-family:'courier new',monospace;font-size:x-small">myproject</span><font size="1" face="courier new, monospace"> <a href="http://main.cu">main.cu</a> )</font></div>
<div><font size="1" face="courier new, monospace">TARGET_LINK_LIBRARIES(</font><span style="font-family:'courier new',monospace;font-size:x-small">myproject</span><font size="1" face="courier new, monospace"> ${ITK_LIBRARIES})</font></div>
</div><div><br></div><div>This generates a working executable when <a href="http://main.cu">main.cu</a> only contains my previously working CUDA code. However, when I add the line </div><div><br></div><div><br></div><div>
#include<font face="courier new, monospace"> "itkPowellOptimizer.h"</font> to the top of <a href="http://main.cu">main.cu</a> file</div><div><br></div><div><font face="arial, helvetica, sans-serif">I get a bunch of errors related to what look to be windows files and ITK files. For example:</font></div>
<div><font size="1" face="courier new, monospace"><br></font></div><div><div><font size="1" face="courier new, monospace">Error<span class="" style="white-space:pre"> </span>30<span class="" style="white-space:pre"> </span>error : expected a "," or ">"<span class="" style="white-space:pre"> </span>c:\src\itk\insighttoolkit-4.5.0\modules\thirdparty\vnl\src\vxl\core\vnl\vnl_matrix_fixed.h<span class="" style="white-space:pre"> </span>900</font></div>
</div><div><br></div><div><div><font size="1" face="courier new, monospace">Error<span class="" style="white-space:pre"> </span>26<span class="" style="white-space:pre"> </span>error : expected a ")"<span class="" style="white-space:pre"> </span>c:\src\itk\insighttoolkit-4.5.0\modules\core\common\include\itkPoint.hxx<span class="" style="white-space:pre"> </span>228</font></div>
</div><div><br></div><div><div><font size="1" face="courier new, monospace">Error<span class="" style="white-space:pre"> </span>7<span class="" style="white-space:pre"> </span>error : expected a ")"<span class="" style="white-space:pre"> </span>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\basetsd.h<span class="" style="white-space:pre"> </span>376</font></div>
</div><div><br></div><div><br></div><div>I really have no idea how to go about fixing this. Any help would be appreciated.</div></div>