Skip to content

Commit

Permalink
Fix build issues with bfloat16
Browse files Browse the repository at this point in the history
This patch fixes compilation errors due to recent renaming from SH to SB
with BUILD_BFLOAT16.
  • Loading branch information
Rajalakshmi Srinivasaraghavan committed Oct 13, 2020
1 parent d85b968 commit b5d30b3
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 27 deletions.
4 changes: 2 additions & 2 deletions cblas.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ void cblas_zgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint

/*** BFLOAT16 and INT8 extensions ***/
/* convert float array to BFLOAT16 array by rounding */
void cblas_shstobf16(OPENBLAS_CONST blasint n, OPENBLAS_CONST float *in, OPENBLAS_CONST blasint incin, bfloat16 *out, OPENBLAS_CONST blasint incout);
void cblas_sbstobf16(OPENBLAS_CONST blasint n, OPENBLAS_CONST float *in, OPENBLAS_CONST blasint incin, bfloat16 *out, OPENBLAS_CONST blasint incout);
/* convert double array to BFLOAT16 array by rounding */
void cblas_shdtobf16(OPENBLAS_CONST blasint n, OPENBLAS_CONST double *in, OPENBLAS_CONST blasint incin, bfloat16 *out, OPENBLAS_CONST blasint incout);
void cblas_sbdtobf16(OPENBLAS_CONST blasint n, OPENBLAS_CONST double *in, OPENBLAS_CONST blasint incin, bfloat16 *out, OPENBLAS_CONST blasint incout);
/* convert BFLOAT16 array to float array */
void cblas_sbf16tos(OPENBLAS_CONST blasint n, OPENBLAS_CONST bfloat16 *in, OPENBLAS_CONST blasint incin, float *out, OPENBLAS_CONST blasint incout);
/* convert BFLOAT16 array to double array */
Expand Down
4 changes: 2 additions & 2 deletions common_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ double BLASFUNC(ddot) (blasint *, double *, blasint *, double *, blasint *);
xdouble BLASFUNC(qdot) (blasint *, xdouble *, blasint *, xdouble *, blasint *);

float BLASFUNC(sbdot) (blasint *, bfloat16 *, blasint *, bfloat16 *, blasint *);
void BLASFUNC(shstobf16) (blasint *, float *, blasint *, bfloat16 *, blasint *);
void BLASFUNC(shdtobf16) (blasint *, double *, blasint *, bfloat16 *, blasint *);
void BLASFUNC(sbstobf16) (blasint *, float *, blasint *, bfloat16 *, blasint *);
void BLASFUNC(sbdtobf16) (blasint *, double *, blasint *, bfloat16 *, blasint *);
void BLASFUNC(sbf16tos) (blasint *, bfloat16 *, blasint *, float *, blasint *);
void BLASFUNC(dbf16tod) (blasint *, bfloat16 *, blasint *, double *, blasint *);

Expand Down
4 changes: 2 additions & 2 deletions common_level1.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ double ddot_k(BLASLONG, double *, BLASLONG, double *, BLASLONG);
xdouble qdot_k(BLASLONG, xdouble *, BLASLONG, xdouble *, BLASLONG);
float sbdot_k(BLASLONG, bfloat16 *, BLASLONG, bfloat16 *, BLASLONG);

void shstobf16_k(BLASLONG, float *, BLASLONG, bfloat16 *, BLASLONG);
void shdtobf16_k(BLASLONG, double *, BLASLONG, bfloat16 *, BLASLONG);
void sbstobf16_k(BLASLONG, float *, BLASLONG, bfloat16 *, BLASLONG);
void sbdtobf16_k(BLASLONG, double *, BLASLONG, bfloat16 *, BLASLONG);
void sbf16tos_k (BLASLONG, bfloat16 *, BLASLONG, float *, BLASLONG);
void dbf16tod_k (BLASLONG, bfloat16 *, BLASLONG, double *, BLASLONG);

Expand Down
4 changes: 2 additions & 2 deletions common_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,9 @@

#elif defined(BFLOAT16)

#define D_TO_BF16_K SHDTOBF16_K
#define D_TO_BF16_K SBDTOBF16_K
#define D_BF16_TO_K DBF16TOD_K
#define S_TO_BF16_K SHSTOBF16_K
#define S_TO_BF16_K SBSTOBF16_K
#define S_BF16_TO_K SBF16TOS_K

