Skip to content

Commit ff3eb1d

Browse files
authored
Merge pull request #1904 from martin-frbg/issue1870
Fix cmake parsing of GEMM kernels for ARMV8
2 parents 0b09516 + 7639f2e commit ff3eb1d

File tree

2 files changed

+35
-33
lines changed

2 files changed

+35
-33
lines changed

kernel/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,13 @@ function (build_core TARGET_CORE KDIR TSUFFIX KERNEL_DEFINITIONS)
125125
set(USE_TRMM true)
126126
endif ()
127127

128-
foreach (float_type ${FLOAT_TYPES})
128+
foreach (float_type SINGLE DOUBLE)
129129
string(SUBSTRING ${float_type} 0 1 float_char)
130130
GenerateNamedObjects("${KERNELDIR}/${${float_char}GEMMKERNEL}" "" "gemm_kernel" false "" "" false ${float_type})
131+
endforeach()
131132

133+
foreach (float_type ${FLOAT_TYPES})
134+
string(SUBSTRING ${float_type} 0 1 float_char)
132135
if (${float_char}GEMMINCOPY)
133136
GenerateNamedObjects("${KERNELDIR}/${${float_char}GEMMINCOPY}" "${float_type}" "${${float_char}GEMMINCOPYOBJ}" false "" "" true ${float_type})
134137
endif ()

kernel/arm64/KERNEL.ARMV8

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,38 @@ CDOTKERNEL = zdot.S
104104
ZDOTKERNEL = zdot.S
105105
DSDOTKERNEL = dot.S
106106

107-
ifneq ($(OS_DARWIN)$(CROSS),11)
107+
ifeq ($(OS_DARWIN)$(CROSS),11)
108+
109+
STRMMKERNEL = ../generic/trmmkernel_2x2.c
110+
DTRMMKERNEL = ../generic/trmmkernel_2x2.c
111+
CTRMMKERNEL = ../generic/ztrmmkernel_2x2.c
112+
ZTRMMKERNEL = ../generic/ztrmmkernel_2x2.c
113+
114+
SGEMMKERNEL = ../generic/gemmkernel_2x2.c
115+
SGEMMONCOPY = ../generic/gemm_ncopy_2.c
116+
SGEMMOTCOPY = ../generic/gemm_tcopy_2.c
117+
SGEMMONCOPYOBJ = sgemm_oncopy$(TSUFFIX).$(SUFFIX)
118+
SGEMMOTCOPYOBJ = sgemm_otcopy$(TSUFFIX).$(SUFFIX)
108119

120+
DGEMMKERNEL = ../generic/gemmkernel_2x2.c
121+
DGEMMONCOPY = ../generic/gemm_ncopy_2.c
122+
DGEMMOTCOPY = ../generic/gemm_tcopy_2.c
123+
DGEMMONCOPYOBJ = dgemm_oncopy$(TSUFFIX).$(SUFFIX)
124+
DGEMMOTCOPYOBJ = dgemm_otcopy$(TSUFFIX).$(SUFFIX)
125+
126+
CGEMMKERNEL = ../generic/zgemmkernel_2x2.c
127+
CGEMMONCOPY = ../generic/zgemm_ncopy_2.c
128+
CGEMMOTCOPY = ../generic/zgemm_tcopy_2.c
129+
CGEMMONCOPYOBJ = cgemm_oncopy$(TSUFFIX).$(SUFFIX)
130+
CGEMMOTCOPYOBJ = cgemm_otcopy$(TSUFFIX).$(SUFFIX)
131+
132+
ZGEMMKERNEL = ../generic/zgemmkernel_2x2.c
133+
ZGEMMONCOPY = ../generic/zgemm_ncopy_2.c
134+
ZGEMMOTCOPY = ../generic/zgemm_tcopy_2.c
135+
ZGEMMONCOPYOBJ = zgemm_oncopy$(TSUFFIX).$(SUFFIX)
136+
ZGEMMOTCOPYOBJ = zgemm_otcopy$(TSUFFIX).$(SUFFIX)
137+
138+
else
109139
SGEMMKERNEL = sgemm_kernel_$(SGEMM_UNROLL_M)x$(SGEMM_UNROLL_N).S
110140
STRMMKERNEL = strmm_kernel_$(SGEMM_UNROLL_M)x$(SGEMM_UNROLL_N).S
111141
ifneq ($(SGEMM_UNROLL_M), $(SGEMM_UNROLL_N))
@@ -173,35 +203,4 @@ ZGEMMOTCOPY = ../generic/zgemm_tcopy_$(ZGEMM_UNROLL_N).c
173203
ZGEMMONCOPYOBJ = zgemm_oncopy$(TSUFFIX).$(SUFFIX)
174204
ZGEMMOTCOPYOBJ = zgemm_otcopy$(TSUFFIX).$(SUFFIX)
175205

176-
else
177-
178-
STRMMKERNEL = ../generic/trmmkernel_2x2.c
179-
DTRMMKERNEL = ../generic/trmmkernel_2x2.c
180-
CTRMMKERNEL = ../generic/ztrmmkernel_2x2.c
181-
ZTRMMKERNEL = ../generic/ztrmmkernel_2x2.c
182-
183-
SGEMMKERNEL = ../generic/gemmkernel_2x2.c
184-
SGEMMONCOPY = ../generic/gemm_ncopy_2.c
185-
SGEMMOTCOPY = ../generic/gemm_tcopy_2.c
186-
SGEMMONCOPYOBJ = sgemm_oncopy$(TSUFFIX).$(SUFFIX)
187-
SGEMMOTCOPYOBJ = sgemm_otcopy$(TSUFFIX).$(SUFFIX)
188-
189-
DGEMMKERNEL = ../generic/gemmkernel_2x2.c
190-
DGEMMONCOPY = ../generic/gemm_ncopy_2.c
191-
DGEMMOTCOPY = ../generic/gemm_tcopy_2.c
192-
DGEMMONCOPYOBJ = dgemm_oncopy$(TSUFFIX).$(SUFFIX)
193-
DGEMMOTCOPYOBJ = dgemm_otcopy$(TSUFFIX).$(SUFFIX)
194-
195-
CGEMMKERNEL = ../generic/zgemmkernel_2x2.c
196-
CGEMMONCOPY = ../generic/zgemm_ncopy_2.c
197-
CGEMMOTCOPY = ../generic/zgemm_tcopy_2.c
198-
CGEMMONCOPYOBJ = cgemm_oncopy$(TSUFFIX).$(SUFFIX)
199-
CGEMMOTCOPYOBJ = cgemm_otcopy$(TSUFFIX).$(SUFFIX)
200-
201-
ZGEMMKERNEL = ../generic/zgemmkernel_2x2.c
202-
ZGEMMONCOPY = ../generic/zgemm_ncopy_2.c
203-
ZGEMMOTCOPY = ../generic/zgemm_tcopy_2.c
204-
ZGEMMONCOPYOBJ = zgemm_oncopy$(TSUFFIX).$(SUFFIX)
205-
ZGEMMOTCOPYOBJ = zgemm_otcopy$(TSUFFIX).$(SUFFIX)
206-
207206
endif

0 commit comments

Comments
 (0)