Skip to content

Commit 3612d9a

Browse files
authored
Merge pull request #8 from xianyi/develop
rebase
2 parents 018dec8 + 16dddb7 commit 3612d9a

21 files changed

+310
-21
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ jobs:
4444
if: github.event_name != 'pull_request'
4545
run: brew update || true
4646

47+
- name: unlink installed gcc to allow updating
48+
run: |
49+
brew unlink gcc@8
50+
brew unlink gcc@9
51+
4752
- name: Install prerequisites
4853
run: brew install --fetch-HEAD --HEAD --only-dependencies --keep-tmp openblas
4954

Makefile.arm64

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
ifneq ($(C_COMPILER), PGI)
22
ifeq ($(CORE), ARMV8)
33
CCOMMON_OPT += -march=armv8-a
44
FCOMMON_OPT += -march=armv8-a
@@ -77,4 +77,4 @@ CCOMMON_OPT += -march=armv8.2-a -mtune=tsv110
7777
FCOMMON_OPT += -march=armv8.2-a -mtune=tsv110
7878
endif
7979
endif
80-
80+
endif

Makefile.system

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,10 @@ CCOMMON_OPT += -DUSE_PAPI
12791279
EXTRALIB += -lpapi -lperfctr
12801280
endif
12811281

1282+
ifdef BUFFERSIZE
1283+
CCOMMON_OPT += -DBUFFERSIZE=$(BUFFERSIZE)
1284+
endif
1285+
12821286
ifdef DYNAMIC_THREADS
12831287
CCOMMON_OPT += -DDYNAMIC_THREADS
12841288
endif

cblas.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,14 @@ void cblas_zswap(OPENBLAS_CONST blasint n, void *x, OPENBLAS_CONST blasint incx,
125125

126126
void cblas_srot(OPENBLAS_CONST blasint N, float *X, OPENBLAS_CONST blasint incX, float *Y, OPENBLAS_CONST blasint incY, OPENBLAS_CONST float c, OPENBLAS_CONST float s);
127127
void cblas_drot(OPENBLAS_CONST blasint N, double *X, OPENBLAS_CONST blasint incX, double *Y, OPENBLAS_CONST blasint incY, OPENBLAS_CONST double c, OPENBLAS_CONST double s);
128+
void cblas_csrot(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, OPENBLAS_CONST blasint incx, void *y, OPENBLAS_CONST blasint incY, OPENBLAS_CONST float c, OPENBLAS_CONST float s);
129+
void cblas_zdrot(OPENBLAS_CONST blasint n, OPENBLAS_CONST void *x, OPENBLAS_CONST blasint incx, void *y, OPENBLAS_CONST blasint incY, OPENBLAS_CONST double c, OPENBLAS_CONST double s);
128130

129131
void cblas_srotg(float *a, float *b, float *c, float *s);
130132
void cblas_drotg(double *a, double *b, double *c, double *s);
133+
void cblas_crotg(void *a, void *b, float *c, void *s);
134+
void cblas_zrotg(void *a, void *b, double *c, void *s);
135+
131136

132137
void cblas_srotm(OPENBLAS_CONST blasint N, float *X, OPENBLAS_CONST blasint incX, float *Y, OPENBLAS_CONST blasint incY, OPENBLAS_CONST float *P);
133138
void cblas_drotm(OPENBLAS_CONST blasint N, double *X, OPENBLAS_CONST blasint incX, double *Y, OPENBLAS_CONST blasint incY, OPENBLAS_CONST double *P);

cmake/utils.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ macro(ParseMakefileVars MAKEFILE_IN)
7474
string(REGEX MATCH "ifneq \\(\\$\\(([_A-Z]+)\\),[ \t]*([0-9_A-Z]+)\\)" line_match "${makefile_line}")
7575
if (NOT "${line_match}" STREQUAL "")
7676
# message(STATUS "IFNEQ: ${line_match} first: ${CMAKE_MATCH_1} second: ${CMAKE_MATCH_2}")
77+
if ( ${CMAKE_MATCH_1} STREQUAL C_COMPILER)
78+
set (CMAKE_MATCH_1 CMAKE_C_COMPILER)
79+
endif ()
7780
if (NOT ( ${${CMAKE_MATCH_1}} STREQUAL ${CMAKE_MATCH_2}))
7881
# message (STATUS "condition is true")
7982
set (IfElse 1)

common_arm64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3939

4040
#define INLINE inline
4141

42-
#ifdef F_INTERFACE_FLANG
42+
#if defined( F_INTERFACE_FLANG) || defined(F_INTERFACE_PGI)
4343
#define RETURN_BY_STACK
4444
#else
4545
#define RETURN_BY_COMPLEX

cpuid_x86.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,15 @@ int get_cpuname(void){
14361436
return CPUTYPE_SANDYBRIDGE;
14371437
else
14381438
return CPUTYPE_NEHALEM;
1439+
case 7: // Rocket Lake
1440+
if(support_avx512())
1441+
return CPUTYPE_SKYLAKEX;
1442+
if(support_avx2())
1443+
return CPUTYPE_HASWELL;
1444+
if(support_avx())
1445+
return CPUTYPE_SANDYBRIDGE;
1446+
else
1447+
return CPUTYPE_NEHALEM;
14391448
}
14401449
break;
14411450
}
@@ -2014,6 +2023,19 @@ int get_coretype(void){
20142023
#endif
20152024
else
20162025
return CORE_NEHALEM;
2026+
case 7:// Rocket Lake
2027+
#ifndef NO_AVX512
2028+
if(support_avx512())
2029+
return CORE_SKYLAKEX;
2030+
#endif
2031+
#ifndef NO_AVX2
2032+
if(support_avx2())
2033+
return CORE_HASWELL;
2034+
#endif
2035+
if(support_avx())
2036+
return CORE_SANDYBRIDGE;
2037+
else
2038+
return CORE_NEHALEM;
20172039
}
20182040
case 5:
20192041
switch (model) {

driver/others/dynamic.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ static gotoblas_t *get_coretype(void){
656656
}
657657
}
658658
case 10:
659-
if (model == 5 || model == 6) {
659+
if (model == 5 || model == 6) {
660660
if(support_avx2())
661661
return &gotoblas_HASWELL;
662662
if(support_avx()) {
@@ -666,7 +666,20 @@ static gotoblas_t *get_coretype(void){
666666
openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
667667
return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
668668
}
669-
}
669+
}
670+
if (model == 7) {
671+
if (support_avx512())
672+
return &gotoblas_SKYLAKEX;
673+
if(support_avx2())
674+
return &gotoblas_HASWELL;
675+
if(support_avx()) {
676+
openblas_warning(FALLBACK_VERBOSE, SANDYBRIDGE_FALLBACK);
677+
return &gotoblas_SANDYBRIDGE;
678+
} else {
679+
openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
680+
return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
681+
}
682+
}
670683
return NULL;
671684
}
672685
case 0xf:

