[ITK Community] Another CUDA + ITK question

Chuck Hatt hatt at wisc.edu
Tue Jan 28 17:49:45 EST 2014


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.

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.

I am using VS2010 (I have no choice about this).  I am using Cmake 2.8, ITK
4.5, CUDA 5.5

Here is my CMakeLists.txt file.

# This is the root ITK CMakeLists file.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
IF(COMMAND CMAKE_POLICY)
  CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)


# This project is designed to be built outside the Insight source tree.
PROJECT(myproject)

FIND_PACKAGE(CUDA)

# Find ITK.
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})

#Add cuda executables
CUDA_ADD_EXECUTABLE(myproject main.cu )
TARGET_LINK_LIBRARIES(myproject ${ITK_LIBRARIES})

This generates a working executable when main.cu only contains my
previously working CUDA code.  However, when I add the line


#include "itkPowellOptimizer.h" to the top of main.cu file

I get a bunch of errors related to what look to be windows files and ITK
files.  For example:

Error 30 error : expected a "," or ">"
c:\src\itk\insighttoolkit-4.5.0\modules\thirdparty\vnl\src\vxl\core\vnl\vnl_matrix_fixed.h
900

Error 26 error : expected a ")"
c:\src\itk\insighttoolkit-4.5.0\modules\core\common\include\itkPoint.hxx 228

Error 7 error : expected a ")" C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\include\basetsd.h 376


I really have no idea how to go about fixing this.  Any help would be
appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140128/1b969e3a/attachment-0002.html>


More information about the Community mailing list