Eigen  5.0.1
 
Loading...
Searching...
No Matches
GeneralBlockPanelKernel.h
1// IWYU pragma: private
2// SPDX-FileCopyrightText: The Eigen Authors
3// SPDX-License-Identifier: MPL-2.0
4#include "../../InternalHeaderCheck.h"
5
6namespace Eigen {
7namespace internal {
8
9// The generic gebp_traits declares nr = 4, and until this header existed the SVE
10// backend took it: an SVE build measured a 6x4 register block where the NEON
11// build of the same source measured 6x8. Isolated by forcing the NEON build to
12// nr = 4, which cost it about 15% of its double GEMM rate -- the whole of the
13// remaining gap between the two backends once double was vectorized at all.
14//
15// Only nr is overridden. NEON additionally replaces the RHS machinery because
16// vfmaq_laneq_f64 needs an immediate lane index into a real vector; SVE's
17// equivalent selects a lane within each 128-bit segment rather than across the
18// vector, so it is not a drop-in at vector lengths above 128 bits, and the
19// generic QuadPacket path -- pbroadcast4 to svdup, madd to svmla -- already
20// emits what a hand-written version would.
21#ifndef EIGEN_SVE_GEBP_NR
22#define EIGEN_SVE_GEBP_NR 8
23#endif
24
25template <>
26struct gebp_traits<float, float, false, false, Architecture::SVE, GEBPPacketFull>
27 : gebp_traits<float, float, false, false, Architecture::Generic, GEBPPacketFull> {
28 enum { nr = EIGEN_SVE_GEBP_NR };
29};
30
31template <>
32struct gebp_traits<double, double, false, false, Architecture::SVE, GEBPPacketFull>
33 : gebp_traits<double, double, false, false, Architecture::Generic, GEBPPacketFull> {
34 enum { nr = EIGEN_SVE_GEBP_NR };
35};
36
37} // namespace internal
38} // namespace Eigen