Skip to content

Commit 9ac0fb0

Browse files
committed
Merge branch 'develop' into vectorizeBF16GEMV
2 parents 915a6d6 + 624e9d1 commit 9ac0fb0

31 files changed

+834
-165
lines changed

.github/workflows/loongarch64.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ jobs:
2323
- target: LOONGSON2K1000
2424
triple: loongarch64-unknown-linux-gnu
2525
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON2K1000
26+
- target: LA64_GENERIC
27+
triple: loongarch64-unknown-linux-gnu
28+
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA64_GENERIC
29+
- target: LA464
30+
triple: loongarch64-unknown-linux-gnu
31+
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA464
32+
- target: LA264
33+
triple: loongarch64-unknown-linux-gnu
34+
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA264
2635
- target: DYNAMIC_ARCH
2736
triple: loongarch64-unknown-linux-gnu
2837
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=GENERIC

.github/workflows/loongarch64_clang.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ jobs:
2020
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON3R5
2121
- target: LOONGSON2K1000
2222
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON2K1000
23+
- target: LA64_GENERIC
24+
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA64_GENERIC
25+
- target: LA464
26+
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA464
27+
- target: LA264
28+
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA264
2329
- target: DYNAMIC_ARCH
2430
opts: NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=GENERIC
2531

.github/workflows/nightly-Homebrew-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
mv *.bottle.tar.gz bottles
7070
7171
- name: Upload bottle
72-
uses: actions/upload-artifact@v1
72+
uses: actions/upload-artifact@v3
7373
with:
7474
name: openblas--HEAD.catalina.bottle.tar.gz
7575
path: bottles

Makefile.install

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ endif
1414
ifeq ($(INTERFACE64),1)
1515
USE_64BITINT=1
1616
endif
17+
ifeq ($(USE_OPENMP),1)
18+
FOMP_OPT:= -fopenmp
19+
endif
1720

1821
PREFIX ?= /opt/OpenBLAS
1922

@@ -178,6 +181,7 @@ endif
178181
@echo 'libnamesuffix='$(LIBNAMESUFFIX) >> "$(PKGFILE)"
179182
@echo 'libsuffix='$(SYMBOLSUFFIX) >> "$(PKGFILE)"
180183
@echo 'includedir='$(OPENBLAS_INCLUDE_DIR) >> "$(PKGFILE)"
184+
@echo 'omp_opt='$(FOMP_OPT) >> "$(PKGFILE)"
181185
@echo 'openblas_config= USE_64BITINT='$(INTERFACE64) 'DYNAMIC_ARCH='$(DYNAMIC_ARCH) 'DYNAMIC_OLDER='$(DYNAMIC_OLDER) 'NO_CBLAS='$(NO_CBLAS) 'NO_LAPACK='$(NO_LAPACK) 'NO_LAPACKE='$(NO_LAPACKE) 'NO_AFFINITY='$(NO_AFFINITY) 'USE_OPENMP='$(USE_OPENMP) $(TARGET) 'MAX_THREADS='$(NUM_THREADS)>> "$(PKGFILE)"
182186
@echo 'version='$(VERSION) >> "$(PKGFILE)"
183187
@echo 'extralib='$(PKG_EXTRALIB) >> "$(PKGFILE)"

Makefile.system

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,6 @@ OBJCONV = $(CROSS_SUFFIX)objconv
380380
ifeq ($(NOFORTRAN), 1)
381381
C_LAPACK = 1
382382
override FEXTRALIB =
383-
ifeq ($(C_COMPILER), GCC)
384-
CCOMMON_OPT += -Wno-error=incompatible-pointer-types
385-
endif
386383
endif
387384

388385
ifeq ($(C_COMPILER), GCC)
@@ -734,7 +731,7 @@ endif
734731
endif
735732

