Skip to content

Commit 41951da

Browse files
authored
Merge pull request #6 from xianyi/develop
merge develop
2 parents 474f7e9 + f7f97c6 commit 41951da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2845
-1172
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ jobs:
8585
sudo: true
8686
language: minimal
8787
before_install:
88-
- "wget 'https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.6.0/alpine-chroot-install' \
89-
&& echo 'a827a4ba3d0817e7c88bae17fe34e50204983d1e alpine-chroot-install' | sha1sum -c || exit 1"
88+
- "wget 'https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.9.0/alpine-chroot-install' \
89+
&& echo 'e5dfbbdc0c4b3363b99334510976c86bfa6cb251 alpine-chroot-install' | sha1sum -c || exit 1"
9090
- alpine() { /alpine/enter-chroot -u "$USER" "$@"; }
9191
install:
9292
- sudo sh alpine-chroot-install -p 'build-base gfortran perl linux-headers'

Makefile.rule

+3
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ NO_AFFINITY = 1
152152
# FUNCTION_PROFILE = 1
153153

154154
# Support for IEEE quad precision(it's *real* REAL*16)( under testing)
155+
# This option should not be used - it is a holdover from unfinished code present
156+
# in the original GotoBLAS2 library that may be usable as a starting point but
157+
# is not even expected to compile in its present form.
155158
# QUAD_PRECISION = 1
156159

157160
# Theads are still working for a while after finishing BLAS operation

c_check

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ $binformat = bin64 if ($data =~ /BINARY_64/);
205205
$no_avx512= 0;
206206
if (($architecture eq "x86") || ($architecture eq "x86_64")) {
207207
$code = '"vbroadcastss -4 * 4(%rsi), %zmm2"';
208-
print $tmpf "int main(void){ __asm__ volatile($code); }\n";
208+
print $tmpf "#include <immintrin.h>\n\nint main(void){ __asm__ volatile($code); }\n";
209209
$args = " -march=skylake-avx512 -o $tmpf.o -x c $tmpf";
210210
my @cmd = ("$compiler_name $args >/dev/null 2>/dev/null");
211211
system(@cmd) == 0;

cmake/fc.cmake

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
## Description: Ported from portion of OpenBLAS/Makefile.system
44
## Sets Fortran related variables.
55

6+
if (INTERFACE64)
7+
set(SUFFIX64 64)
8+
set(SUFFIX64_UNDERSCORE _64)
9+
endif()
10+
611
if (${F_COMPILER} STREQUAL "FLANG")
712
set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_FLANG")
813
if (BINARY64 AND INTERFACE64)

cmake/openblas.pc.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
2+
libsuffix=@SUFFIX64_UNDERSCORE@
23
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
34

45
openblas_config=USE_64BITINT=@USE_64BITINT@ NO_CBLAS=@NO_CBLAS@ NO_LAPACK=@NO_LAPACK@ NO_LAPACKE=@NO_LAPACKE@ DYNAMIC_ARCH=@DYNAMIC_ARCH@ DYNAMIC_OLDER=@DYNAMIC_OLDER@ NO_AFFINITY=@NO_AFFINITY@ USE_OPENMP=@USE_OPENMP@ @CORE@ MAX_THREADS=@NUM_THREADS@
56
Name: OpenBLAS
67
Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version
78
Version: @OPENBLAS_VERSION@
89
URL: https://github.com/xianyi/OpenBLAS
9-
Libs: -L${libdir} -lopenblas
10+
Libs: -L${libdir} -lopenblas${libsuffix}
1011
Cflags: -I${includedir}

cmake/system_check.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ else()
6767
endif()
6868

6969
if (X86_64 OR X86)
70-
file(WRITE ${PROJECT_BINARY_DIR}/avx512.tmp "int main(void){ __asm__ volatile(\"vbroadcastss -4 * 4(%rsi), %zmm2\"); }")
70+
file(WRITE ${PROJECT_BINARY_DIR}/avx512.tmp "#include <immintrin.h>\n\nint main(void){ __asm__ volatile(\"vbroadcastss -4 * 4(%rsi), %zmm2\"); }")
7171
execute_process(COMMAND ${CMAKE_C_COMPILER} -march=skylake-avx512 -v -o ${PROJECT_BINARY_DIR}/avx512.o -x c ${PROJECT_BINARY_DIR}/avx512.tmp OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE NO_AVX512)
7272
if (NO_AVX512 EQUAL 1)
7373
set (CCOMMON_OPT "${CCOMMON_OPT} -DNO_AVX512")

driver/others/memory.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2587,20 +2587,20 @@ void *blas_memory_alloc(int procpos){
25872587

25882588
position = 0;
25892589

2590+
LOCK_COMMAND(&alloc_lock);
25902591
do {
25912592
/* if (!memory[position].used) { */
2592-
LOCK_COMMAND(&alloc_lock);
25932593
/* blas_lock(&memory[position].lock);*/
25942594

25952595
if (!memory[position].used) goto allocation;
25962596

2597-
UNLOCK_COMMAND(&alloc_lock);
25982597
/* blas_unlock(&memory[position].lock);*/
25992598
/* } */
26002599

26012600
position ++;
26022601

26032602
} while (position < NUM_BUFFERS);
2603+
UNLOCK_COMMAND(&alloc_lock);
26042604

26052605
goto error;
26062606

exports/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ $(LIBDYNNAME) : ../$(LIBNAME).osx.renamed osx.def
114114
endif
115115
ifneq (,$(filter 1 2,$(NOFORTRAN)))
116116
#only build without Fortran
117-
$(CC) $(CFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(LIBDYNNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB)
117+
$(CC) $(CFLAGS) $(LDFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(LIBDYNNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB)
118118
else
119-
$(FC) $(FFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(LIBDYNNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB)
119+
$(FC) $(FFLAGS) $(LDFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(LIBDYNNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB)
120120
endif
121121

122122
dllinit.$(SUFFIX) : dllinit.c

interface/lapack/laswp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ int NAME(blasint *N, FLOAT *a, blasint *LDA, blasint *K1, blasint *K2, blasint *
9797

9898
blas_level1_thread(mode, n, k1, k2, dummyalpha,
9999
a, lda, NULL, 0, ipiv, incx,
100-
laswp[flag], nthreads);
100+
(int(*)())laswp[flag], nthreads);
101101
}
102102
#endif
103103

interface/lapack/zlaswp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ int NAME(blasint *N, FLOAT *a, blasint *LDA, blasint *K1, blasint *K2, blasint *
9696
mode = BLAS_SINGLE | BLAS_COMPLEX;
9797
#endif
9898

99-
blas_level1_thread(mode, n, k1, k2, dummyalpha, a, lda, NULL, 0, ipiv, incx, laswp[flag], nthreads);
99+
blas_level1_thread(mode, n, k1, k2, dummyalpha, a, lda, NULL, 0, ipiv, incx, (int(*)())laswp[flag], nthreads);
100100
}
101101
#endif
102102

0 commit comments

Comments
 (0)