Skip to content

Commit

Permalink
Merge pull request #7 from xianyi/develop
Browse files Browse the repository at this point in the history
update
  • Loading branch information
martin-frbg authored Sep 26, 2019
2 parents 2a1911c + 6b83079 commit c0d570a
Show file tree
Hide file tree
Showing 19 changed files with 4,762 additions and 33 deletions.
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ matrix:
- COMMON_FLAGS="DYNAMIC_ARCH=1 TARGET=NEHALEM NUM_THREADS=32"
script:
- set -e
- travis_wait 45 make QUIET_MAKE=1 $COMMON_FLAGS $BTYPE
- make QUIET_MAKE=1 $COMMON_FLAGS $BTYPE
- make -C test $COMMON_FLAGS $BTYPE
- make -C ctest $COMMON_FLAGS $BTYPE
- make -C utest $COMMON_FLAGS $BTYPE
env:
- TARGET_BOX=LINUX64
- BTYPE="BINARY=64"

# - <<: *test-ubuntu
# os: linux-ppc64le
# before_script:
# - COMMON_FLAGS="DYNAMIC_ARCH=1 TARGET=POWER8 NUM_THREADS=32"
# env:
# # for matrix annotation only
# - TARGET_BOX=PPC64LE_LINUX
# - BTYPE="BINARY=64 USE_OPENMP=1"
- <<: *test-ubuntu
os: linux-ppc64le
before_script:
- COMMON_FLAGS="DYNAMIC_ARCH=1 TARGET=POWER8 NUM_THREADS=32"
env:
# for matrix annotation only
- TARGET_BOX=PPC64LE_LINUX
- BTYPE="BINARY=64 USE_OPENMP=1"

- <<: *test-ubuntu
env:
Expand Down
14 changes: 12 additions & 2 deletions Makefile.system
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,13 @@ CCOMMON_OPT += -DMS_ABI
endif

ifeq ($(C_COMPILER), GCC)
#Test for supporting MS_ABI
#Version tests for supporting specific features (MS_ABI, POWER9 intrinsics)
GCCVERSIONGTEQ4 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 4)
GCCVERSIONGT4 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 4)
GCCVERSIONGT5 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 5)
GCCMINORVERSIONGTEQ7 := $(shell expr `$(CC) -dumpversion | cut -f2 -d.` \>= 7)
ifeq ($(GCCVERSIONGT4), 1)
# GCC Majar version > 4
# GCC Major version > 4
# It is compatible with MSVC ABI.
CCOMMON_OPT += -DMS_ABI
endif
Expand Down Expand Up @@ -554,8 +555,17 @@ endif
ifeq ($(ARCH), power)
DYNAMIC_CORE = POWER6
DYNAMIC_CORE += POWER8
ifneq ($(C_COMPILER), GCC)
DYNAMIC_CORE += POWER9
endif
ifeq ($(C_COMPILER), GCC)
ifeq ($(GCCVERSIONGT5), 1)
DYNAMIC_CORE += POWER9
else
$(info, OpenBLAS: Your gcc version is too old to build the POWER9 kernels.)
endif
endif
endif

# If DYNAMIC_CORE is not set, DYNAMIC_ARCH cannot do anything, so force it to empty
ifndef DYNAMIC_CORE
Expand Down
30 changes: 28 additions & 2 deletions cpuid_arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,33 @@ void get_subdirname(void)
printf("arm64");
}

void get_cpucount(void)
{
int n=0;

#ifdef linux
FILE *infile;
char buffer[2048], *p,*t;
p = (char *) NULL ;

infile = fopen("/proc/cpuinfo", "r");

while (fgets(buffer, sizeof(buffer), infile))
{

if (!strncmp("processor", buffer, 9))
n++;
}

fclose(infile);

printf("#define NUM_CORES %d\n",n);
#endif

}



void get_cpuconfig(void)
{

Expand Down Expand Up @@ -309,6 +336,7 @@ void get_cpuconfig(void)
printf("#define DTB_SIZE 4096 \n");
break;
}
get_cpucount();
}


Expand Down Expand Up @@ -351,5 +379,3 @@ void get_features(void)
#endif
return;
}


8 changes: 8 additions & 0 deletions driver/others/dynamic_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

extern gotoblas_t gotoblas_POWER6;
extern gotoblas_t gotoblas_POWER8;
#if (!defined C_GCC) || (GCC_VERSION >= 60000)
extern gotoblas_t gotoblas_POWER9;
#endif

extern void openblas_warning(int verbose, const char *msg);