driver/others/dynamic_arm64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ extern void openblas_warning(int verbose, const char * msg);
6868
#endif
6969

7070
#define get_cpu_ftr(id, var) ({ \
71-
__asm__("mrs %0, "#id : "=r" (var)); \
71+
__asm__ __volatile__("mrs %0, "#id : "=r" (var)); \
7272
})
7373

7474
static char *corename[] = {

interface/Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ CCBLAS1OBJS = \
316316
cblas_cscal.$(SUFFIX) cblas_csscal.$(SUFFIX) \
317317
cblas_cswap.$(SUFFIX) cblas_scnrm2.$(SUFFIX) \
318318
cblas_caxpby.$(SUFFIX) \
319-
cblas_icmin.$(SUFFIX) cblas_icmax.$(SUFFIX) cblas_scsum.$(SUFFIX)
319+
cblas_icmin.$(SUFFIX) cblas_icmax.$(SUFFIX) cblas_scsum.$(SUFFIX) cblas_csrot.$(SUFFIX) cblas_crotg.$(SUFFIX)
320320

321321
CCBLAS2OBJS = \
322322
cblas_cgemv.$(SUFFIX) cblas_cgerc.$(SUFFIX) cblas_cgeru.$(SUFFIX) \
@@ -346,7 +346,7 @@ CZBLAS1OBJS = \
346346
cblas_zscal.$(SUFFIX) cblas_zdscal.$(SUFFIX) \
347347
cblas_zswap.$(SUFFIX) cblas_dznrm2.$(SUFFIX) \
348348
cblas_zaxpby.$(SUFFIX) \
349-
cblas_izmin.$(SUFFIX) cblas_izmax.$(SUFFIX) cblas_dzsum.$(SUFFIX)
349+
cblas_izmin.$(SUFFIX) cblas_izmax.$(SUFFIX) cblas_dzsum.$(SUFFIX) cblas_zdrot.$(SUFFIX) cblas_zrotg.$(SUFFIX)
350350

351351

352352
CZBLAS2OBJS = \
@@ -1634,6 +1634,12 @@ cblas_srotg.$(SUFFIX) cblas_srotg.$(PSUFFIX): rotg.c
16341634
cblas_drotg.$(SUFFIX) cblas_drotg.$(PSUFFIX): rotg.c
16351635
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
16361636

1637+
cblas_crotg.$(SUFFIX) crotg.$(PSUFFIX): zrotg.c
1638+
$(CC) -c $(CFLAGS) -DCBLAS $< -o $(@F)
1639+
1640+
cblas_zrotg.$(SUFFIX) zrotg.$(PSUFFIX): zrotg.c
1641+
$(CC) -c $(CFLAGS) -DCBLAS $< -o $(@F)
1642+
16371643
cblas_srotm.$(SUFFIX) cblas_srotm.$(PSUFFIX): rotm.c
16381644
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
16391645

@@ -1664,6 +1670,12 @@ cblas_csscal.$(SUFFIX) cblas_csscal.$(PSUFFIX) : zscal.c
16641670
cblas_zdscal.$(SUFFIX) cblas_zdscal.$(PSUFFIX) : zscal.c
16651671
$(CC) $(CFLAGS) -DCBLAS -c -DSSCAL $< -o $(@F)
16661672

1673+
cblas_csrot.$(SUFFIX) cblas_csrot.$(PSUFFIX) : zrot.c
1674+
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
1675+
1676+
cblas_zdrot.$(SUFFIX) cblas_zdrot.$(PSUFFIX) : zrot.c
1677+
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
1678+
16671679
ifeq ($(BUILD_BFLOAT16),1)
16681680
cblas_sbgemv.$(SUFFIX) cblas_sbgemv.$(PSUFFIX) : sbgemv.c
16691681
$(CC) -DCBLAS -c $(CFLAGS) $< -o $(@F)

0 commit comments

Comments
 (0)