Skip to content

Commit e3a29f6

Browse files
authored
Change "HALF" and "sh" to "BFLOAT16" and "sb"
1 parent 006c7f6 commit e3a29f6

File tree

4 files changed

+41
-36
lines changed

4 files changed

+41
-36
lines changed

cmake/kernel.cmake

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ macro(SetDefaultL1)
113113
set(ZSUMKERNEL zsum.S)
114114
set(QSUMKERNEL sum.S)
115115
set(XSUMKERNEL zsum.S)
116-
if (BUILD_HALF)
116+
if (BUILD_BFLOAT16)
117117
set(SHAMINKERNEL ../arm/amin.c)
118118
set(SHAMAXKERNEL ../arm/amax.c)
119119
set(SHMAXKERNEL ../arm/max.c)
@@ -126,7 +126,7 @@ if (BUILD_HALF)
126126
set(SHAXPYKERNEL ../arm/axpy.c)
127127
set(SHAXPBYKERNEL ../arm/axpby.c)
128128
set(SHCOPYKERNEL ../arm/copy.c)
129-
set(SHDOTKERNEL ../x86_64/shdot.c)
129+
set(SBDOTKERNEL ../x86_64/sbdot.c)
130130
set(SHROTKERNEL ../arm/rot.c)
131131
set(SHSCALKERNEL ../arm/scal.c)
132132
set(SHNRM2KERNEL ../arm/nrm2.c)
@@ -183,9 +183,9 @@ macro(SetDefaultL2)
183183
set(XHEMV_L_KERNEL ../generic/zhemv_k.c)
184184
set(XHEMV_V_KERNEL ../generic/zhemv_k.c)
185185
set(XHEMV_M_KERNEL ../generic/zhemv_k.c)
186-
if (BUILD_HALF)
187-
set(SHGEMVNKERNEL ../arm/gemv_n.c)
188-
set(SHGEMVTKERNEL ../arm/gemv_t.c)
186+
if (BUILD_BFLOAT16)
187+
set(SBGEMVNKERNEL ../arm/gemv_n.c)
188+
set(SBGEMVTKERNEL ../arm/gemv_t.c)
189189
set(SHGERKERNEL ../generic/ger.c)
190190
endif ()
191191
endmacro ()
@@ -195,18 +195,18 @@ macro(SetDefaultL3)
195195
set(DGEADD_KERNEL ../generic/geadd.c)
196196
set(CGEADD_KERNEL ../generic/zgeadd.c)
197197
set(ZGEADD_KERNEL ../generic/zgeadd.c)
198-
if (BUILD_HALF)
198+
if (BUILD_BFLOAT16)
199199
set(SHGEADD_KERNEL ../generic/geadd.c)
200-
set(SHGEMMKERNEL ../generic/gemmkernel_2x2.c)
201-
set(SHGEMM_BETA ../generic/gemm_beta.c)
202-
set(SHGEMMINCOPY ../generic/gemm_ncopy_2.c)
203-
set(SHGEMMITCOPY ../generic/gemm_tcopy_2.c)
204-
set(SHGEMMONCOPY ../generic/gemm_ncopy_2.c)
205-
set(SHGEMMOTCOPY ../generic/gemm_tcopy_2.c)
206-
set(SHGEMMINCOPYOBJ shgemm_incopy.o)
207-
set(SHGEMMITCOPYOBJ shgemm_itcopy.o)
208-
set(SHGEMMONCOPYOBJ shgemm_oncopy.o)
209-
set(SHGEMMOTCOPYOBJ shgemm_otcopy.o)
200+
set(SBGEMMKERNEL ../generic/gemmkernel_2x2.c)
201+
set(SBGEMM_BETA ../generic/gemm_beta.c)
202+
set(SBGEMMINCOPY ../generic/gemm_ncopy_2.c)
203+
set(SBGEMMITCOPY ../generic/gemm_tcopy_2.c)
204+
set(SBGEMMONCOPY ../generic/gemm_ncopy_2.c)
205+
set(SBGEMMOTCOPY ../generic/gemm_tcopy_2.c)
206+
set(SBGEMMINCOPYOBJ sbgemm_incopy.o)
207+
set(SBGEMMITCOPYOBJ sbgemm_itcopy.o)
208+
set(SBGEMMONCOPYOBJ sbgemm_oncopy.o)
209+
set(SBGEMMOTCOPYOBJ sbgemm_otcopy.o)
210210
endif ()
211211

212212
endmacro ()

