Skip to content

Commit 9b30a9a

Browse files
author
Kwok Cheung Yeung
committed
Make new RISC-V kernels work with DYNAMIC_ARCH enabled
If DYNAMIC_ARCH is enabled, then the various xGEMM_UNROLL_(M|N) macros expand to 'gotoblas-><parameter>', which prevent their use in macro conditionals as the value is only defined at runtime. To get around this, we use the xGEMM_UNROLL_(M|N)_DEFAULT macros instead, which should expand to a compile-time constant. As the tiling factors used in the tcopy/ncopy functions are selected by these at compile time as well, it does not result in reduced functionality as changing the tiling at runtime without changing tcopy/ncopy would result in incorrect results anyway.
1 parent 38d528c commit 9b30a9a

8 files changed

Lines changed: 16 additions & 16 deletions

kernel/riscv64/cgemm_kernel_zvl128b.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727

2828
#include "common.h"
2929

30-
#define M_BLOCKSIZE CGEMM_UNROLL_M
31-
#define N_BLOCKSIZE CGEMM_UNROLL_N
30+
#define M_BLOCKSIZE CGEMM_DEFAULT_UNROLL_M
31+
#define N_BLOCKSIZE CGEMM_DEFAULT_UNROLL_N
3232

3333
#if M_BLOCKSIZE == 4
3434
#define RVV_MUL __riscv_vfmul_vf_f32m1

kernel/riscv64/cgemm_kernel_zvl256b.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
#include "common.h"
2929

3030

31-
#define M_BLOCKSIZE CGEMM_UNROLL_M
32-
#define N_BLOCKSIZE CGEMM_UNROLL_N
31+
#define M_BLOCKSIZE CGEMM_DEFAULT_UNROLL_M
32+
#define N_BLOCKSIZE CGEMM_DEFAULT_UNROLL_N
3333

3434
#if M_BLOCKSIZE == 8
3535
#define RVV_MUL __riscv_vfmul_vf_f32m1

kernel/riscv64/dgemm_kernel_zvl128b.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727

2828
#include "common.h"
2929

30-
#define M_BLOCKSIZE DGEMM_UNROLL_M
31-
#define N_BLOCKSIZE DGEMM_UNROLL_N
30+
#define M_BLOCKSIZE DGEMM_DEFAULT_UNROLL_M
31+
#define N_BLOCKSIZE DGEMM_DEFAULT_UNROLL_N
3232

3333
#if M_BLOCKSIZE == 2
3434
#define RVV_MUL __riscv_vfmul_vf_f64m1

kernel/riscv64/dgemm_kernel_zvl256b.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727

2828
#include "common.h"
2929

30-
#define M_BLOCKSIZE DGEMM_UNROLL_M
31-
#define N_BLOCKSIZE DGEMM_UNROLL_N
30+
#define M_BLOCKSIZE DGEMM_DEFAULT_UNROLL_M
31+
#define N_BLOCKSIZE DGEMM_DEFAULT_UNROLL_N
3232

3333
#if M_BLOCKSIZE == 4
3434
#define RVV_MUL __riscv_vfmul_vf_f64m1

kernel/riscv64/sgemm_kernel_zvl128b.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727

2828
#include "common.h"
2929

30-
#define M_BLOCKSIZE SGEMM_UNROLL_M
31-
#define N_BLOCKSIZE SGEMM_UNROLL_N
30+
#define M_BLOCKSIZE SGEMM_DEFAULT_UNROLL_M
31+
#define N_BLOCKSIZE SGEMM_DEFAULT_UNROLL_N
3232

3333
#if M_BLOCKSIZE == 4
3434
#define RVV_MUL __riscv_vfmul_vf_f32m1

kernel/riscv64/sgemm_kernel_zvl256b.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727

2828
#include "common.h"
2929

30-
#define M_BLOCKSIZE SGEMM_UNROLL_M
31-
#define N_BLOCKSIZE SGEMM_UNROLL_N
30+
#define M_BLOCKSIZE SGEMM_DEFAULT_UNROLL_M
31+
#define N_BLOCKSIZE SGEMM_DEFAULT_UNROLL_N
3232

3333
#if M_BLOCKSIZE == 8
3434
#define RVV_MUL __riscv_vfmul_vf_f32m1

kernel/riscv64/zgemm_kernel_zvl128b.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727

2828
#include "common.h"
2929

30-
#define M_BLOCKSIZE ZGEMM_UNROLL_M
31-
#define N_BLOCKSIZE ZGEMM_UNROLL_N
30+
#define M_BLOCKSIZE ZGEMM_DEFAULT_UNROLL_M
31+
#define N_BLOCKSIZE ZGEMM_DEFAULT_UNROLL_N
3232

3333
#if M_BLOCKSIZE == 2
3434
#define RVV_MUL __riscv_vfmul_vf_f64m1

kernel/riscv64/zgemm_kernel_zvl256b.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727

2828
#include "common.h"
2929

30-
#define M_BLOCKSIZE ZGEMM_UNROLL_M
31-
#define N_BLOCKSIZE ZGEMM_UNROLL_N
30+
#define M_BLOCKSIZE ZGEMM_DEFAULT_UNROLL_M
31+
#define N_BLOCKSIZE ZGEMM_DEFAULT_UNROLL_N
3232

3333
#if M_BLOCKSIZE == 4
3434
#define RVV_MUL __riscv_vfmul_vf_f64m1

0 commit comments

Comments
 (0)