mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-10-13 00:21:29 +08:00
Add EIGEN_RISCV64_DEFAULT_LMUL to control the default LMul for vectors.
This commit is contained in:
parent
2489bc0d55
commit
322e087690
@ -65,8 +65,8 @@ struct copy_using_evaluator_traits {
|
|||||||
|
|
||||||
// TODO distinguish between linear traversal and inner-traversals
|
// TODO distinguish between linear traversal and inner-traversals
|
||||||
#ifdef EIGEN_RISCV64_USE_RVV10
|
#ifdef EIGEN_RISCV64_USE_RVV10
|
||||||
using LinearPacketType = typename find_best_packet<DstScalar, RestrictedLinearSize, 4>::type;
|
using LinearPacketType = typename find_best_packet<DstScalar, RestrictedLinearSize, EIGEN_RISCV64_DEFAULT_LMUL>::type;
|
||||||
using InnerPacketType = typename find_best_packet<DstScalar, RestrictedInnerSize, 4>::type;
|
using InnerPacketType = typename find_best_packet<DstScalar, RestrictedInnerSize, EIGEN_RISCV64_DEFAULT_LMUL>::type;
|
||||||
#else
|
#else
|
||||||
using LinearPacketType = typename find_best_packet<DstScalar, RestrictedLinearSize>::type;
|
using LinearPacketType = typename find_best_packet<DstScalar, RestrictedLinearSize>::type;
|
||||||
using InnerPacketType = typename find_best_packet<DstScalar, RestrictedInnerSize>::type;
|
using InnerPacketType = typename find_best_packet<DstScalar, RestrictedInnerSize>::type;
|
||||||
|
@ -1370,7 +1370,7 @@ struct evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>>
|
|||||||
typedef typename XprType::Scalar Scalar;
|
typedef typename XprType::Scalar Scalar;
|
||||||
// TODO: should check for smaller packet types once we can handle multi-sized packet types
|
// TODO: should check for smaller packet types once we can handle multi-sized packet types
|
||||||
#ifdef EIGEN_RISCV64_USE_RVV10
|
#ifdef EIGEN_RISCV64_USE_RVV10
|
||||||
typedef typename packet_traits<Scalar, 4>::type PacketScalar;
|
typedef typename packet_traits<Scalar, EIGEN_RISCV64_DEFAULT_LMUL>::type PacketScalar;
|
||||||
#else
|
#else
|
||||||
typedef typename packet_traits<Scalar>::type PacketScalar;
|
typedef typename packet_traits<Scalar>::type PacketScalar;
|
||||||
#endif
|
#endif
|
||||||
|
@ -534,8 +534,8 @@ struct product_evaluator<Product<Lhs, Rhs, LazyProduct>, ProductTag, DenseShape,
|
|||||||
};
|
};
|
||||||
|
|
||||||
#ifdef EIGEN_RISCV64_USE_RVV10
|
#ifdef EIGEN_RISCV64_USE_RVV10
|
||||||
typedef typename find_best_packet<Scalar, RowsAtCompileTime, 4>::type LhsVecPacketType;
|
typedef typename find_best_packet<Scalar, RowsAtCompileTime, EIGEN_RISCV64_DEFAULT_LMUL>::type LhsVecPacketType;
|
||||||
typedef typename find_best_packet<Scalar, ColsAtCompileTime, 4>::type RhsVecPacketType;
|
typedef typename find_best_packet<Scalar, ColsAtCompileTime, EIGEN_RISCV64_DEFAULT_LMUL>::type RhsVecPacketType;
|
||||||
#else
|
#else
|
||||||
typedef typename find_best_packet<Scalar, RowsAtCompileTime>::type LhsVecPacketType;
|
typedef typename find_best_packet<Scalar, RowsAtCompileTime>::type LhsVecPacketType;
|
||||||
typedef typename find_best_packet<Scalar, ColsAtCompileTime>::type RhsVecPacketType;
|
typedef typename find_best_packet<Scalar, ColsAtCompileTime>::type RhsVecPacketType;
|
||||||
|
@ -30,7 +30,7 @@ template <typename Func, typename Evaluator>
|
|||||||
struct redux_traits {
|
struct redux_traits {
|
||||||
public:
|
public:
|
||||||
#ifdef EIGEN_RISCV64_USE_RVV10
|
#ifdef EIGEN_RISCV64_USE_RVV10
|
||||||
typedef typename find_best_packet<typename Evaluator::Scalar, Evaluator::SizeAtCompileTime, 4>::type PacketType;
|
typedef typename find_best_packet<typename Evaluator::Scalar, Evaluator::SizeAtCompileTime, EIGEN_RISCV64_DEFAULT_LMUL>::type PacketType;
|
||||||
#else
|
#else
|
||||||
typedef typename find_best_packet<typename Evaluator::Scalar, Evaluator::SizeAtCompileTime>::type PacketType;
|
typedef typename find_best_packet<typename Evaluator::Scalar, Evaluator::SizeAtCompileTime>::type PacketType;
|
||||||
#endif
|
#endif
|
||||||
|
@ -534,6 +534,13 @@ extern "C" {
|
|||||||
#include <hip/hip_bfloat16.h>
|
#include <hip/hip_bfloat16.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__riscv)
|
||||||
|
// Defines the default LMUL for RISC-V
|
||||||
|
#ifndef EIGEN_RISCV64_DEFAULT_LMUL
|
||||||
|
#define EIGEN_RISCV64_DEFAULT_LMUL 4
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/** \brief Namespace containing all symbols from the %Eigen library. */
|
/** \brief Namespace containing all symbols from the %Eigen library. */
|
||||||
// IWYU pragma: private
|
// IWYU pragma: private
|
||||||
#include "../InternalHeaderCheck.h"
|
#include "../InternalHeaderCheck.h"
|
||||||
|
@ -108,7 +108,7 @@ struct vectorization_logic {
|
|||||||
typedef internal::packet_traits<Scalar> PacketTraits;
|
typedef internal::packet_traits<Scalar> PacketTraits;
|
||||||
|
|
||||||
#ifdef EIGEN_RISCV64_USE_RVV10
|
#ifdef EIGEN_RISCV64_USE_RVV10
|
||||||
typedef typename internal::packet_traits<Scalar, 4>::type PacketType;
|
typedef typename internal::packet_traits<Scalar, EIGEN_RISCV64_DEFAULT_LMUL>::type PacketType;
|
||||||
#else
|
#else
|
||||||
typedef typename internal::packet_traits<Scalar>::type PacketType;
|
typedef typename internal::packet_traits<Scalar>::type PacketType;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user