mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
* fix different dims and data sync and fp16 macro * fix pad is negative bug, but still need debugging info * split detection_output to dets and labels * fix clang++ compile bug * for fp16 compile macro of cmake * fix pad_val dict input * fix yolox missing normalization and get int tensor * about score_threshold * remove -lstdc++fs for android * move -pthread for android * fix link libraries for CLANG++; * fix clang-format * for mobileyolov3 conf_thre * fix lint * fix bug * support ncnn vulkan net * remove unused debugging info; * Change INFO to DEBUG * support vulkan precision mapping * fix pad * optimize getdetslabels * remove EVAL_MODE * ncnn_net support 4-dim data. * remove FP16 compile options * remove use_gpu_vulkan compile options * fix pad.cpp * fix yapf * fix clang-format * rm redundant lines * fix pad according to mmdet * add android build docs * fix lint * use cpp style string comparision * fix use after free bug * Add missing -DBUILD_SHARED_LIBS=OFF for en * Add missing -DBUILD_SHARED_LIBS=OFF for ZH-CN * reset img2tensor_impl * reset img2tensor_impl * add blank line * sync android.md docs * fix some dirs * fix docs * update docs * fix code
57 lines
1.6 KiB
C++
57 lines
1.6 KiB
C++
// Copyright (c) OpenMMLab. All rights reserved.
|
|
|
|
#include "core/utils/stacktrace.h"
|
|
|
|
#if USE_BOOST_STACKTRACE
|
|
|
|
#define BOOST_STACKTRACE_USE_BACKTRACE
|
|
#include "boost/stacktrace.hpp"
|
|
|
|
namespace mmdeploy {
|
|
|
|
struct Stacktrace::Impl {
|
|
boost::stacktrace::stacktrace st_;
|
|
};
|
|
Stacktrace::~Stacktrace() = default;
|
|
Stacktrace::Stacktrace(int)
|
|
: impl_(new Impl{boost::stacktrace::stacktrace(1, static_cast<std::size_t>(-1))}) {}
|
|
Stacktrace::Stacktrace() noexcept = default;
|
|
Stacktrace::Stacktrace(const Stacktrace& other) : impl_(std::make_unique<Impl>(*other.impl_)) {}
|
|
Stacktrace::Stacktrace(Stacktrace&& other) noexcept : impl_(std::move(other.impl_)) {}
|
|
Stacktrace& Stacktrace::operator=(Stacktrace&& other) noexcept {
|
|
impl_ = std::move(other.impl_);
|
|
return *this;
|
|
}
|
|
Stacktrace& Stacktrace::operator=(const Stacktrace& other) {
|
|
impl_ = std::make_unique<Impl>(*other.impl_);
|
|
return *this;
|
|
}
|
|
std::string Stacktrace::to_string() const {
|
|
if (impl_) {
|
|
return boost::stacktrace::to_string(impl_->st_);
|
|
}
|
|
return "";
|
|
}
|
|
|
|
} // namespace mmdeploy
|
|
|
|
#else
|
|
#include <string>
|
|
namespace mmdeploy {
|
|
|
|
struct Stacktrace::Impl {};
|
|
Stacktrace::~Stacktrace() = default;
|
|
Stacktrace::Stacktrace(int) {}
|
|
Stacktrace::Stacktrace() noexcept = default;
|
|
Stacktrace::Stacktrace(const Stacktrace&) {}
|
|
Stacktrace::Stacktrace(Stacktrace&&) noexcept {}
|
|
Stacktrace& Stacktrace::operator=(Stacktrace&&) noexcept { return *this; }
|
|
Stacktrace& Stacktrace::operator=(const Stacktrace&) { return *this; }
|
|
std::string Stacktrace::to_string() const {
|
|
return "the library is compiled with no stacktrace support";
|
|
}
|
|
|
|
} // namespace mmdeploy
|
|
|
|
#endif
|