cmake/prebuild.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# HAVE_SSE2
1717
# HAVE_SSE3
1818
# MAKE
19-
# SHGEMM_UNROLL_M
20-
# SHGEMM_UNROLL_N
19+
# SBGEMM_UNROLL_M
20+
# SBGEMM_UNROLL_N
2121
# SGEMM_UNROLL_M
2222
# SGEMM_UNROLL_N
2323
# DGEMM_UNROLL_M
@@ -471,8 +471,8 @@ endif ()
471471
set(ZGEMM_UNROLL_N 2)
472472
set(SYMV_P 8)
473473
endif()
474-
set(SHGEMM_UNROLL_M 8)
475-
set(SHGEMM_UNROLL_N 4)
474+
set(SBGEMM_UNROLL_M 8)
475+
set(SBGEMM_UNROLL_N 4)
476476

477477
# Or should this actually be NUM_CORES?
478478
if (${NUM_THREADS} GREATER 0)

cmake/system.cmake

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ if (DEFINED TARGET)
7070
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2")
7171
endif()
7272
endif()
73+
if (DEFINED HAVE_SSE3)
74+
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3")
75+
endif()
7376
endif()
7477

7578
if (DEFINED TARGET)
@@ -323,7 +326,13 @@ else ()
323326
set(CCOMMON_OPT "${CCOMMON_OPT} -DMAX_STACK_ALLOC=2048")
324327
endif ()
325328
endif ()
326-
329+
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
330+
if (DEFINED BLAS3_MEM_ALLOC_THRESHOLD)
331+
if (NOT ${BLAS3_MEM_ALLOC_THRESHOLD} EQUAL 32)
332+
set(CCOMMON_OPT "${CCOMMON_OPT} -DBLAS3_MEM_ALLOC_THRESHOLD=${BLAS3_MEM_ALLOC_THRESHOLD}")
333+
endif()
334+
endif()
335+
endif()
327336
if (DEFINED LIBNAMESUFFIX)
328337
set(LIBPREFIX "libopenblas_${LIBNAMESUFFIX}")
329338
else ()
@@ -401,20 +410,16 @@ if (NOT BUILD_SINGLE AND NOT BUILD_DOUBLE AND NOT BUILD_COMPLEX AND NOT BUILD_CO
401410
set (BUILD_COMPLEX16 ON)
402411
endif()
403412
if (BUILD_SINGLE)
404-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_SINGLE=1")
405-
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_SINGLE=1")
413+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_SINGLE")
406414
endif()
407415
if (BUILD_DOUBLE)
408-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_DOUBLE=1")
409-
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_SINGLE=1")
416+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_DOUBLE")
410417
endif()
411418
if (BUILD_COMPLEX)
412-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX=1")
413-
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_COMPLEX=1")
419+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX")
414420
endif()
415421
if (BUILD_COMPLEX16)
416-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX16=1")
417-
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_COMPLEX16=1")
422+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX16")
418423
endif()
419424
if(NOT MSVC)
420425
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CCOMMON_OPT}")
@@ -588,8 +593,8 @@ endif ()
588593
#export FUNCTION_PROFILE
589594
#export TARGET_CORE
590595
#
591-
#export SHGEMM_UNROLL_M
592-
#export SHGEMM_UNROLL_N
596+
#export SBGEMM_UNROLL_M
597+
#export SBGEMM_UNROLL_N
593598
#export SGEMM_UNROLL_M
594599
#export SGEMM_UNROLL_N
595600
#export DGEMM_UNROLL_M

cmake/utils.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function(GenerateNamedObjects sources_in)
211211
if (complex_only)
212212
list(REMOVE_ITEM float_list "SINGLE")
213213
list(REMOVE_ITEM float_list "DOUBLE")
214-
list(REMOVE_ITEM float_list "HALF")
214+
list(REMOVE_ITEM float_list "BFLOAT16")
215215
elseif (real_only)
216216
list(REMOVE_ITEM float_list "COMPLEX")
217217
list(REMOVE_ITEM float_list "ZCOMPLEX")
@@ -225,8 +225,8 @@ function(GenerateNamedObjects sources_in)
225225
if (NOT no_float_type)
226226
string(SUBSTRING ${float_type} 0 1 float_char)
227227
string(TOLOWER ${float_char} float_char)
228-
if (${float_type} STREQUAL "HALF")
229-
set (float_char "sh")
228+
if (${float_type} STREQUAL "BFLOAT16")
229+
set (float_char "sb")
230230
endif ()
231231
endif ()
232232

@@ -262,8 +262,8 @@ function(GenerateNamedObjects sources_in)
262262
if (${float_type} STREQUAL "DOUBLE" OR ${float_type} STREQUAL "ZCOMPLEX")
263263
list(APPEND obj_defines "DOUBLE")
264264
endif ()
265-
if (${float_type} STREQUAL "HALF")
266-
list(APPEND obj_defines "HALF")
265+
if (${float_type} STREQUAL "BFLOAT16")
266+
list(APPEND obj_defines "BFLOAT16")
267267
endif ()
268268
if (${float_type} STREQUAL "COMPLEX" OR ${float_type} STREQUAL "ZCOMPLEX")
269269
list(APPEND obj_defines "COMPLEX")

0 commit comments

Comments
 (0)