簡體   English   中英

Eigen(v141)中的內部編譯器錯誤

[英]Internal compiler error in Eigen (v141)

使用v141在當前版本的Eigen中在文件“ ProductEvaluators.h”中編譯函數時,出現內部編譯器錯誤。

fatal error C1001: An internal error has occurred in the compiler.

該函數如下所示,並且我將編譯器的/崩潰錯誤縮小為最后一行的'.sum()':

EIGEN_DEVICE_FUNC const CoeffReturnType coeff(Index index) const
{
  const Index row = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? 0 : index;
  const Index col = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? index : 0;
  return (m_lhs.row(row).transpose().cwiseProduct( m_rhs.col(col) )).sum();
}

雖然修復該特定錯誤當然很有趣,但我也想知道,哪種代碼通常會引起這種編譯器崩潰?

我曾多次看到MSVC的編譯器崩潰。 到目前為止,它一直是32位編譯器,其中64位msvc(以及gcc或clang)可以正常工作。

我使用的解決方法是將表達式拆分為較小的表達式,將子表達式明確評估為Eigen :: Matrix <>臨時變量。 將這些臨時對象保留在一個類中,然后重新使用這些對象可以最大程度地降低性能成本,但理想情況下並非如此。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM