gpt4 book ai didi

c++ - 将 Ceres 与带有 sse/avx 的库一起使用时出错

转载 作者:行者123 更新时间:2023-11-28 04:28:10 26 4
gpt4 key购买 nike

我有一个模板库,其中一些函数专门用于 float 和 double 类型。此特化使用 sse/avx,因此,此库具有 -march=native -mavx2 编译器标志。当我尝试使用此库的某些函数(非专用函数)时,我从 Ceres 收到以下运行时错误:

test_ceres: /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:128: Eigen::internal::plain_array<double, 4, 0, 32>::plain_array() [T = double, Size = 4, MatrixOrArrayOptions = 0, Alignment = 32]: Assertion `(internal::UIntPtr(array) & (31)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed.

我已经能够用更简单的代码重现错误:here .本质上,此示例在 -mavx2 -march=native 标志被删除时有效,并且在它们存在时不起作用(产生先前的错误)(来自 CmakeLists.txt 的注释和取消注释)。在此示例中,不存在使用 avx/sse 的函数,但请记住我的库中有它们,因此删除标志 -mavx2 -march=native 不是一个选项。关于如何解决这个问题的任何想法?当我编译 Ceres 时,我添加了标志 -DCMAKE_CXX_FLAGS="-march=native",正如 documentation 中指出的那样.

阅读webpage provided in the error message没有提供任何解决方案。

关于我的系统的一些有用信息:

  • 编译器:clang++
    • clang 版本 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
    • 目标:x86_64-pc-linux-gnu
    • 线程模型:posix
  • Ceres 版本:2.0(我实际上有 git 存储库并且我在几分钟前更新了它:)
  • CPU:Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz

最佳答案

考虑在 eigen 邮件列表中询问这个问题。这不是 Ceres 求解器问题。

关于c++ - 将 Ceres 与带有 sse/avx 的库一起使用时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53725249/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com