Skip to content

Commit 650a062

Browse files
Add thread throttling profile for SGEMV on NEOVERSEV2
1 parent b723c1b commit 650a062

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ In chronological order:
240240
* Marek Michalowski <marek.michalowski@arm.com>
241241
* [2025-01-21] Add thread throttling profile for SGEMV on `NEOVERSEV1`
242242
* [2025-02-18] Add thread throttling profile for SGEMM on `NEOVERSEV2`
243+
* [2025-02-19] Add thread throttling profile for SGEMV on `NEOVERSEV2`
243244

244245
* Ye Tao <ye.tao@arm.com>
245246
* [2025-02-03] Optimize SBGEMM kernel on NEOVERSEV1

interface/gemv.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,30 @@ static inline int get_gemv_optimal_nthreads_neoversev1(BLASLONG MN, int ncpu) {
7777
}
7878
#endif
7979

80+
#if defined(DYNAMIC_ARCH) || defined(NEOVERSEV2)
81+
static inline int get_gemv_optimal_nthreads_neoversev2(BLASLONG MN, int ncpu) {
82+
return
83+
MN < 24964L ? 1
84+
: MN < 65536L ? MIN(ncpu, 8)
85+
: MN < 262144L ? MIN(ncpu, 32)
86+
: MN < 1638400L ? MIN(ncpu, 64)
87+
: ncpu;
88+
}
89+
#endif
90+
8091
static inline int get_gemv_optimal_nthreads(BLASLONG MN) {
8192
int ncpu = num_cpu_avail(3);
8293
#if defined(NEOVERSEV1) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16)
8394
return get_gemv_optimal_nthreads_neoversev1(MN, ncpu);
95+
#elif defined(NEOVERSEV2) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16)
96+
return get_gemv_optimal_nthreads_neoversev2(MN, ncpu);
8497
#elif defined(DYNAMIC_ARCH) && !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16)
8598
if (strcmp(gotoblas_corename(), "neoversev1") == 0) {
8699
return get_gemv_optimal_nthreads_neoversev1(MN, ncpu);
87100
}
101+
if (strcmp(gotoblas_corename(), "neoversev2") == 0) {
102+
return get_gemv_optimal_nthreads_neoversev2(MN, ncpu);
103+
}
88104
#endif
89105

90106
if ( MN < 115200L * GEMM_MULTITHREAD_THRESHOLD )

0 commit comments

Comments
 (0)