736733
ifeq ($(ARCH), loongarch64)
737-
DYNAMIC_CORE = LOONGSON3R5 LOONGSON2K1000 LOONGSONGENERIC
734+
DYNAMIC_CORE = LA64_GENERIC LA264 LA464
738735
endif
739736

740737
ifeq ($(ARCH), riscv64)
@@ -1727,8 +1724,8 @@ LAPACK_FFLAGS := $(filter-out -msse3 -mssse3 -msse4.1 -mavx -mavx2 -mskylake-avx
17271724
override FFLAGS := $(filter-out -msse3 -mssse3 -msse4.1 -mavx -mavx2 -mskylake-avx512 ,$(FFLAGS))
17281725
endif
17291726
ifeq ($(F_COMPILER),FLANGNEW)
1730-
LAPACK_FFLAGS := $(filter-out -m32 -m64 -msse3 -mssse3 -msse4.1 -mavx -mavx2 -mskylake-avx512 ,$(FFLAGS))
1731-
override FFLAGS := $(filter-out -m32 -m64 -msse3 -mssse3 -msse4.1 -mavx -mavx2 -mskylake-avx512 ,$(FFLAGS))
1727+
LAPACK_FFLAGS := $(filter-out -m32 -m64 -msse3 -mssse3 -msse4.1 -mavx -mavx2 -mskylake-avx512 -mtune=% -mabi=% ,$(FFLAGS))
1728+
override FFLAGS := $(filter-out -m32 -m64 -msse3 -mssse3 -msse4.1 -mavx -mavx2 -mskylake-avx512 -mtune=% -mabi=% ,$(FFLAGS))
17321729
endif
17331730

17341731
LAPACK_CFLAGS = $(CFLAGS)

TargetList.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,17 @@ x280
126126
RISCV64_ZVL256B
127127

128128
11.LOONGARCH64:
129+
// LOONGSONGENERIC/LOONGSON2K1000/LOONGSON3R5 are legacy names,
130+
// and it is recommended to use the more standardized naming conventions
131+
// LA64_GENERIC/LA264/LA464. You can still specify TARGET as
132+
// LOONGSONGENERIC/LOONGSON2K1000/LOONGSON3R5 during compilation or runtime,
133+
// and they will be internally relocated to LA64_GENERIC/LA264/LA464.
129134
LOONGSONGENERIC
130-
LOONGSON3R5
131135
LOONGSON2K1000
136+
LOONGSON3R5
137+
LA64_GENERIC
138+
LA264
139+
LA464
132140

133141
12. Elbrus E2000:
134142
E2K

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ jobs:
212212
vmImage: 'macOS-latest'
213213
variables:
214214
LD_LIBRARY_PATH: /usr/local/opt/llvm/lib
215-
MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/17643/m_HPCKit_p_2021.2.0.2903_offline.dmg
215+
MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/edb4dc2f-266f-47f2-8d56-21bc7764e119/m_HPCKit_p_2023.2.0.49443.dmg
216216
LIBRARY_PATH: /usr/local/opt/llvm/lib
217217
MACOS_FORTRAN_COMPONENTS: intel.oneapi.mac.ifort-compiler
218218
steps:

cblas.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,13 +407,13 @@ void cblas_cimatcopy(OPENBLAS_CONST enum CBLAS_ORDER CORDER, OPENBLAS_CONST enum
407407
void cblas_zimatcopy(OPENBLAS_CONST enum CBLAS_ORDER CORDER, OPENBLAS_CONST enum CBLAS_TRANSPOSE CTRANS, OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST double* calpha, double* a,
408408
OPENBLAS_CONST blasint clda, OPENBLAS_CONST blasint cldb);
409409

410-
void cblas_sgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST float calpha, float *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST float cbeta,
410+
void cblas_sgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST float calpha, OPENBLAS_CONST float *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST float cbeta,
411411
float *c, OPENBLAS_CONST blasint cldc);
412-
void cblas_dgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST double calpha, double *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST double cbeta,
412+
void cblas_dgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST double calpha, OPENBLAS_CONST double *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST double cbeta,
413413
double *c, OPENBLAS_CONST blasint cldc);
414-
void cblas_cgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST float *calpha, float *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST float *cbeta,
414+
void cblas_cgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST float *calpha, OPENBLAS_CONST float *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST float *cbeta,
415415
float *c, OPENBLAS_CONST blasint cldc);
416-
void cblas_zgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST double *calpha, double *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST double *cbeta,
416+
void cblas_zgeadd(OPENBLAS_CONST enum CBLAS_ORDER CORDER,OPENBLAS_CONST blasint crows, OPENBLAS_CONST blasint ccols, OPENBLAS_CONST double *calpha, OPENBLAS_CONST double *a, OPENBLAS_CONST blasint clda, OPENBLAS_CONST double *cbeta,
417417
double *c, OPENBLAS_CONST blasint cldc);
418418

