mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-24 02:29:33 +08:00
Fix MSVC GPU build.
This commit is contained in:
parent
a2f8eba026
commit
a962a27594
@ -847,6 +847,9 @@ struct random_longdouble_impl {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// GPUs treat long double as double.
|
||||||
|
#ifndef EIGEN_GPU_COMPILE_PHASE
|
||||||
template <>
|
template <>
|
||||||
struct random_longdouble_impl<false> {
|
struct random_longdouble_impl<false> {
|
||||||
using Impl = random_impl<double>;
|
using Impl = random_impl<double>;
|
||||||
@ -863,6 +866,7 @@ struct random_impl<long double> {
|
|||||||
}
|
}
|
||||||
static EIGEN_DEVICE_FUNC inline long double run() { return random_longdouble_impl<>::run(); }
|
static EIGEN_DEVICE_FUNC inline long double run() { return random_longdouble_impl<>::run(); }
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
struct random_default_impl<Scalar, false, true> {
|
struct random_default_impl<Scalar, false, true> {
|
||||||
|
@ -612,7 +612,18 @@ class JacobiSVD : public SVDBase<JacobiSVD<MatrixType_, Options_> > {
|
|||||||
using Base::rows;
|
using Base::rows;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void allocate(Index rows, Index cols, unsigned int computationOptions);
|
void allocate(Index rows_, Index cols_, unsigned int computationOptions) {
|
||||||
|
if (Base::allocate(rows_, cols_, computationOptions)) return;
|
||||||
|
eigen_assert(!(ShouldComputeThinU && int(QRPreconditioner) == int(FullPivHouseholderQRPreconditioner)) &&
|
||||||
|
!(ShouldComputeThinU && int(QRPreconditioner) == int(FullPivHouseholderQRPreconditioner)) &&
|
||||||
|
"JacobiSVD: can't compute thin U or thin V with the FullPivHouseholderQR preconditioner. "
|
||||||
|
"Use the ColPivHouseholderQR preconditioner instead.");
|
||||||
|
|
||||||
|
m_workMatrix.resize(diagSize(), diagSize());
|
||||||
|
if (cols() > rows()) m_qr_precond_morecols.allocate(*this);
|
||||||
|
if (rows() > cols()) m_qr_precond_morerows.allocate(*this);
|
||||||
|
}
|
||||||
|
|
||||||
JacobiSVD& compute_impl(const MatrixType& matrix, unsigned int computationOptions);
|
JacobiSVD& compute_impl(const MatrixType& matrix, unsigned int computationOptions);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -650,20 +661,6 @@ class JacobiSVD : public SVDBase<JacobiSVD<MatrixType_, Options_> > {
|
|||||||
WorkMatrixType m_workMatrix;
|
WorkMatrixType m_workMatrix;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename MatrixType, int Options>
|
|
||||||
void JacobiSVD<MatrixType, Options>::allocate(Index rows_, Index cols_, unsigned int computationOptions_) {
|
|
||||||
if (Base::allocate(rows_, cols_, computationOptions_)) return;
|
|
||||||
|
|
||||||
eigen_assert(!(ShouldComputeThinU && int(QRPreconditioner) == int(FullPivHouseholderQRPreconditioner)) &&
|
|
||||||
!(ShouldComputeThinU && int(QRPreconditioner) == int(FullPivHouseholderQRPreconditioner)) &&
|
|
||||||
"JacobiSVD: can't compute thin U or thin V with the FullPivHouseholderQR preconditioner. "
|
|
||||||
"Use the ColPivHouseholderQR preconditioner instead.");
|
|
||||||
|
|
||||||
m_workMatrix.resize(diagSize(), diagSize());
|
|
||||||
if (cols() > rows()) m_qr_precond_morecols.allocate(*this);
|
|
||||||
if (rows() > cols()) m_qr_precond_morerows.allocate(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename MatrixType, int Options>
|
template <typename MatrixType, int Options>
|
||||||
JacobiSVD<MatrixType, Options>& JacobiSVD<MatrixType, Options>::compute_impl(const MatrixType& matrix,
|
JacobiSVD<MatrixType, Options>& JacobiSVD<MatrixType, Options>::compute_impl(const MatrixType& matrix,
|
||||||
unsigned int computationOptions) {
|
unsigned int computationOptions) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user