Expand All @@ -19,7 +21,9 @@ static char *corename[] = {
char *gotoblas_corename(void) {
if (gotoblas == &gotoblas_POWER6) return corename[1];
if (gotoblas == &gotoblas_POWER8) return corename[2];
#if (!defined C_GCC) || (GCC_VERSION >= 60000)
if (gotoblas == &gotoblas_POWER9) return corename[3];
#endif
return corename[0];
}

Expand All @@ -29,8 +33,10 @@ static gotoblas_t *get_coretype(void) {
return &gotoblas_POWER6;
if (__builtin_cpu_is("power8"))
return &gotoblas_POWER8;
#if (!defined C_GCC) || (GCC_VERSION >= 60000)
if (__builtin_cpu_is("power9"))
return &gotoblas_POWER9;
#endif
return NULL;
}

Expand All @@ -53,7 +59,9 @@ static gotoblas_t *force_coretype(char * coretype) {
{
case 1: return (&gotoblas_POWER6);
case 2: return (&gotoblas_POWER8);
#if (!defined C_GCC) || (GCC_VERSION >= 60000)
case 3: return (&gotoblas_POWER9);
#endif
default: return NULL;
}
snprintf(message, 128, "Core not found: %s\n", coretype);
Expand Down
4 changes: 3 additions & 1 deletion kernel/Makefile.L3
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ ifeq ($(TARGET), LOONGSON3B)
USE_TRMM = 1
endif

ifeq ($(CORE), GENERIC)
ifneq ($(DYNAMIC_ARCH), 1)
ifeq ($(TARGET), GENERIC)
USE_TRMM = 1
endif
endif

ifeq ($(CORE), HASWELL)
USE_TRMM = 1
Expand Down
10 changes: 5 additions & 5 deletions kernel/power/KERNEL.POWER8
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ ZTRSMKERNEL_RT = ../generic/trsm_kernel_RT.c
#SMINKERNEL = ../arm/min.c
#DMINKERNEL = ../arm/min.c
#
ISAMAXKERNEL = isamax.c
ISAMAXKERNEL = isamax_power8.S
IDAMAXKERNEL = idamax.c
ICAMAXKERNEL = icamax.c
ICAMAXKERNEL = icamax_power8.S
IZAMAXKERNEL = izamax.c
#
ISAMINKERNEL = isamin.c
ISAMINKERNEL = isamin_power8.S
IDAMINKERNEL = idamin.c
ICAMINKERNEL = icamin.c
ICAMINKERNEL = icamin_power8.S
IZAMINKERNEL = izamin.c
#
#ISMAXKERNEL = ../arm/imax.c
Expand All @@ -112,7 +112,7 @@ ZASUMKERNEL = zasum.c
#
SAXPYKERNEL = saxpy.c
DAXPYKERNEL = daxpy.c
CAXPYKERNEL = caxpy.c
CAXPYKERNEL = caxpy_power8.S
ZAXPYKERNEL = zaxpy.c
#
SCOPYKERNEL = scopy.c
Expand Down
12 changes: 6 additions & 6 deletions kernel/power/KERNEL.POWER9
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ ZTRSMKERNEL_RT = ../generic/trsm_kernel_RT.c
#SMINKERNEL = ../arm/min.c
#DMINKERNEL = ../arm/min.c
#
ISAMAXKERNEL = isamax.c
ISAMAXKERNEL = isamax_power9.S
IDAMAXKERNEL = idamax.c
ICAMAXKERNEL = icamax.c
ICAMAXKERNEL = icamax_power9.S
IZAMAXKERNEL = izamax.c
#
ISAMINKERNEL = isamin.c
ISAMINKERNEL = isamin_power9.S
IDAMINKERNEL = idamin.c
ICAMINKERNEL = icamin.c
ICAMINKERNEL = icamin_power9.S
IZAMINKERNEL = izamin.c
#
#ISMAXKERNEL = ../arm/imax.c
Expand All @@ -112,7 +112,7 @@ ZASUMKERNEL = zasum.c
#
SAXPYKERNEL = saxpy.c
DAXPYKERNEL = daxpy.c
CAXPYKERNEL = caxpy.c
CAXPYKERNEL = caxpy_power9.S
ZAXPYKERNEL = zaxpy.c
#
SCOPYKERNEL = scopy.c
Expand All @@ -123,7 +123,7 @@ ZCOPYKERNEL = zcopy.c
SDOTKERNEL = sdot.c
DDOTKERNEL = ddot.c
DSDOTKERNEL = sdot.c
CDOTKERNEL = cdot.c
CDOTKERNEL = cdot_power9.S
ZDOTKERNEL = zdot.c
#
SNRM2KERNEL = ../arm/nrm2.c
Expand Down
Loading

0 comments on commit c0d570a

Please sign in to comment.