Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions Makefile.riscv64
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@ ifeq ($(CORE), x280)
CCOMMON_OPT += -march=rv64imafdcv_zba_zbb_zfh_zvl512b -mabi=lp64d
FCOMMON_OPT += -march=rv64imafdcv_zba_zbb_zfh -mabi=lp64d -static
endif
ifeq ($(CORE), RISCV64_ZVL256B)
RISCV64_OPT = rv64imafdcv
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since more than one option can be active, we need to start chaining compiler options for -march

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks.

ifeq ($(BUILD_HFLOAT16), 1)
CCOMMON_OPT += -march=rv64imafdcv_zvl256b_zvfh_zfh -mabi=lp64d
FCOMMON_OPT += -march=rv64imafdcv_zvfh_zfh -mabi=lp64d
else
CCOMMON_OPT += -march=rv64imafdcv_zvl256b -mabi=lp64d
FCOMMON_OPT += -march=rv64imafdcv -mabi=lp64d
RISCV64_OPT := $(RISCV64_OPT)_zvfh_zfh
endif
ifeq ($(BUILD_BFLOAT16), 1)
RISCV64_OPT := $(RISCV64_OPT)_zfbfmin_zvfbfmin_zvfbfwma
endif
ifeq ($(CORE), RISCV64_ZVL128B)
ifeq ($(BUILD_HFLOAT16), 1)
CCOMMON_OPT += -march=rv64imafdcv_zvfh_zfh -mabi=lp64d
FCOMMON_OPT += -march=rv64imafdcv_zvfh_zfh -mabi=lp64d
else
CCOMMON_OPT += -march=rv64imafdcv -mabi=lp64d
FCOMMON_OPT += -march=rv64imafdcv -mabi=lp64d
ifeq ($(CORE), RISCV64_ZVL256B)
CCOMMON_OPT += -march=$(RISCV64_OPT)_zvl256b -mabi=lp64d
FCOMMON_OPT += -march=$(RISCV64_OPT) -mabi=lp64d
endif
ifeq ($(CORE), RISCV64_ZVL128B)
CCOMMON_OPT += -march=$(RISCV64_OPT) -mabi=lp64d
FCOMMON_OPT += -march=$(RISCV64_OPT) -mabi=lp64d
endif
ifeq ($(CORE), RISCV64_GENERIC)
CCOMMON_OPT += -march=rv64imafdc -mabi=lp64d
Expand Down
13 changes: 12 additions & 1 deletion kernel/riscv64/KERNEL.RISCV64_ZVL128B
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ ifndef ZGEMM_BETA
ZGEMM_BETA = zgemm_beta_rvv.c
endif

ifeq ($(BUILD_BFLOAT16), 1)
ifeq ($(BUILD_HFLOAT16), 1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes a bug from the original RISCV64 SHGEMM MR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHGEMMKERNEL = shgemm_kernel_$(SHGEMM_UNROLL_M)x$(SHGEMM_UNROLL_N)_zvl128b.c
SHGEMMONCOPY = ../generic/gemm_ncopy_$(SHGEMM_UNROLL_N).c
SHGEMMOTCOPY = ../generic/gemm_tcopy_$(SHGEMM_UNROLL_N).c
Expand All @@ -267,5 +267,16 @@ SHGEMM_BETA = gemm_beta_rvv.c
endif
endif

ifeq ($(BUILD_BFLOAT16), 1)
SBGEMMKERNEL = sbgemm_kernel_$(SBGEMM_UNROLL_M)x$(SBGEMM_UNROLL_N)_zvl128b.c
SBGEMMONCOPY = ../generic/gemm_ncopy_$(SBGEMM_UNROLL_N).c
SBGEMMOTCOPY = ../generic/gemm_tcopy_$(SBGEMM_UNROLL_N).c
SBGEMMONCOPYOBJ = sbgemm_oncopy$(TSUFFIX).$(SUFFIX)
SBGEMMOTCOPYOBJ = sbgemm_otcopy$(TSUFFIX).$(SUFFIX)
ifndef SBGEMM_BETA
SBGEMM_BETA = gemm_beta_rvv.c
endif
endif

DOMATCOPY_CT = omatcopy_ct_rvv.c
SOMATCOPY_CT = omatcopy_ct_rvv.c
19 changes: 18 additions & 1 deletion kernel/riscv64/KERNEL.RISCV64_ZVL256B
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ DOMATCOPY_CT = omatcopy_ct_rvv.c
SOMATCOPY_CT = omatcopy_ct_rvv.c


ifeq ($(BUILD_BFLOAT16), 1)
ifeq ($(BUILD_HFLOAT16), 1)
SHGEMMKERNEL = shgemm_kernel_$(SHGEMM_UNROLL_M)x$(SHGEMM_UNROLL_N)_zvl256b.c
ifneq ($(SHGEMM_UNROLL_M), $(SHGEMM_UNROLL_N))
SHGEMMINCOPY = ../generic/gemm_ncopy_$(SHGEMM_UNROLL_M).c
Expand All @@ -240,5 +240,22 @@ SHGEMM_BETA = gemm_beta_rvv.c
endif
endif

ifeq ($(BUILD_BFLOAT16), 1)
SBGEMMKERNEL = sbgemm_kernel_$(SBGEMM_UNROLL_M)x$(SBGEMM_UNROLL_N)_zvl256b.c
ifneq ($(SBGEMM_UNROLL_M), $(SBGEMM_UNROLL_N))
SBGEMMINCOPY = ../generic/gemm_ncopy_$(SBGEMM_UNROLL_M).c
SBGEMMITCOPY = ../generic/gemm_tcopy_$(SBGEMM_UNROLL_M).c
SBGEMMINCOPYOBJ = sbgemm_incopy$(TSUFFIX).$(SUFFIX)
SBGEMMITCOPYOBJ = sbgemm_itcopy$(TSUFFIX).$(SUFFIX)
endif
SBGEMMONCOPY = ../generic/gemm_ncopy_$(SBGEMM_UNROLL_N).c
SBGEMMOTCOPY = ../generic/gemm_tcopy_$(SBGEMM_UNROLL_N).c
SBGEMMONCOPYOBJ = sbgemm_oncopy$(TSUFFIX).$(SUFFIX)
SBGEMMOTCOPYOBJ = sbgemm_otcopy$(TSUFFIX).$(SUFFIX)
ifndef SBGEMM_BETA
SBGEMM_BETA = gemm_beta_rvv.c
endif
endif

SAXPBYKERNEL = axpby_vector_v2.c
DAXPBYKERNEL = axpby_vector_v2.c
Loading
Loading