Files
ceres-solver/internal/ceres/solver_utils.cc
T

97 lines
3.1 KiB
C++
Raw Normal View History

2014-09-07 18:42:49 -07:00
// Ceres Solver - A fast non-linear least squares minimizer
2023-09-19 15:29:34 -07:00
// Copyright 2023 Google Inc. All rights reserved.
// http://ceres-solver.org/
2014-09-07 18:42:49 -07:00
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Author: sameeragarwal@google.com (Sameer Agarwal)
#include "ceres/solver_utils.h"
2014-09-07 18:42:49 -07:00
#include "Eigen/Core"
#include "ceres/internal/config.h"
2022-02-07 23:43:19 +01:00
#include "ceres/internal/export.h"
2014-09-07 18:42:49 -07:00
#include "ceres/version.h"
2022-02-03 08:09:10 -06:00
#ifndef CERES_NO_CUDA
#include "cuda_runtime.h"
2024-05-01 11:00:58 +02:00
#ifndef CERES_NO_CUDSS
#include "cudss.h"
#endif // CERES_NO_CUDSS
2022-02-03 08:09:10 -06:00
#endif // CERES_NO_CUDA
2014-09-07 18:42:49 -07:00
2022-04-21 17:41:10 -07:00
namespace ceres::internal {
2014-09-07 18:42:49 -07:00
2022-05-28 01:07:49 +02:00
constexpr char kVersion[] =
// clang-format off
2024-05-07 01:47:41 +02:00
CERES_VERSION_STRING "-eigen-("
CERES_SEMVER_VERSION(EIGEN_WORLD_VERSION,
EIGEN_MAJOR_VERSION,
EIGEN_MINOR_VERSION) ")"
2014-09-07 18:42:49 -07:00
#ifdef CERES_NO_LAPACK
2022-05-28 01:07:49 +02:00
"-no_lapack"
2014-09-07 18:42:49 -07:00
#else
2022-05-28 01:07:49 +02:00
"-lapack"
2014-09-07 18:42:49 -07:00
#endif
#ifndef CERES_NO_SUITESPARSE
2022-05-28 01:07:49 +02:00
"-suitesparse-(" CERES_SUITESPARSE_VERSION ")"
2014-09-07 18:42:49 -07:00
#endif
2022-06-22 19:20:40 +01:00
#if !defined(CERES_NO_EIGEN_METIS) || !defined(CERES_NO_CHOLMOD_PARTITION)
2022-05-15 22:26:18 +02:00
"-metis-(" CERES_METIS_VERSION ")"
#endif
2022-05-28 01:07:49 +02:00
#ifndef CERES_NO_ACCELERATE_SPARSE
2022-05-28 01:07:49 +02:00
"-acceleratesparse"
#endif
2014-09-07 18:42:49 -07:00
#ifdef CERES_USE_EIGEN_SPARSE
2022-05-28 01:07:49 +02:00
"-eigensparse"
2014-09-07 18:42:49 -07:00
#endif
#ifdef CERES_RESTRUCT_SCHUR_SPECIALIZATIONS
2022-05-28 01:07:49 +02:00
"-no_schur_specializations"
2014-09-07 18:42:49 -07:00
#endif
#ifdef CERES_NO_CUSTOM_BLAS
2022-05-28 01:07:49 +02:00
"-no_custom_blas"
2014-09-07 18:42:49 -07:00
#endif
2022-02-03 08:09:10 -06:00
#ifndef CERES_NO_CUDA
2022-05-28 01:07:49 +02:00
"-cuda-(" CERES_TO_STRING(CUDART_VERSION) ")"
2024-05-01 11:00:58 +02:00
#ifndef CERES_NO_CUDSS
"-cudss-(" CERES_SEMVER_VERSION(CUDSS_VERSION_MAJOR,
CUDSS_VERSION_MINOR,
CUDSS_VERSION_PATCH) ")"
#endif // CERES_NO_CUDSS
2022-02-03 08:09:10 -06:00
#endif
2022-05-28 01:07:49 +02:00
;
// clang-format on
2022-02-03 08:09:10 -06:00
2024-08-09 17:02:53 -07:00
std::string VersionString() { return kVersion; }
2014-09-07 18:42:49 -07:00
2022-04-21 17:41:10 -07:00
} // namespace ceres::internal