Skip to content

Commit 602a0c7

Browse files
authored
Merge pull request #2892 from RajalakshmiSR/bf16_make
Fix build issues with bfloat16
2 parents d85b968 + b5d30b3 commit 602a0c7

File tree

10 files changed

+25
-27
lines changed

10 files changed

+25
-27
lines changed

cblas.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ void cblas_zgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint
384384

385385
/*** BFLOAT16 and INT8 extensions ***/
386386
/* convert float array to BFLOAT16 array by rounding */
387-
void cblas_shstobf16(OPENBLAS_CONST blasint n, OPENBLAS_CONST float *in, OPENBLAS_CONST blasint incin, bfloat16 *out, OPENBLAS_CONST blasint incout);
387+
void cblas_sbstobf16(OPENBLAS_CONST blasint n, OPENBLAS_CONST float *in, OPENBLAS_CONST blasint incin, bfloat16 *out, OPENBLAS_CONST blasint incout);
388388
/* convert double array to BFLOAT16 array by rounding */
389-
void cblas_shdtobf16(OPENBLAS_CONST blasint n, OPENBLAS_CONST double *in, OPENBLAS_CONST blasint incin, bfloat16 *out, OPENBLAS_CONST blasint incout);
389+
void cblas_sbdtobf16(OPENBLAS_CONST blasint n, OPENBLAS_CONST double *in, OPENBLAS_CONST blasint incin, bfloat16 *out, OPENBLAS_CONST blasint incout);
390390
/* convert BFLOAT16 array to float array */
391391
void cblas_sbf16tos(OPENBLAS_CONST blasint n, OPENBLAS_CONST bfloat16 *in, OPENBLAS_CONST blasint incin, float *out, OPENBLAS_CONST blasint incout);
392392
/* convert BFLOAT16 array to double array */

common_interface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ double BLASFUNC(ddot) (blasint *, double *, blasint *, double *, blasint *);
5555
xdouble BLASFUNC(qdot) (blasint *, xdouble *, blasint *, xdouble *, blasint *);
5656

5757
float BLASFUNC(sbdot) (blasint *, bfloat16 *, blasint *, bfloat16 *, blasint *);
58-
void BLASFUNC(shstobf16) (blasint *, float *, blasint *, bfloat16 *, blasint *);
59-
void BLASFUNC(shdtobf16) (blasint *, double *, blasint *, bfloat16 *, blasint *);
58+
void BLASFUNC(sbstobf16) (blasint *, float *, blasint *, bfloat16 *, blasint *);
59+
void BLASFUNC(sbdtobf16) (blasint *, double *, blasint *, bfloat16 *, blasint *);
6060
void BLASFUNC(sbf16tos) (blasint *, bfloat16 *, blasint *, float *, blasint *);
6161
void BLASFUNC(dbf16tod) (blasint *, bfloat16 *, blasint *, double *, blasint *);
6262

common_level1.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ double ddot_k(BLASLONG, double *, BLASLONG, double *, BLASLONG);
4848
xdouble qdot_k(BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG);
4949
float sbdot_k(BLASLONG, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG);
5050

51-
void shstobf16_k(BLASLONG, float *, BLASLONG, bfloat16 *, BLASLONG);
52-
void shdtobf16_k(BLASLONG, double *, BLASLONG, bfloat16 *, BLASLONG);
51+
void sbstobf16_k(BLASLONG, float *, BLASLONG, bfloat16 *, BLASLONG);
52+
void sbdtobf16_k(BLASLONG, double *, BLASLONG, bfloat16 *, BLASLONG);
5353
void sbf16tos_k (BLASLONG, bfloat16 *, BLASLONG, float *, BLASLONG);
5454
void dbf16tod_k (BLASLONG, bfloat16 *, BLASLONG, double *, BLASLONG);
5555

common_macro.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,9 @@
646646

647647
#elif defined(BFLOAT16)
648648

649-
#define D_TO_BF16_K SHDTOBF16_K
649+
#define D_TO_BF16_K SBDTOBF16_K
650650
#define D_BF16_TO_K DBF16TOD_K
651-
#define S_TO_BF16_K SHSTOBF16_K
651+
#define S_TO_BF16_K SBSTOBF16_K
652652
#define S_BF16_TO_K SBF16TOS_K
653653

654654
#define AMAX_K SAMAX_K

driver/level3/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ USE_GEMM3M = 1
2020
endif
2121

