diff --git a/doc/changelog.dox b/doc/changelog.dox index 880ea80a3..86c137708 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -369,6 +369,9 @@ See also: - Removed mention of the outdated Ubuntu PPA from @ref building as it doesn't seem to be maintained anymore (see [mosra/magnum-examples#61](https://github.com/mosra/magnum-examples/issues/61)) +- Worked around a bug in the NVCC compiler on Windows involving + @ref Math::RectangularMatrix::DiagonalSize to make Magnum usable with CUDA + (see [mosra/magnum#345](https://github.com/mosra/magnum/issues/345)) @subsection changelog-latest-bugfixes Bug fixes diff --git a/src/Magnum/Math/RectangularMatrix.h b/src/Magnum/Math/RectangularMatrix.h index a0295d68e..486ccef82 100644 --- a/src/Magnum/Math/RectangularMatrix.h +++ b/src/Magnum/Math/RectangularMatrix.h @@ -407,7 +407,12 @@ template class RectangularMatrix { * * @see @ref fromDiagonal() */ - constexpr Vector diagonal() const; + constexpr Vector diagonal() const { + /* NVCC (from CUDA) has problems compiling this function under + Windows when there's a separate definition due to DiagonalSize + (see https://github.com/mosra/magnum/issues/345 for details) */ + return diagonalInternal(typename Implementation::GenerateSequence::Type()); + } /** * @brief Convert matrix to vector @@ -754,8 +759,6 @@ template inline RectangularMatrix constexpr auto RectangularMatrix::diagonal() const -> Vector { return diagonalInternal(typename Implementation::GenerateSequence::Type()); } - #ifndef DOXYGEN_GENERATING_OUTPUT template template constexpr auto RectangularMatrix::diagonalInternal(Implementation::Sequence) const -> Vector { return {_data[sequence][sequence]...};