Skip to content

Commit

Permalink
More work
Browse files Browse the repository at this point in the history
  • Loading branch information
rpavlik committed Jul 6, 2021
1 parent 678515b commit c800636
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

#include "camera_calibration/models/central_generic.h"

#include "../cuda_shims.h"
#ifdef LIBVIS_HAVE_CUDA
#include <cuda_runtime.h>
#include <libvis/cuda/cuda_buffer.h>
#endif
#include <libvis/lm_optimizer.h>
Expand Down Expand Up @@ -626,6 +626,7 @@ Mat3d CentralGenericModel::ChooseNiceCameraOrientation() {
}

CUDACameraModel* CentralGenericModel::CreateCUDACameraModel() {
#ifdef LIBVIS_HAVE_CUDA
CUDACentralGenericModel* result = new CUDACentralGenericModel();

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

return result;
#else
return nullptr;
#endif
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
#include "camera_calibration/tools/tools.h"

#include <boost/filesystem.hpp>
#ifdef LIBVIS_HAVE_CUDA
#include "../cuda_shims.h"
#include <libvis/cuda/patch_match_stereo.h>
#endif
#include <libvis/point_cloud.h>
#include <libvis/render_display.h>
#include <QApplication>
Expand Down
2 changes: 2 additions & 0 deletions libvis/src/libvis/cuda/patch_match_stereo.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@

#pragma once

#ifdef LIBVIS_HAVE_CUDA
#include <curand_kernel.h>

#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"
Expand Down
10 changes: 8 additions & 2 deletions libvis/src/libvis/cuda/pixel_corner_projector.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@

#pragma once

#ifdef LIBVIS_HAVE_CUDA
#include <cuda_runtime.h>
#include <math_constants.h>

#include "libvis/cuda/cuda_buffer.cuh"
#endif

#include "libvis/logging.h"

namespace vis {
Expand All @@ -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),
Expand Down Expand Up @@ -517,9 +521,11 @@ struct PixelCornerProjector_ {
float max_nx;
float max_ny;

#ifdef LIBVIS_HAVE_CUDA
CUDABuffer_<float2> grid2;
CUDABuffer_<float3> grid3;

#endif

float omega;
float two_tan_omega_half;
float fx, fy, cx, cy;
Expand Down
4 changes: 3 additions & 1 deletion libvis/src/libvis/cuda/pixel_corner_projector.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@

#pragma once

#ifdef LIBVIS_HAVE_CUDA
#include <cuda_runtime.h>
#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"

Expand Down

0 comments on commit c800636

Please sign in to comment.