#ifndef EIGEN_GENERAL_BLOCK_PANEL_H
#define EIGEN_GENERAL_BLOCK_PANEL_H
#include "../InternalHeaderCheck.h"
namespace Eigen {
namespace internal {
enum GEBPPacketSizeType { … };
template <typename LhsScalar_, typename RhsScalar_, bool ConjLhs_ = false, bool ConjRhs_ = false,
int Arch = Architecture::Target, int PacketSize_ = GEBPPacketFull>
class gebp_traits;
inline std::ptrdiff_t manage_caching_sizes_helper(std::ptrdiff_t a, std::ptrdiff_t b) { … }
#if defined(EIGEN_DEFAULT_L1_CACHE_SIZE)
#define EIGEN_SET_DEFAULT_L1_CACHE_SIZE …
#else
#define EIGEN_SET_DEFAULT_L1_CACHE_SIZE …
#endif
#if defined(EIGEN_DEFAULT_L2_CACHE_SIZE)
#define EIGEN_SET_DEFAULT_L2_CACHE_SIZE …
#else
#define EIGEN_SET_DEFAULT_L2_CACHE_SIZE …
#endif
#if defined(EIGEN_DEFAULT_L3_CACHE_SIZE)
#define EIGEN_SET_DEFAULT_L3_CACHE_SIZE …
#else
#define EIGEN_SET_DEFAULT_L3_CACHE_SIZE …
#endif
#if EIGEN_ARCH_i386_OR_x86_64
const std::ptrdiff_t defaultL1CacheSize = …);
const std::ptrdiff_t defaultL2CacheSize = …);
const std::ptrdiff_t defaultL3CacheSize = …);
#elif EIGEN_ARCH_PPC
const std::ptrdiff_t defaultL1CacheSize = EIGEN_SET_DEFAULT_L1_CACHE_SIZE(64 * 1024);
#ifdef _ARCH_PWR10
const std::ptrdiff_t defaultL2CacheSize = EIGEN_SET_DEFAULT_L2_CACHE_SIZE(2 * 1024 * 1024);
const std::ptrdiff_t defaultL3CacheSize = EIGEN_SET_DEFAULT_L3_CACHE_SIZE(8 * 1024 * 1024);
#else
const std::ptrdiff_t defaultL2CacheSize = EIGEN_SET_DEFAULT_L2_CACHE_SIZE(512 * 1024);
const std::ptrdiff_t defaultL3CacheSize = EIGEN_SET_DEFAULT_L3_CACHE_SIZE(4 * 1024 * 1024);
#endif
#else
const std::ptrdiff_t defaultL1CacheSize = EIGEN_SET_DEFAULT_L1_CACHE_SIZE(16 * 1024);
const std::ptrdiff_t defaultL2CacheSize = EIGEN_SET_DEFAULT_L2_CACHE_SIZE(512 * 1024);
const std::ptrdiff_t defaultL3CacheSize = EIGEN_SET_DEFAULT_L3_CACHE_SIZE(512 * 1024);
#endif
#undef EIGEN_SET_DEFAULT_L1_CACHE_SIZE
#undef EIGEN_SET_DEFAULT_L2_CACHE_SIZE
#undef EIGEN_SET_DEFAULT_L3_CACHE_SIZE
struct CacheSizes { … };
inline void manage_caching_sizes(Action action, std::ptrdiff_t* l1, std::ptrdiff_t* l2, std::ptrdiff_t* l3) { … }
template <typename LhsScalar, typename RhsScalar, int KcFactor, typename Index>
void evaluateProductBlockingSizesHeuristic(Index& k, Index& m, Index& n, Index num_threads = 1) { … }
template <typename Index>
inline bool useSpecificBlockingSizes(Index& k, Index& m, Index& n) { … }
template <typename LhsScalar, typename RhsScalar, int KcFactor, typename Index>
void computeProductBlockingSizes(Index& k, Index& m, Index& n, Index num_threads = 1) { … }
template <typename LhsScalar, typename RhsScalar, typename Index>
inline void computeProductBlockingSizes(Index& k, Index& m, Index& n, Index num_threads = 1) { … }
template <typename RhsPacket, typename RhsPacketx4, int registers_taken>
struct RhsPanelHelper { … };
template <typename Packet>
struct QuadPacket { … };
template <int N, typename T1, typename T2, typename T3>
struct packet_conditional { … };
packet_conditional<GEBPPacketFull, T1, T2, T3>;
packet_conditional<GEBPPacketHalf, T1, T2, T3>;
#define PACKET_DECL_COND_POSTFIX …
#define PACKET_DECL_COND …
#define PACKET_DECL_COND_SCALAR_POSTFIX …
#define PACKET_DECL_COND_SCALAR …
template <typename LhsScalar_, typename RhsScalar_, bool ConjLhs_, bool ConjRhs_, int Arch, int PacketSize_>
class gebp_traits { … };
gebp_traits<std::complex<RealScalar>, RealScalar, ConjLhs_, false, Arch, PacketSize_>;
template <typename Packet>
struct DoublePacket { … };
template <typename Packet>
DoublePacket<Packet> padd(const DoublePacket<Packet>& a, const DoublePacket<Packet>& b) { … }
template <typename Packet>
const DoublePacket<Packet>& predux_half_dowto4(const DoublePacket<Packet>& a,
std::enable_if_t<unpacket_traits<Packet>::size <= 8>* = 0) { … }
template <typename Packet>
DoublePacket<typename unpacket_traits<Packet>::half> predux_half_dowto4(
const DoublePacket<Packet>& a, std::enable_if_t<unpacket_traits<Packet>::size == 16>* = 0) { … }
template <typename Scalar, typename RealPacket>
void loadQuadToDoublePacket(const Scalar* b, DoublePacket<RealPacket>& dest,
std::enable_if_t<unpacket_traits<RealPacket>::size <= 8>* = 0) { … }
template <typename Scalar, typename RealPacket>
void loadQuadToDoublePacket(const Scalar* b, DoublePacket<RealPacket>& dest,
std::enable_if_t<unpacket_traits<RealPacket>::size == 16>* = 0) { … }
unpacket_traits<DoublePacket<Packet>>;
gebp_traits<std::complex<RealScalar>, std::complex<RealScalar>, ConjLhs_, ConjRhs_, Arch, PacketSize_>;
gebp_traits<RealScalar, std::complex<RealScalar>, false, ConjRhs_, Arch, PacketSize_>;
template <typename LhsScalar, typename RhsScalar, typename Index, typename DataMapper, int mr, int nr,
bool ConjugateLhs, bool ConjugateRhs>
struct gebp_kernel { … };
template <typename LhsScalar, typename RhsScalar, typename Index, typename DataMapper, int mr, int nr,
bool ConjugateLhs, bool ConjugateRhs,
int SwappedLhsProgress =
gebp_traits<RhsScalar, LhsScalar, ConjugateRhs, ConjugateLhs, Architecture::Target>::LhsProgress>
struct last_row_process_16_packets { … };
last_row_process_16_packets<LhsScalar, RhsScalar, Index, DataMapper, mr, nr, ConjugateLhs, ConjugateRhs, 16>;
template <int nr, Index LhsProgress, Index RhsProgress, typename LhsScalar, typename RhsScalar, typename ResScalar,
typename AccPacket, typename LhsPacket, typename RhsPacket, typename ResPacket, typename GEBPTraits,
typename LinearMapper, typename DataMapper>
struct lhs_process_one_packet { … };
template <int nr, Index LhsProgress, Index RhsProgress, typename LhsScalar, typename RhsScalar, typename ResScalar,
typename AccPacket, typename LhsPacket, typename RhsPacket, typename ResPacket, typename GEBPTraits,
typename LinearMapper, typename DataMapper>
struct lhs_process_fraction_of_packet
: lhs_process_one_packet<nr, LhsProgress, RhsProgress, LhsScalar, RhsScalar, ResScalar, AccPacket, LhsPacket,
RhsPacket, ResPacket, GEBPTraits, LinearMapper, DataMapper> { … };
template <typename LhsScalar, typename RhsScalar, typename Index, typename DataMapper, int mr, int nr,
bool ConjugateLhs, bool ConjugateRhs>
EIGEN_DONT_INLINE void gebp_kernel<LhsScalar, RhsScalar, Index, DataMapper, mr, nr, ConjugateLhs,
ConjugateRhs>::operator()(const DataMapper& res, const LhsScalar* blockA,
const RhsScalar* blockB, Index rows, Index depth,
Index cols, ResScalar alpha, Index strideA, Index strideB,
Index offsetA, Index offsetB) { … }
gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Packet, ColMajor, Conjugate, PanelMode>;
template <typename Scalar, typename Index, typename DataMapper, int Pack1, int Pack2, typename Packet, bool Conjugate,
bool PanelMode>
EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Packet, ColMajor, Conjugate,
PanelMode>::operator()(Scalar* blockA, const DataMapper& lhs, Index depth,
Index rows, Index stride, Index offset) { … }
gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Packet, RowMajor, Conjugate, PanelMode>;
template <typename Scalar, typename Index, typename DataMapper, int Pack1, int Pack2, typename Packet, bool Conjugate,
bool PanelMode>
EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Packet, RowMajor, Conjugate,
PanelMode>::operator()(Scalar* blockA, const DataMapper& lhs, Index depth,
Index rows, Index stride, Index offset) { … }
gemm_pack_rhs<Scalar, Index, DataMapper, nr, ColMajor, Conjugate, PanelMode>;
template <typename Scalar, typename Index, typename DataMapper, int nr, bool Conjugate, bool PanelMode>
EIGEN_DONT_INLINE void gemm_pack_rhs<Scalar, Index, DataMapper, nr, ColMajor, Conjugate, PanelMode>::operator()(
Scalar* blockB, const DataMapper& rhs, Index depth, Index cols, Index stride, Index offset) { … }
gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMode>;
}
inline std::ptrdiff_t l1CacheSize() { … }
inline std::ptrdiff_t l2CacheSize() { … }
inline std::ptrdiff_t l3CacheSize() { … }
inline void setCpuCacheSizes(std::ptrdiff_t l1, std::ptrdiff_t l2, std::ptrdiff_t l3) { … }
}
#endif