mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-31 17:22:07 +08:00
Defer to std::fill_n when filling a dense object with a constant value.
This commit is contained in:
parent
1e6c6c1576
commit
0c361c4899
@ -785,6 +785,16 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_dense_assignment_loop(DstXprType
|
|||||||
dense_assignment_loop<Kernel>::run(kernel);
|
dense_assignment_loop<Kernel>::run(kernel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Specialization for filling the destination with a constant value.
|
||||||
|
#ifndef EIGEN_GPU_COMPILE_PHASE
|
||||||
|
template<typename DstXprType>
|
||||||
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_dense_assignment_loop(DstXprType& dst, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<typename DstXprType::Scalar>, DstXprType>& src, const internal::assign_op<typename DstXprType::Scalar,typename DstXprType::Scalar>& func)
|
||||||
|
{
|
||||||
|
resize_if_allowed(dst, src, func);
|
||||||
|
std::fill_n(dst.data(), dst.size(), src.functor()());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename DstXprType, typename SrcXprType>
|
template<typename DstXprType, typename SrcXprType>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_dense_assignment_loop(DstXprType& dst, const SrcXprType& src)
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_dense_assignment_loop(DstXprType& dst, const SrcXprType& src)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user