Skip to content

Commit

Permalink
change file extensions to avoid TBB-related errors
Browse files Browse the repository at this point in the history
  • Loading branch information
koide3 committed Aug 14, 2024
1 parent f5eb8d3 commit d9fbf65
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ if(BUILD_WITH_CUDA)
src/gtsam_points/cuda/cuda_graph.cu
src/gtsam_points/cuda/cuda_graph_exec.cu
# src/gtsam_points/cuda/gl_buffer_map.cu
src/gtsam_points/cuda/nonlinear_factor_set_gpu.cu
src/gtsam_points/cuda/nonlinear_factor_set_gpu_create.cu
src/gtsam_points/cuda/nonlinear_factor_set_gpu.cpp
src/gtsam_points/cuda/nonlinear_factor_set_gpu_create.cpp
src/gtsam_points/cuda/stream_roundrobin.cu
src/gtsam_points/cuda/stream_temp_buffer_roundrobin.cu
# types
Expand All @@ -197,7 +197,7 @@ if(BUILD_WITH_CUDA)
src/gtsam_points/factors/integrated_vgicp_derivatives_inliers.cu
src/gtsam_points/factors/integrated_vgicp_derivatives_compute.cu
src/gtsam_points/factors/integrated_vgicp_derivatives_linearize.cu
src/gtsam_points/factors/integrated_vgicp_factor_gpu.cu
src/gtsam_points/factors/integrated_vgicp_factor_gpu.cpp
# util
src/gtsam_points/util/easy_profiler_cuda.cu
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ void IntegratedGICPFactor_<TargetFrame, SourceFrame>::update_correspondences(con
}
}

if (do_update) {
last_correspondence_point = delta;
}

correspondences.resize(frame::size(*source));
mahalanobis.resize(frame::size(*source));

Expand All @@ -130,8 +134,6 @@ void IntegratedGICPFactor_<TargetFrame, SourceFrame>::update_correspondences(con
mahalanobis[i](3, 3) = 0.0;
}
}

last_correspondence_point = delta;
}

template <typename TargetFrame, typename SourceFrame>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ namespace gtsam_points {
NonlinearFactorSetGPU::DeviceBuffer::DeviceBuffer() : size(0), buffer(nullptr) {}

NonlinearFactorSetGPU::DeviceBuffer::~DeviceBuffer() {
if(buffer) {
if (buffer) {
check_error << cudaFreeAsync(buffer, 0);
}
}

void NonlinearFactorSetGPU::DeviceBuffer::resize(size_t size, CUstream_st* stream) {
if(this->size < size) {
if(buffer) {
if (this->size < size) {
if (buffer) {
check_error << cudaFreeAsync(buffer, stream);
}
check_error << cudaMallocAsync(&buffer, size, stream);
Expand Down Expand Up @@ -163,12 +163,8 @@ void NonlinearFactorSetGPU::error(const gtsam::Values& values) {
}

// copy input buffer from cpu to gpu
check_error << cudaMemcpyAsync(
evaluation_input_buffer_gpu->data(),
evaluation_input_buffer_cpu.data(),
input_buffer_size,
cudaMemcpyHostToDevice,
stream);
check_error
<< cudaMemcpyAsync(evaluation_input_buffer_gpu->data(), evaluation_input_buffer_cpu.data(), input_buffer_size, cudaMemcpyHostToDevice, stream);
check_error << cudaStreamSynchronize(stream);

// issue error computation
Expand All @@ -195,12 +191,8 @@ void NonlinearFactorSetGPU::error(const gtsam::Values& values) {
}

// copy output buffer from gpu to cpu
check_error << cudaMemcpyAsync(
evaluation_output_buffer_cpu.data(),
evaluation_output_buffer_gpu->data(),
output_buffer_size,
cudaMemcpyDeviceToHost,
stream);
check_error
<< cudaMemcpyAsync(evaluation_output_buffer_cpu.data(), evaluation_output_buffer_gpu->data(), output_buffer_size, cudaMemcpyDeviceToHost, stream);
check_error << cudaStreamSynchronize(stream);

// store computed results
Expand Down

0 comments on commit d9fbf65

Please sign in to comment.