419419
void cblas_sgemm_batch(OPENBLAS_CONST enum CBLAS_ORDER Order, OPENBLAS_CONST enum CBLAS_TRANSPOSE * TransA_array, OPENBLAS_CONST enum CBLAS_TRANSPOSE * TransB_array, OPENBLAS_CONST blasint * M_array, OPENBLAS_CONST blasint * N_array, OPENBLAS_CONST blasint * K_array,

cmake/arch.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ if (DYNAMIC_ARCH)
9494
endif ()
9595
endif ()
9696

97+
if (LOONGARCH64)
98+
set(DYNAMIC_CORE LOONGSONGENERIC LOONGSON2K1000 LOONGSON3R5)
99+
endif ()
100+
97101
if (EXISTS ${PROJECT_SOURCE_DIR}/config_kernel.h)
98102
message (FATAL_ERROR "Your build directory contains a file config_kernel.h, probably from a previous compilation with make. This will conflict with the cmake compilation and cause strange compiler errors - please remove the file before trying again")
99103
endif ()

cmake/fc.cmake

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,25 @@ if (${F_COMPILER} STREQUAL "GFORTRAN" OR ${F_COMPILER} STREQUAL "F95" OR CMAKE_F
6161
endif ()
6262
if (LOONGARCH64)
6363
if (BINARY64)
64-
CHECK_C_COMPILER_FLAG("-mabi=lp64d" COMPILER_SUPPORT_LP64D_ABI)
65-
if(COMPILER_SUPPORT_LP64D_ABI)
66-
set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=lp64d")
67-
else()
68-
set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=lp64")
69-
endif ()
64+
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "LLVMFlang.*")
65+
CHECK_C_COMPILER_FLAG("-mabi=lp64d" COMPILER_SUPPORT_LP64D_ABI)
66+
if(COMPILER_SUPPORT_LP64D_ABI)
67+
set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=lp64d")
68+
else()
69+
set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=lp64")
70+
endif ()
71+
endif ()
7072
if (INTERFACE64)
7173
set(FCOMMON_OPT "${FCOMMON_OPT} -fdefault-integer-8")
7274
endif ()
7375
else ()
74-
CHECK_C_COMPILER_FLAG("-mabi=ilp32d" COMPILER_SUPPORT_ILP32D_ABI)
75-
if(COMPILER_SUPPORT_ILP32D_ABI)
76-
set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=ilp32d")
77-
else()
78-
set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=lp32")
76+
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "LLVMFlang.*")
77+
CHECK_C_COMPILER_FLAG("-mabi=ilp32d" COMPILER_SUPPORT_ILP32D_ABI)
78+
if(COMPILER_SUPPORT_ILP32D_ABI)
79+
set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=ilp32d")
80+
else()
81+
set(FCOMMON_OPT "${FCOMMON_OPT} -mabi=lp32")
82+
endif ()
7983
endif ()
8084
endif ()
8185
endif ()

0 commit comments

Comments
 (0)