Skip to content

Commit 3a30c12

Browse files
authored
Merge pull request #25 from xianyi/develop
rebase
2 parents 352efdd + c9a82f5 commit 3a30c12

32 files changed

+159
-94
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ ifeq ($(NO_SHARED), 1)
167167
$(error OpenBLAS: neither static nor shared are enabled.)
168168
endif
169169
endif
170-
@-ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
171170
@for d in $(SUBDIRS) ; \
172171
do if test -d $$d; then \
173172
$(MAKE) -C $$d $(@F) || exit 1 ; \
@@ -196,6 +195,7 @@ endif
196195
ifdef USE_THREAD
197196
@echo USE_THREAD=$(USE_THREAD) >> Makefile.conf_last
198197
endif
198+
@-ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
199199
@touch lib.grd
200200

201201
prof : prof_blas prof_lapack

azure-pipelines.yml

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ trigger:
44
branches:
55
include:
66
- develop
7-
7+
resources:
8+
containers:
9+
- container: oneapi-hpckit
10+
image: intel/oneapi-hpckit:latest
11+
options: '-v /usr/bin/sudo:/usr/bin/sudo -v /usr/lib/sudo/libsudo_util.so.0:/usr/lib/sudo/libsudo_util.so.0 -v /usr/lib/sudo/sudoers.so:/usr/lib/sudo/sudoers.so'
12+
- container: oneapi-basekit
13+
image: intel/oneapi-basekit:latest
14+
options: '-v /usr/bin/sudo:/usr/bin/sudo -v /usr/lib/sudo/libsudo_util.so.0:/usr/lib/sudo/libsudo_util.so.0 -v /usr/lib/sudo/sudoers.so:/usr/lib/sudo/sudoers.so'
15+
816
jobs:
917
# manylinux1 is useful to test because the
1018
# standard Docker container uses an old version
@@ -94,7 +102,38 @@ jobs:
94102
- script: |
95103
brew update
96104
brew install llvm libomp
97-
brew tap LouisBrunner/valgrind
98-
brew install --HEAD LouisBrunner/valgrind/valgrind
99-
make TARGET=SANDYBRIDGE NO_AVX512=1 USE_OPENMP=1 INTERFACE64=1 DYNAMIC_ARCH=1 DYNAMIC_LIST=SANDYBRIDGE DEBUG=1 NO_PARALLEL_MAKE=1 CC=/usr/local/opt/llvm/bin/clang FC=gfortran-10
100-
cd ctest; OMP_NUM_THREADS=1 valgrind ./xscblat2 <sin2
105+
make TARGET=CORE2 USE_OPENMP=1 INTERFACE64=1 DYNAMIC_ARCH=1 CC=/usr/local/opt/llvm/bin/clang FC=gfortran-10
106+
107+
- job: OSX_Ifort_Clang
108+
pool:
109+
vmImage: 'macOS-10.15'
110+
variables:
111+
LD_LIBRARY_PATH: /usr/local/opt/llvm/lib
112+
MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/17643/m_HPCKit_p_2021.2.0.2903_offline.dmg
113+
LIBRARY_PATH: /usr/local/opt/llvm/lib
114+
MACOS_FORTRAN_COMPONENTS: intel.oneapi.mac.ifort-compiler
115+
steps:
116+
- script: |
117+
brew update
118+
brew install llvm libomp
119+
sudo mkdir -p /opt/intel
120+
sudo chown $USER /opt/intel
121+
displayName: prepare for cache restore
122+
- task: Cache@2
123+
inputs:
124+
path: /opt/intel/oneapi
125+
key: '"install" | "$(MACOS_HPCKIT_URL)" | "$(MACOS_FORTRAN_COMPONENTS)"'
126+
cacheHitVar: CACHE_RESTORED
127+
- script: |
128+
curl --output webimage.dmg --url $(MACOS_HPCKIT_URL) --retry 5 --retry-delay 5
129+
hdiutil attach webimage.dmg
130+
sudo /Volumes/"$(basename "$(MACOS_HPCKIT_URL)" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$(MACOS_FORTRAN_COMPONENTS)" --eula=accept --continue-with-optional-error=yes --log-dir=.
131+
installer_exit_code=$?
132+
hdiutil detach /Volumes/"$(basename "$URL" .dmg)" -quiet
133+
exit $installer_exit_code
134+
displayName: install
135+
condition: ne(variables.CACHE_RESTORED, 'true')
136+
- script: |
137+
source /opt/intel/oneapi/setvars.sh
138+
make CC=/usr/local/opt/llvm/bin/clang FC=ifort
139+

