When I try to use image reading functionality inside .cu file, I get compilation errors, whereas if I put the same code inside .cpp file, which is compiler using regular host compiler, the code normally compiles.
Platform:
Windows 11
Visual Studio 2022 17.4
CUDA 11.7 / 12.0 (same error on both)
I get the following errors:
C:\.conan\79dfc2\1\include\ITK-5.3\itkImageBase.h(117): error C2555: 'itk::ImageBase<3>::CreateAnother': overriding virtual function return type differs and is not covariant from 'itk::Object::CreateAnother'
C:\.conan\79dfc2\1\include\ITK-5.3\itkObject.h(82): note: see declaration of 'itk::Object::CreateAnother'
C:\.conan\79dfc2\1\include\ITK-5.3\itkImage.h(88): note: see reference to class template instantiation 'itk::ImageBase<3>' being compiled
C:\Users\zukov\source\repos\GIR\testing\registration\registration.cu(10): note: see reference to class template instantiation 'itk::Image<float,3>' being compiled
C:\.conan\79dfc2\1\include\ITK-5.3\itkImage.h(101): error C2555: 'itk::Image<float,3>::CreateAnother': overriding virtual function return type differs and is not covariant from 'itk::ImageBase<3>::CreateAnother'
C:\.conan\79dfc2\1\include\ITK-5.3\itkImageBase.h(117): note: see declaration of 'itk::ImageBase<3>::CreateAnother'
ninja: build stopped: subcommand failed.
Build All failed.
I am not sure what subset of ITK can be used within CUDA code, but probably only GPU-related classes. @simon.rit@LucasGandel do have a more detailed answer?