#define AMAX_K SAMAX_K
Expand Down
4 changes: 2 additions & 2 deletions driver/level3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ USE_GEMM3M = 1
endif

ifeq ($(BUILD_BFLOAT16),1)
SHBLASOBJS += sbgemm_nn.$(SUFFIX) sbgemm_nt.$(SUFFIX) sbgemm_tn.$(SUFFIX) sbgemm_tt.$(SUFFIX)
SBBLASOBJS += sbgemm_nn.$(SUFFIX) sbgemm_nt.$(SUFFIX) sbgemm_tn.$(SUFFIX) sbgemm_tt.$(SUFFIX)
endif

SBLASOBJS += \
Expand Down Expand Up @@ -208,7 +208,7 @@ COMMONOBJS += syrk_thread.$(SUFFIX)

ifndef USE_SIMPLE_THREADED_LEVEL3
ifeq ($(BUILD_BFLOAT16),1)
SHBLASOBJS += sbgemm_thread_nn.$(SUFFIX) sbgemm_thread_nt.$(SUFFIX) sbgemm_thread_tn.$(SUFFIX) sbgemm_thread_tt.$(SUFFIX)
SBBLASOBJS += sbgemm_thread_nn.$(SUFFIX) sbgemm_thread_nt.$(SUFFIX) sbgemm_thread_tn.$(SUFFIX) sbgemm_thread_tt.$(SUFFIX)
endif
SBLASOBJS += sgemm_thread_nn.$(SUFFIX) sgemm_thread_nt.$(SUFFIX) sgemm_thread_tn.$(SUFFIX) sgemm_thread_tt.$(SUFFIX)
DBLASOBJS += dgemm_thread_nn.$(SUFFIX) dgemm_thread_nt.$(SUFFIX) dgemm_thread_tn.$(SUFFIX) dgemm_thread_tt.$(SUFFIX)
Expand Down
4 changes: 2 additions & 2 deletions exports/gensymbol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
zgeadd, dzsum);

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

@cblasobjs = ( cblas_xerbla );

@halfcblasobjs = (cblas_sbgemm, cblas_sbdot, cblas_shstobf16, cblas_shdtobf16, cblas_sbf16tos, cblas_dbf16tod);
@halfcblasobjs = (cblas_sbgemm, cblas_sbdot, cblas_sbstobf16, cblas_sbdtobf16, cblas_sbf16tos, cblas_dbf16tod);

