diff --git a/applications/camera_calibration/src/camera_calibration/models/central_generic.cc b/applications/camera_calibration/src/camera_calibration/models/central_generic.cc index d3949d2..dc96d2d 100644 --- a/applications/camera_calibration/src/camera_calibration/models/central_generic.cc +++ b/applications/camera_calibration/src/camera_calibration/models/central_generic.cc @@ -28,8 +28,8 @@ #include "camera_calibration/models/central_generic.h" +#include "../cuda_shims.h" #ifdef LIBVIS_HAVE_CUDA -#include #include #endif #include @@ -626,6 +626,7 @@ Mat3d CentralGenericModel::ChooseNiceCameraOrientation() { } CUDACameraModel* CentralGenericModel::CreateCUDACameraModel() { +#ifdef LIBVIS_HAVE_CUDA CUDACentralGenericModel* result = new CUDACentralGenericModel(); result->m_width = m_width; @@ -649,6 +650,9 @@ CUDACameraModel* CentralGenericModel::CreateCUDACameraModel() { result->m_grid = m_cuda_grid->ToCUDA(); return result; +#else + return nullptr; +#endif } } diff --git a/applications/camera_calibration/src/camera_calibration/tools/stereo_depth_estimation.cc b/applications/camera_calibration/src/camera_calibration/tools/stereo_depth_estimation.cc index 20a34b0..c8966f0 100644 --- a/applications/camera_calibration/src/camera_calibration/tools/stereo_depth_estimation.cc +++ b/applications/camera_calibration/src/camera_calibration/tools/stereo_depth_estimation.cc @@ -29,9 +29,8 @@ #include "camera_calibration/tools/tools.h" #include -#ifdef LIBVIS_HAVE_CUDA +#include "../cuda_shims.h" #include -#endif #include #include #include diff --git a/libvis/src/libvis/cuda/patch_match_stereo.h b/libvis/src/libvis/cuda/patch_match_stereo.h index 89672e1..33d1a33 100644 --- a/libvis/src/libvis/cuda/patch_match_stereo.h +++ b/libvis/src/libvis/cuda/patch_match_stereo.h @@ -29,10 +29,12 @@ #pragma once +#ifdef LIBVIS_HAVE_CUDA #include #include "libvis/cuda/cuda_buffer.h" #include "libvis/cuda/cuda_unprojection_lookup.h" +#endif #include "libvis/cuda/pixel_corner_projector.h" #include "libvis/image.h" #include "libvis/libvis.h" diff --git a/libvis/src/libvis/cuda/pixel_corner_projector.cuh b/libvis/src/libvis/cuda/pixel_corner_projector.cuh index 7aaaf16..caceaf4 100644 --- a/libvis/src/libvis/cuda/pixel_corner_projector.cuh +++ b/libvis/src/libvis/cuda/pixel_corner_projector.cuh @@ -29,10 +29,12 @@ #pragma once +#ifdef LIBVIS_HAVE_CUDA #include #include - #include "libvis/cuda/cuda_buffer.cuh" +#endif + #include "libvis/logging.h" namespace vis { @@ -49,8 +51,10 @@ struct PixelCornerProjector_ { min_ny(other.min_ny), max_nx(other.max_nx), max_ny(other.max_ny), +#ifdef LIBVIS_HAVE_CUDA grid2(other.grid2), grid3(other.grid3), +#endif omega(other.omega), two_tan_omega_half(other.two_tan_omega_half), fx(other.fx), fy(other.fy), cx(other.cx), cy(other.cy), @@ -517,9 +521,11 @@ struct PixelCornerProjector_ { float max_nx; float max_ny; +#ifdef LIBVIS_HAVE_CUDA CUDABuffer_ grid2; CUDABuffer_ grid3; - +#endif + float omega; float two_tan_omega_half; float fx, fy, cx, cy; diff --git a/libvis/src/libvis/cuda/pixel_corner_projector.h b/libvis/src/libvis/cuda/pixel_corner_projector.h index c9962ce..e7b1022 100644 --- a/libvis/src/libvis/cuda/pixel_corner_projector.h +++ b/libvis/src/libvis/cuda/pixel_corner_projector.h @@ -29,10 +29,12 @@ #pragma once +#ifdef LIBVIS_HAVE_CUDA #include +#include "libvis/cuda/cuda_buffer.h" +#endif #include "libvis/camera.h" -#include "libvis/cuda/cuda_buffer.h" #include "libvis/cuda/pixel_corner_projector.cuh" #include "libvis/eigen.h"