2222
ifeq ($(BUILD_BFLOAT16),1)
23-
SHBLASOBJS += sbgemm_nn.$(SUFFIX) sbgemm_nt.$(SUFFIX) sbgemm_tn.$(SUFFIX) sbgemm_tt.$(SUFFIX)
23+
SBBLASOBJS += sbgemm_nn.$(SUFFIX) sbgemm_nt.$(SUFFIX) sbgemm_tn.$(SUFFIX) sbgemm_tt.$(SUFFIX)
2424
endif
2525

2626
SBLASOBJS += \
@@ -208,7 +208,7 @@ COMMONOBJS += syrk_thread.$(SUFFIX)
208208

209209
ifndef USE_SIMPLE_THREADED_LEVEL3
210210
ifeq ($(BUILD_BFLOAT16),1)
211-
SHBLASOBJS += sbgemm_thread_nn.$(SUFFIX) sbgemm_thread_nt.$(SUFFIX) sbgemm_thread_tn.$(SUFFIX) sbgemm_thread_tt.$(SUFFIX)
211+
SBBLASOBJS += sbgemm_thread_nn.$(SUFFIX) sbgemm_thread_nt.$(SUFFIX) sbgemm_thread_tn.$(SUFFIX) sbgemm_thread_tt.$(SUFFIX)
212212
endif
213213
SBLASOBJS += sgemm_thread_nn.$(SUFFIX) sgemm_thread_nt.$(SUFFIX) sgemm_thread_tn.$(SUFFIX) sgemm_thread_tt.$(SUFFIX)
214214
DBLASOBJS += dgemm_thread_nn.$(SUFFIX) dgemm_thread_nt.$(SUFFIX) dgemm_thread_tn.$(SUFFIX) dgemm_thread_tt.$(SUFFIX)

exports/gensymbol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
zgeadd, dzsum);
5252

