ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkCudaExternTemplates.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright RTK Consortium
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18
19#ifndef rtkCudaExternTemplates_h
20#define rtkCudaExternTemplates_h
21
22#include "rtkConfiguration.h"
23#ifdef RTK_USE_CUDA
24
25# include <itkCropImageFilter.h>
26# include <itkCudaImage.h>
28# include <itkImageSource.h>
31# include <itkCovariantVector.h>
32# include "RTKExport.h"
33
34// On MSVC, extern template declarations need __declspec(dllimport) to
35// reliably suppress implicit instantiation in consumer translation units.
36// On the DLL-build side (RTK_EXPORTS defined), extern template declarations
37// must be hidden entirely to avoid C4910 warnings caused by dllexport
38// propagation from derived CUDA filter classes.
39# if defined(_MSC_VER) && !defined(RTK_EXPORTS)
40// Consuming the DLL: extern templates with dllimport suppress LNK2005.
41# define RTK_EXTERN_TEMPLATES
42# define RTK_EXPORT_EXPLICIT RTK_EXPORT
43# endif
44
45// Explicit instantiation definitions are in rtkCudaExternTemplates.cxx.
46// RTK base class extern templates are at the end of their own headers.
47# ifdef RTK_EXTERN_TEMPLATES
48ITK_GCC_PRAGMA_DIAG_PUSH()
49ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes")
50extern template class RTK_EXPORT_EXPLICIT itk::ImageSource<itk::CudaImage<float, 3>>;
51extern template class RTK_EXPORT_EXPLICIT itk::ImageToImageFilter<itk::CudaImage<float, 3>, itk::CudaImage<float, 3>>;
52extern template class RTK_EXPORT_EXPLICIT itk::InPlaceImageFilter<itk::CudaImage<float, 3>, itk::CudaImage<float, 3>>;
53extern template class RTK_EXPORT_EXPLICIT itk::ImageSource<itk::CudaImage<itk::CovariantVector<float, 3>, 3>>;
54extern template class RTK_EXPORT_EXPLICIT itk::ExtractImageFilter<itk::CudaImage<float, 3>, itk::CudaImage<float, 3>>;
55extern template class RTK_EXPORT_EXPLICIT itk::CropImageFilter<itk::CudaImage<float, 3>, itk::CudaImage<float, 3>>;
56ITK_GCC_PRAGMA_DIAG_POP()
57# endif
58
59namespace rtk
60{
61// Empty namespace block required by KWStyle
62} // namespace rtk
63
64#endif // RTK_USE_CUDA
65#endif // rtkCudaExternTemplates_h
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....