Skip to content

Commit 6bf687b

Browse files
authored
Make divide_rate and preferred_size available to DYNAMIC_ARCH too
1 parent b7601ea commit 6bf687b

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

common_param.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
typedef struct {
4848
int dtb_entries;
4949
int switch_ratio;
50+
int divide_rate;
5051
int divide_limit;
52+
int preferred_size;
5153
int offsetA, offsetB, align;
5254
#if BUILD_HFLOAT16 == 1
5355
int shgemm_p, shgemm_q, shgemm_r;

param.h

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -630,10 +630,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
630630

631631
#if defined(XDOUBLE) || defined(DOUBLE)
632632
#define SWITCH_RATIO 4
633-
#define GEMM_PREFERED_SIZE 4
633+
#define GEMM_PREFERRED_SIZE 4
634634
#else
635635
#define SWITCH_RATIO 8
636-
#define GEMM_PREFERED_SIZE 8
636+
#define GEMM_PREFERRED_SIZE 8
637637
#endif
638638

639639
#ifdef ARCH_X86
@@ -1539,10 +1539,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15391539

15401540
#if defined(XDOUBLE) || defined(DOUBLE)
15411541
#define SWITCH_RATIO 4
1542-
#define GEMM_PREFERED_SIZE 4
1542+
#define GEMM_PREFERRED_SIZE 4
15431543
#else
15441544
#define SWITCH_RATIO 8
1545-
#define GEMM_PREFERED_SIZE 8
1545+
#define GEMM_PREFERRED_SIZE 8
15461546
#endif
15471547

15481548
#ifdef ARCH_X86
@@ -1665,10 +1665,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16651665

16661666
#if defined(XDOUBLE) || defined(DOUBLE)
16671667
#define SWITCH_RATIO 8
1668-
#define GEMM_PREFERED_SIZE 8
1668+
#define GEMM_PREFERRED_SIZE 8
16691669
#else
16701670
#define SWITCH_RATIO 16
1671-
#define GEMM_PREFERED_SIZE 16
1671+
#define GEMM_PREFERRED_SIZE 16
16721672
#endif
16731673
#define USE_SGEMM_KERNEL_DIRECT 1
16741674

@@ -1786,10 +1786,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17861786

17871787
#if defined(XDOUBLE) || defined(DOUBLE)
17881788
#define SWITCH_RATIO 8
1789-
#define GEMM_PREFERED_SIZE 8
1789+
#define GEMM_PREFERRED_SIZE 8
17901790
#else
17911791
#define SWITCH_RATIO 16
1792-
#define GEMM_PREFERED_SIZE 16
1792+
#define GEMM_PREFERRED_SIZE 16
17931793
#endif
17941794
#define USE_SGEMM_KERNEL_DIRECT 1
17951795

@@ -1919,10 +1919,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19191919

19201920
#if defined(XDOUBLE) || defined(DOUBLE)
19211921
#define SWITCH_RATIO 8
1922-
#define GEMM_PREFERED_SIZE 8
1922+
#define GEMM_PREFERRED_SIZE 8
19231923
#else
19241924
#define SWITCH_RATIO 16
1925-
#define GEMM_PREFERED_SIZE 16
1925+
#define GEMM_PREFERRED_SIZE 16
19261926
#endif
19271927
#define USE_SGEMM_KERNEL_DIRECT 1
19281928

@@ -2577,7 +2577,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25772577
#define GEMM_DEFAULT_ALIGN 0x0ffffUL
25782578

25792579
#define SWITCH_RATIO 16
2580-
#define GEMM_PREFERED_SIZE 16
2580+
#define GEMM_PREFERRED_SIZE 16
25812581

25822582
#define SGEMM_DEFAULT_UNROLL_M 16
25832583
#define SGEMM_DEFAULT_UNROLL_N 8
@@ -2616,7 +2616,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26162616
#define GEMM_DEFAULT_ALIGN 0x0ffffUL
26172617

26182618
#define SWITCH_RATIO 16
2619-
#define GEMM_PREFERED_SIZE 16
2619+
#define GEMM_PREFERRED_SIZE 16
26202620

26212621
#define SGEMM_DEFAULT_UNROLL_M 16
26222622
#define SGEMM_DEFAULT_UNROLL_N 8
@@ -3611,10 +3611,10 @@ is a big desktop or server with abundant cache rather than a phone or embedded d
36113611

36123612
#if defined(XDOUBLE) || defined(DOUBLE)
36133613
#define SWITCH_RATIO 8
3614-
#define GEMM_PREFERED_SIZE 4
3614+
#define GEMM_PREFERRED_SIZE 4
36153615
#else
36163616
#define SWITCH_RATIO 16
3617-
#define GEMM_PREFERED_SIZE 8
3617+
#define GEMM_PREFERRED_SIZE 8
36183618
#endif
36193619

36203620
#undef BGEMM_ALIGN_K
@@ -3662,8 +3662,6 @@ is a big desktop or server with abundant cache rather than a phone or embedded d
36623662

36633663
#elif defined(NEOVERSEN2) || defined(NEOVERSEV2)
36643664

3665-
#define GEMM_DIVIDE_LIMIT 3
3666-
36673665
#if defined(XDOUBLE) || defined(DOUBLE)
36683666
#define SWITCH_RATIO 8
36693667
#else
@@ -3751,9 +3749,9 @@ is a big desktop or server with abundant cache rather than a phone or embedded d
37513749
#define GEMM_DIVIDE_RATE 1
37523750

37533751
#if defined(XDOUBLE) || defined(DOUBLE)
3754-
#define GEMM_PREFERED_SIZE 8
3752+
#define GEMM_PREFERRED_SIZE 8
37553753
#else
3756-
#define GEMM_PREFERED_SIZE 16
3754+
#define GEMM_PREFERRED_SIZE 16
37573755
#endif
37583756

37593757
/* When all BLAS3 routines are implemeted with SVE, SGEMM_DEFAULT_UNROLL_M should be "sve_vl".
@@ -4260,10 +4258,18 @@ Until then, just keep it different than DGEMM_DEFAULT_UNROLL_N to keep copy rout
42604258
#define SWITCH_RATIO 2
42614259
#endif
42624260

4261+
#ifndef GEMM_DIVIDE_RATE
4262+
#define GEMM_DIVIDE_RATE 2
4263+
#endif
4264+
42634265
#ifndef GEMM_DIVIDE_LIMIT
42644266
#define GEMM_DIVIDE_LIMIT 0
42654267
#endif
42664268

4269+
#ifndef GEMM_PREFERRED_SIZE
4270+
#define GEMM_PREFERRED_SIZE 1
4271+
#endif
4272+
42674273
#ifndef QGEMM_DEFAULT_UNROLL_M
42684274
#define QGEMM_DEFAULT_UNROLL_M 2
42694275
#endif

0 commit comments

Comments
 (0)