Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: add basic bundle adjuster class. #377

Merged
merged 4 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions cpp/drafts/Compute/CLBlast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
#pragma once

#include <DO/Sara/Core/DebugUtilities.hpp>
#include <DO/Sara/Core/StringFormat.hpp>
#include <DO/Sara/Core/Tensor.hpp>
#include <DO/Sara/Core/Timer.hpp>

#include <fmt/format.h>

#if defined(__APPLE__) || defined(__MACOSX)
# include <OpenCL/cl.hpp>
#else
Expand Down Expand Up @@ -115,13 +116,14 @@ namespace DO::Sara {

if (status != clblast::StatusCode::kSuccess)
throw std::runtime_error{
format("Batched GEMM operation failed! Status code = %d", status)};
fmt::format("Batched GEMM operation failed! Status code = {}",
static_cast<int>(status))};

clWaitForEvents(1, &event);
clReleaseEvent(event);
}
const auto elapsed_time = timer.elapsed_ms();
SARA_DEBUG << format("Completed batched SGEMM in %.3lf ms", elapsed_time)
SARA_DEBUG << fmt::format("Completed batched SGEMM in {} ms", elapsed_time)
<< std::endl;

{
Expand All @@ -130,9 +132,10 @@ namespace DO::Sara {
/* offset */ 0, C.size() * sizeof(float), C.data());

if (status)
throw std::runtime_error{format("Error: Failed to read buffer from "
"device to host! Status code = %d",
status)};
throw std::runtime_error{
fmt::format("Error: Failed to read buffer from device to host! "
"Status code = {}",
status)};
}
}

Expand Down
7 changes: 3 additions & 4 deletions cpp/examples/Sara/MultiViewGeometry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ target_link_libraries(

# Bundle adjustment.
sara_add_example(two_view_bundle_adjustment_example)
target_include_directories(two_view_bundle_adjustment_example
PRIVATE ${CERES_INCLUDE_DIRS})
target_link_libraries(two_view_bundle_adjustment_example
PRIVATE ${CERES_LIBRARIES})
target_link_libraries(
two_view_bundle_adjustment_example #
PRIVATE DO::Sara::SfM)
Loading