@exblasobjs = (
qamax,qamin,qasum,qaxpy,qcabs1,qcopy,qdot,qgbmv,qgemm,
Expand Down
8 changes: 4 additions & 4 deletions interface/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -775,9 +775,9 @@ dsdot.$(SUFFIX) dsdot.$(PSUFFIX) : dsdot.c
ifeq ($(BUILD_BFLOAT16),1)
sbdot.$(SUFFIX) sbdot.$(PSUFFIX) : bf16dot.c
$(CC) $(CFLAGS) -c $< -o $(@F)
shstobf16.$(SUFFIX) shstobf16.$(PSUFFIX) : tobf16.c
sbstobf16.$(SUFFIX) sbstobf16.$(PSUFFIX) : tobf16.c
$(CC) $(CFLAGS) -DSINGLE_PREC -UDOUBLE_PREC -c $< -o $(@F)
shdtobf16.$(SUFFIX) shdtobf16.$(PSUFFIX) : tobf16.c
sbdtobf16.$(SUFFIX) sbdtobf16.$(PSUFFIX) : tobf16.c
$(CC) $(CFLAGS) -USINGLE_PREC -DDOUBLE_PREC -c $< -o $(@F)
sbf16tos.$(SUFFIX) sbf16tos.$(PSUFFIX) : bf16to.c
$(CC) $(CFLAGS) -DSINGLE_PREC -UDOUBLE_PREC -c $< -o $(@F)
Expand Down Expand Up @@ -1526,9 +1526,9 @@ cblas_dsdot.$(SUFFIX) cblas_dsdot.$(PSUFFIX) : dsdot.c
ifeq ($(BUILD_BFLOAT16),1)
cblas_sbdot.$(SUFFIX) cblas_sbdot.$(PSUFFIX) : bf16dot.c
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
cblas_shstobf16.$(SUFFIX) cblas_shstobf16.$(PSUFFIX) : tobf16.c
cblas_sbstobf16.$(SUFFIX) cblas_sbstobf16.$(PSUFFIX) : tobf16.c
$(CC) $(CFLAGS) -DCBLAS -DSINGLE_PREC -UDOUBLE_PREC -c $< -o $(@F)
cblas_shdtobf16.$(SUFFIX) cblas_shdtobf16.$(PSUFFIX) : tobf16.c
cblas_sbdtobf16.$(SUFFIX) cblas_sbdtobf16.$(PSUFFIX) : tobf16.c
$(CC) $(CFLAGS) -DCBLAS -USINGLE_PREC -DDOUBLE_PREC -c $< -o $(@F)
cblas_sbf16tos.$(SUFFIX) cblas_sbf16tos.$(PSUFFIX) : bf16to.c
$(CC) $(CFLAGS) -DCBLAS -DSINGLE_PREC -UDOUBLE_PREC -c $< -o $(@F)
Expand Down
6 changes: 3 additions & 3 deletions kernel/Makefile.L1
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,11 @@ XBLASOBJS += \
xscal_k$(TSUFFIX).$(SUFFIX) xswap_k$(TSUFFIX).$(SUFFIX) xsum_k$(TSUFFIX).$(SUFFIX)

ifeq ($(BUILD_BFLOAT16),1)
SHBLASOBJS += \
SBBLASOBJS += \
sbdot_k$(TSUFFIX).$(SUFFIX)
SHEXTOBJS += \
SBEXTOBJS += \
sbstobf16_k$(TSUFFIX).$(SUFFIX) sbdtobf16_k$(TSUFFIX).$(SUFFIX)
SHEXTOBJS += \
SBEXTOBJS += \
sbf16tos_k$(TSUFFIX).$(SUFFIX) dbf16tod_k$(TSUFFIX).$(SUFFIX)
endif

Expand Down
6 changes: 3 additions & 3 deletions kernel/Makefile.L3
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ SBGEMMONCOPYOBJ = sbgemm_oncopy$(TSUFFIX).$(SUFFIX)
SBGEMMOTCOPYOBJ = sbgemm_otcopy$(TSUFFIX).$(SUFFIX)
endif

SHKERNELOBJS += \
SBKERNELOBJS += \
sbgemm_kernel$(TSUFFIX).$(SUFFIX) \
$(SBGEMMINCOPYOBJ) $(SBGEMMITCOPYOBJ) \
$(SBGEMMONCOPYOBJ) $(SBGEMMOTCOPYOBJ)
Expand Down Expand Up @@ -150,7 +150,7 @@ XKERNELOBJS += \
$(XGEMMONCOPYOBJ) $(XGEMMOTCOPYOBJ)

ifeq ($(BUILD_BFLOAT16),1)
SHBLASOBJS += $(SHKERNELOBJS)
SBBLASOBJS += $(SBKERNELOBJS)
endif
SBLASOBJS += $(SKERNELOBJS)
DBLASOBJS += $(DKERNELOBJS)
Expand All @@ -160,7 +160,7 @@ ZBLASOBJS += $(ZKERNELOBJS)
XBLASOBJS += $(XKERNELOBJS)

ifeq ($(BUILD_BFLOAT16),1)
SHBLASOBJS += sbgemm_beta$(TSUFFIX).$(SUFFIX)
SBBLASOBJS += sbgemm_beta$(TSUFFIX).$(SUFFIX)
endif

ifneq "$(or $(BUILD_SINGLE),$(BUILD_DOUBLE))" ""
Expand Down
8 changes: 3 additions & 5 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,9 @@ endif



#ifeq ($(BUILD_BFLOAT16),1)
#level3 : test_sbgemm sblat3 dblat3 cblat3 zblat3
#else
#level3 : sblat3 dblat3 cblat3 zblat3
#endif
ifeq ($(BUILD_BFLOAT16),1)
level3 : test_sbgemm
endif

ifndef CROSS
rm -f ?BLAT3.SUMM
Expand Down

0 comments on commit b5d30b3

Please sign in to comment.