Skip to content

Commit 1d97405

Browse files
author
Rajalakshmi Srinivasaraghavan
committed
POWER: Enable bfloat16 kernels by default
This patch enables bfloat16 kernels by default for POWER processors. Tested on Linux POWER8, POWER9, POWER10 and AIX POWER10 systems.
1 parent 047a279 commit 1d97405

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Makefile.system

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ ifeq ($(ARCH), x86_64)
263263
SMALL_MATRIX_OPT = 1
264264
else ifeq ($(ARCH), power)
265265
SMALL_MATRIX_OPT = 1
266+
BUILD_BFLOAT16 = 1
266267
endif
267268
ifeq ($(SMALL_MATRIX_OPT), 1)
268269
CCOMMON_OPT += -DSMALL_MATRIX_OPT

test/compare_sgemm_sbgemm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,15 @@ typedef union
5151
float v;
5252
struct
5353
{
54+
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
55+
uint32_t s:1;
56+
uint32_t e:8;
57+
uint32_t m:23;
58+
#else
5459
uint32_t m:23;
5560
uint32_t e:8;
5661
uint32_t s:1;
62+
#endif
5763
} bits;
5864
} float32_bits;
5965

0 commit comments

Comments
 (0)