Skip to content

Commit c800636

Browse files
committed
More work
1 parent 678515b commit c800636

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

applications/camera_calibration/src/camera_calibration/models/central_generic.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
#include "camera_calibration/models/central_generic.h"
3030

31+
#include "../cuda_shims.h"
3132
#ifdef LIBVIS_HAVE_CUDA
32-
#include <cuda_runtime.h>
3333
#include <libvis/cuda/cuda_buffer.h>
3434
#endif
3535
#include <libvis/lm_optimizer.h>
@@ -626,6 +626,7 @@ Mat3d CentralGenericModel::ChooseNiceCameraOrientation() {
626626
}
627627

628628
CUDACameraModel* CentralGenericModel::CreateCUDACameraModel() {
629+
#ifdef LIBVIS_HAVE_CUDA
629630
CUDACentralGenericModel* result = new CUDACentralGenericModel();
630631

631632
result->m_width = m_width;
@@ -649,6 +650,9 @@ CUDACameraModel* CentralGenericModel::CreateCUDACameraModel() {
649650
result->m_grid = m_cuda_grid->ToCUDA();
650651

651652
return result;
653+
#else
654+
return nullptr;
655+
#endif
652656
}
653657

654658
}

applications/camera_calibration/src/camera_calibration/tools/stereo_depth_estimation.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929
#include "camera_calibration/tools/tools.h"
3030

3131
#include <boost/filesystem.hpp>
32-
#ifdef LIBVIS_HAVE_CUDA
32+
#include "../cuda_shims.h"
3333
#include <libvis/cuda/patch_match_stereo.h>
34-
#endif
3534
#include <libvis/point_cloud.h>
3635
#include <libvis/render_display.h>
3736
#include <QApplication>

libvis/src/libvis/cuda/patch_match_stereo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@
2929

3030
#pragma once
3131

32+
#ifdef LIBVIS_HAVE_CUDA
3233
#include <curand_kernel.h>
3334

3435
#include "libvis/cuda/cuda_buffer.h"
3536
#include "libvis/cuda/cuda_unprojection_lookup.h"
37+
#endif
3638
#include "libvis/cuda/pixel_corner_projector.h"
3739
#include "libvis/image.h"
3840
#include "libvis/libvis.h"

libvis/src/libvis/cuda/pixel_corner_projector.cuh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@
2929

3030
#pragma once
3131

32+
#ifdef LIBVIS_HAVE_CUDA
3233
#include <cuda_runtime.h>
3334
#include <math_constants.h>
34-
3535
#include "libvis/cuda/cuda_buffer.cuh"
36+
#endif
37+
3638
#include "libvis/logging.h"
3739

3840
namespace vis {
@@ -49,8 +51,10 @@ struct PixelCornerProjector_ {
4951
min_ny(other.min_ny),
5052
max_nx(other.max_nx),
5153
max_ny(other.max_ny),
54+
#ifdef LIBVIS_HAVE_CUDA
5255
grid2(other.grid2),
5356
grid3(other.grid3),
57+
#endif
5458
omega(other.omega),
5559
two_tan_omega_half(other.two_tan_omega_half),
5660
fx(other.fx), fy(other.fy), cx(other.cx), cy(other.cy),
@@ -517,9 +521,11 @@ struct PixelCornerProjector_ {
517521
float max_nx;
518522
float max_ny;
519523

524+
#ifdef LIBVIS_HAVE_CUDA
520525
CUDABuffer_<float2> grid2;
521526
CUDABuffer_<float3> grid3;
522-
527+
#endif
528+
523529
float omega;
524530
float two_tan_omega_half;
525531
float fx, fy, cx, cy;

libvis/src/libvis/cuda/pixel_corner_projector.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@
2929

3030
#pragma once
3131

32+
#ifdef LIBVIS_HAVE_CUDA
3233
#include <cuda_runtime.h>
34+
#include "libvis/cuda/cuda_buffer.h"
35+
#endif
3336

3437
#include "libvis/camera.h"
35-
#include "libvis/cuda/cuda_buffer.h"
3638
#include "libvis/cuda/pixel_corner_projector.cuh"
3739
#include "libvis/eigen.h"
3840

0 commit comments

Comments
 (0)