5353
@cblasobjs = (lsame, xerbla);
54-
@halfblasobjs = (sbgemm, sbdot, shstobf16, shdtobf16, sbf16tos, dbf16tod);
54+
@halfblasobjs = (sbgemm, sbdot, sbstobf16, sbdtobf16, sbf16tos, dbf16tod);
5555
@cblasobjsc = (
5656
cblas_caxpy, cblas_ccopy, cblas_cdotc, cblas_cdotu, cblas_cgbmv, cblas_cgemm, cblas_cgemv,
5757
cblas_cgerc, cblas_cgeru, cblas_chbmv, cblas_chemm, cblas_chemv, cblas_cher2, cblas_cher2k,
@@ -94,7 +94,7 @@
9494

9595
@cblasobjs = ( cblas_xerbla );
9696

97-
@halfcblasobjs = (cblas_sbgemm, cblas_sbdot, cblas_shstobf16, cblas_shdtobf16, cblas_sbf16tos, cblas_dbf16tod);
97+
@halfcblasobjs = (cblas_sbgemm, cblas_sbdot, cblas_sbstobf16, cblas_sbdtobf16, cblas_sbf16tos, cblas_dbf16tod);
9898

9999
@exblasobjs = (
100100
qamax,qamin,qasum,qaxpy,qcabs1,qcopy,qdot,qgbmv,qgemm,

interface/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,9 +775,9 @@ dsdot.$(SUFFIX) dsdot.$(PSUFFIX) : dsdot.c
775775
ifeq ($(BUILD_BFLOAT16),1)
776776
sbdot.$(SUFFIX) sbdot.$(PSUFFIX) : bf16dot.c
777777
$(CC) $(CFLAGS) -c $< -o $(@F)
778-
shstobf16.$(SUFFIX) shstobf16.$(PSUFFIX) : tobf16.c
778+
sbstobf16.$(SUFFIX) sbstobf16.$(PSUFFIX) : tobf16.c
779779
$(CC) $(CFLAGS) -DSINGLE_PREC -UDOUBLE_PREC -c $< -o $(@F)
780-
shdtobf16.$(SUFFIX) shdtobf16.$(PSUFFIX) : tobf16.c
780+
sbdtobf16.$(SUFFIX) sbdtobf16.$(PSUFFIX) : tobf16.c
781781
$(CC) $(CFLAGS) -USINGLE_PREC -DDOUBLE_PREC -c $< -o $(@F)
782782
sbf16tos.$(SUFFIX) sbf16tos.$(PSUFFIX) : bf16to.c
783783
$(CC) $(CFLAGS) -DSINGLE_PREC -UDOUBLE_PREC -c $< -o $(@F)
@@ -1526,9 +1526,9 @@ cblas_dsdot.$(SUFFIX) cblas_dsdot.$(PSUFFIX) : dsdot.c
15261526
ifeq ($(BUILD_BFLOAT16),1)
15271527
cblas_sbdot.$(SUFFIX) cblas_sbdot.$(PSUFFIX) : bf16dot.c
15281528
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
1529-
cblas_shstobf16.$(SUFFIX) cblas_shstobf16.$(PSUFFIX) : tobf16.c
1529+
cblas_sbstobf16.$(SUFFIX) cblas_sbstobf16.$(PSUFFIX) : tobf16.c
15301530
$(CC) $(CFLAGS) -DCBLAS -DSINGLE_PREC -UDOUBLE_PREC -c $< -o $(@F)
1531-
cblas_shdtobf16.$(SUFFIX) cblas_shdtobf16.$(PSUFFIX) : tobf16.c
1531+
cblas_sbdtobf16.$(SUFFIX) cblas_sbdtobf16.$(PSUFFIX) : tobf16.c
15321532
$(CC) $(CFLAGS) -DCBLAS -USINGLE_PREC -DDOUBLE_PREC -c $< -o $(@F)
15331533
cblas_sbf16tos.$(SUFFIX) cblas_sbf16tos.$(PSUFFIX) : bf16to.c
15341534
$(CC) $(CFLAGS) -DCBLAS -DSINGLE_PREC -UDOUBLE_PREC -c $< -o $(@F)

kernel/Makefile.L1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,11 +531,11 @@ XBLASOBJS += \
531531
xscal_k$(TSUFFIX).$(SUFFIX) xswap_k$(TSUFFIX).$(SUFFIX) xsum_k$(TSUFFIX).$(SUFFIX)
532532

533533
ifeq ($(BUILD_BFLOAT16),1)
534-
SHBLASOBJS += \
534+
SBBLASOBJS += \
535535
sbdot_k$(TSUFFIX).$(SUFFIX)
536-
SHEXTOBJS += \
536+
SBEXTOBJS += \
537537
sbstobf16_k$(TSUFFIX).$(SUFFIX) sbdtobf16_k$(TSUFFIX).$(SUFFIX)
538-
SHEXTOBJS += \
538+
SBEXTOBJS += \
539539
sbf16tos_k$(TSUFFIX).$(SUFFIX) dbf16tod_k$(TSUFFIX).$(SUFFIX)
540540
endif
541541

kernel/Makefile.L3

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ SBGEMMONCOPYOBJ = sbgemm_oncopy$(TSUFFIX).$(SUFFIX)
9494
SBGEMMOTCOPYOBJ = sbgemm_otcopy$(TSUFFIX).$(SUFFIX)
9595
endif
9696

97-
SHKERNELOBJS += \
97+
SBKERNELOBJS += \
9898
sbgemm_kernel$(TSUFFIX).$(SUFFIX) \
9999
$(SBGEMMINCOPYOBJ) $(SBGEMMITCOPYOBJ) \
100100
$(SBGEMMONCOPYOBJ) $(SBGEMMOTCOPYOBJ)
@@ -150,7 +150,7 @@ XKERNELOBJS += \
150150
$(XGEMMONCOPYOBJ) $(XGEMMOTCOPYOBJ)
151151

152152
ifeq ($(BUILD_BFLOAT16),1)
153-
SHBLASOBJS += $(SHKERNELOBJS)
153+
SBBLASOBJS += $(SBKERNELOBJS)
154154
endif
155155
SBLASOBJS += $(SKERNELOBJS)
156156
DBLASOBJS += $(DKERNELOBJS)
@@ -160,7 +160,7 @@ ZBLASOBJS += $(ZKERNELOBJS)
160160
XBLASOBJS += $(XKERNELOBJS)
161161

162162
ifeq ($(BUILD_BFLOAT16),1)
163-
SHBLASOBJS += sbgemm_beta$(TSUFFIX).$(SUFFIX)
163+
SBBLASOBJS += sbgemm_beta$(TSUFFIX).$(SUFFIX)
164164
endif
165165

166166
ifneq "$(or $(BUILD_SINGLE),$(BUILD_DOUBLE))" ""

test/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,9 @@ endif
214214

215215

216216

217-
#ifeq ($(BUILD_BFLOAT16),1)
218-
#level3 : test_sbgemm sblat3 dblat3 cblat3 zblat3
219-
#else
220-
#level3 : sblat3 dblat3 cblat3 zblat3
221-
#endif
217+
ifeq ($(BUILD_BFLOAT16),1)
218+
level3 : test_sbgemm
219+
endif
222220

223221
ifndef CROSS
224222
rm -f ?BLAT3.SUMM

0 commit comments

Comments
 (0)