exports/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,13 @@ endif
139139
ifneq (,$(filter 1 2,$(NOFORTRAN)))
140140
#only build without Fortran
141141
$(CC) $(CFLAGS) $(LDFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(INTERNALNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB)
142+
else
143+
ifeq ($(F_COMPILER), INTEL)
144+
$(FC) $(FFLAGS) $(LDFLAGS) -all-load -headerpad_max_install_names -install_name "$(CURDIR)/../$(INTERNALNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def
142145
else
143146
$(FC) $(FFLAGS) $(LDFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(INTERNALNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB)
144147
endif
148+
endif
145149

146150
dllinit.$(SUFFIX) : dllinit.c
147151
$(CC) $(CFLAGS) -c -o $(@F) -s $<

f_check

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,6 @@ if ($link ne "") {
391391

392392
}
393393

394-
if ($vendor eq "INTEL"){
395-
$linker_a .= "-lgfortran"
396-
}
397-
398394
if ($vendor eq "FLANG"){
399395
$linker_a .= "-lflang"
400396
}

interface/zrotg.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ void NAME(FLOAT *DA, FLOAT *DB, FLOAT *C, FLOAT *S){
7979
aa_i = fabs(da_r);
8080
}
8181

82-
scale = (aa_i / aa_r);
83-
ada = aa_r * sqrt(ONE + scale * scale);
82+
if (aa_r == ZERO) {
83+
ada = 0.;
84+
} else {
85+
scale = (aa_i / aa_r);
86+
ada = aa_r * sqrt(ONE + scale * scale);
87+
}
8488

8589
bb_r = fabs(db_r);
8690
bb_i = fabs(db_i);
@@ -90,9 +94,12 @@ void NAME(FLOAT *DA, FLOAT *DB, FLOAT *C, FLOAT *S){
9094
bb_i = fabs(bb_r);
9195
}
9296

93-
scale = (bb_i / bb_r);
94-
adb = bb_r * sqrt(ONE + scale * scale);
95-
97+
if (bb_r == ZERO) {
98+
adb = 0.;
99+
} else {
100+
scale = (bb_i / bb_r);
101+
adb = bb_r * sqrt(ONE + scale * scale);
102+
}
96103
scale = ada + adb;
97104

98105
aa_r = da_r / scale;

kernel/x86_64/drot_microk_haswell-2.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/* need a new enough GCC for avx512 support */
2-
#if (( defined(__GNUC__) && __GNUC__ > 6 && defined(__AVX512CD__)) || (defined(__clang__) && __clang_major__ >= 9))
3-
1+
#if defined(HAVE_FMA3) && defined(HAVE_AVX2)
42
#define HAVE_DROT_KERNEL 1
53

64
#include <immintrin.h>

lapack-netlib/LAPACKE/include/lapack.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ void LAPACK_cgbrfsx(
566566
lapack_int const* n, lapack_int const* kl, lapack_int const* ku, lapack_int const* nrhs,
567567
lapack_complex_float const* AB, lapack_int const* ldab,
568568
lapack_complex_float const* AFB, lapack_int const* ldafb, lapack_int const* ipiv,
569-
float* R,
570-
float* C,
569+
const float* R,
570+
const float* C,
571571
lapack_complex_float const* B, lapack_int const* ldb,
572572
lapack_complex_float* X, lapack_int const* ldx,
573573
float* rcond,
@@ -585,8 +585,8 @@ void LAPACK_dgbrfsx(
585585
lapack_int const* n, lapack_int const* kl, lapack_int const* ku, lapack_int const* nrhs,
586586
double const* AB, lapack_int const* ldab,
587587
double const* AFB, lapack_int const* ldafb, lapack_int const* ipiv,
588-
double* R,
589-
double* C,
588+
const double* R,
589+
const double* C,
590590
double const* B, lapack_int const* ldb,
591591
double* X, lapack_int const* ldx,
592592
double* rcond,
@@ -604,8 +604,8 @@ void LAPACK_sgbrfsx(
604604
lapack_int const* n, lapack_int const* kl, lapack_int const* ku, lapack_int const* nrhs,
605605
float const* AB, lapack_int const* ldab,
606606
float const* AFB, lapack_int const* ldafb, lapack_int const* ipiv,
607-
float* R,
608-
float* C,
607+
const float* R,
608+
const float* C,
609609
float const* B, lapack_int const* ldb,
610610
float* X, lapack_int const* ldx,
611611
float* rcond,
@@ -623,8 +623,8 @@ void LAPACK_zgbrfsx(
623623
lapack_int const* n, lapack_int const* kl, lapack_int const* ku, lapack_int const* nrhs,
624624
lapack_complex_double const* AB, lapack_int const* ldab,
625625
lapack_complex_double const* AFB, lapack_int const* ldafb, lapack_int const* ipiv,
626-
double* R,
627-
double* C,
626+
const double* R,
627+
const double* C,
628628
lapack_complex_double const* B, lapack_int const* ldb,
629629
lapack_complex_double* X, lapack_int const* ldx,
630630
double* rcond,
@@ -4913,7 +4913,7 @@ void LAPACK_cherfsx(
49134913
lapack_int const* n, lapack_int const* nrhs,
49144914
lapack_complex_float const* A, lapack_int const* lda,
49154915
lapack_complex_float const* AF, lapack_int const* ldaf, lapack_int const* ipiv,
4916-
float* S,
4916+
const float* S,
49174917
lapack_complex_float const* B, lapack_int const* ldb,
49184918
lapack_complex_float* X, lapack_int const* ldx,
49194919
float* rcond,
@@ -4931,7 +4931,7 @@ void LAPACK_zherfsx(
49314931
lapack_int const* n, lapack_int const* nrhs,
49324932
lapack_complex_double const* A, lapack_int const* lda,
49334933
lapack_complex_double const* AF, lapack_int const* ldaf, lapack_int const* ipiv,
4934-
double* S,
4934+
const double* S,
49354935
lapack_complex_double const* B, lapack_int const* ldb,
49364936
lapack_complex_double* X, lapack_int const* ldx,
49374937
double* rcond,
@@ -8005,7 +8005,7 @@ void LAPACK_cporfsx(
80058005
lapack_int const* n, lapack_int const* nrhs,
80068006
lapack_complex_float const* A, lapack_int const* lda,
80078007
lapack_complex_float const* AF, lapack_int const* ldaf,
8008-
float* S,
8008+
const float* S,
80098009
lapack_complex_float const* B, lapack_int const* ldb,
80108010
lapack_complex_float* X, lapack_int const* ldx,
80118011
float* rcond,
@@ -8023,7 +8023,7 @@ void LAPACK_dporfsx(
80238023
lapack_int const* n, lapack_int const* nrhs,
80248024
double const* A, lapack_int const* lda,
80258025
double const* AF, lapack_int const* ldaf,
8026-
double* S,
8026+
const double* S,
80278027
double const* B, lapack_int const* ldb,
80288028
double* X, lapack_int const* ldx,
80298029
double* rcond,
@@ -8041,7 +8041,7 @@ void LAPACK_sporfsx(
80418041
lapack_int const* n, lapack_int const* nrhs,
80428042
float const* A, lapack_int const* lda,
80438043
float const* AF, lapack_int const* ldaf,
8044-
float* S,
8044+
const float* S,
80458045
float const* B, lapack_int const* ldb,
80468046
float* X, lapack_int const* ldx,
80478047
float* rcond,
@@ -8059,7 +8059,7 @@ void LAPACK_zporfsx(
80598059
lapack_int const* n, lapack_int const* nrhs,
80608060
lapack_complex_double const* A, lapack_int const* lda,
80618061
lapack_complex_double const* AF, lapack_int const* ldaf,
8062-
double* S,
8062+
const double* S,
80638063
lapack_complex_double const* B, lapack_int const* ldb,
80648064
lapack_complex_double* X, lapack_int const* ldx,
80658065
double* rcond,
@@ -10756,7 +10756,7 @@ void LAPACK_csyrfsx(
1075610756
lapack_int const* n, lapack_int const* nrhs,
1075710757
lapack_complex_float const* A, lapack_int const* lda,
1075810758
lapack_complex_float const* AF, lapack_int const* ldaf, lapack_int const* ipiv,
10759-
float* S,
10759+
const float* S,
1076010760
lapack_complex_float const* B, lapack_int const* ldb,
1076110761
lapack_complex_float* X, lapack_int const* ldx,
1076210762
float* rcond,
@@ -10774,7 +10774,7 @@ void LAPACK_dsyrfsx(
1077410774
lapack_int const* n, lapack_int const* nrhs,
1077510775
double const* A, lapack_int const* lda,
1077610776
double const* AF, lapack_int const* ldaf, lapack_int const* ipiv,
10777-
double* S,
10777+
const double* S,
1077810778
double const* B, lapack_int const* ldb,
1077910779
double* X, lapack_int const* ldx,
1078010780
double* rcond,
@@ -10792,7 +10792,7 @@ void LAPACK_ssyrfsx(
1079210792
lapack_int const* n, lapack_int const* nrhs,
1079310793
float const* A, lapack_int const* lda,
1079410794
float const* AF, lapack_int const* ldaf, lapack_int const* ipiv,
10795-
float* S,
10795+
const float* S,
1079610796
float const* B, lapack_int const* ldb,
1079710797
float* X, lapack_int const* ldx,
1079810798
float* rcond,
@@ -10810,7 +10810,7 @@ void LAPACK_zsyrfsx(
1081010810
lapack_int const* n, lapack_int const* nrhs,
1081110811
lapack_complex_double const* A, lapack_int const* lda,
1081210812
lapack_complex_double const* AF, lapack_int const* ldaf, lapack_int const* ipiv,
10813-
double* S,
10813+
const double* S,
1081410814
lapack_complex_double const* B, lapack_int const* ldb,
1081510815
lapack_complex_double* X, lapack_int const* ldx,
1081610816
double* rcond,

lapack-netlib/LAPACKE/src/lapacke_clascl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ lapack_int LAPACKE_clascl( int matrix_layout, char type, lapack_int kl,
8383
LAPACKE_cgb_nancheck( LAPACK_COL_MAJOR, n, m, n-1, 1, a-1, lda+1 ) ) {
8484
return -9;
8585
}
86+
break;
8687
case 'B':
8788
// TYPE = 'B' - lower part of symmetric band matrix (assume m==n)
8889
if( LAPACKE_chb_nancheck( matrix_layout, 'L', n, kl, a, lda ) ) {

lapack-netlib/LAPACKE/src/lapacke_dlascl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ lapack_int LAPACKE_dlascl( int matrix_layout, char type, lapack_int kl,
8383
LAPACKE_dgb_nancheck( LAPACK_COL_MAJOR, n, m, n-1, 1, a-1, lda+1 ) ) {
8484
return -9;
8585
}
86+
break;
8687
case 'B':
8788
// TYPE = 'B' - lower part of symmetric band matrix (assume m==n)
8889
if( LAPACKE_dsb_nancheck( matrix_layout, 'L', n, kl, a, lda ) ) {

lapack-netlib/LAPACKE/src/lapacke_slascl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ lapack_int LAPACKE_slascl( int matrix_layout, char type, lapack_int kl,
8383
LAPACKE_sgb_nancheck( LAPACK_COL_MAJOR, n, m, n-1, 1, a-1, lda+1 ) ) {
8484
return -9;
8585
}
86+
break;
8687
case 'B':
8788
// TYPE = 'B' - lower part of symmetric band matrix (assume m==n)
8889
if( LAPACKE_ssb_nancheck( matrix_layout, 'L', n, kl, a, lda ) ) {

0 commit comments

Comments
 (0)