mirror of
https://github.com/OpenMathLib/OpenBLAS
synced 2026-06-19 00:35:10 +08:00
Merge pull request #5835 from changangela/fix-lapacke-nancheck-overflow
Some checks failed
apple m / build-windows (cmake, gfortran, 0, 0) (push) Has been cancelled
apple m / build-windows (cmake, gfortran, 0, 1) (push) Has been cancelled
apple m / build-windows (cmake, gfortran, 1, 0) (push) Has been cancelled
apple m / build-windows (cmake, gfortran, 1, 1) (push) Has been cancelled
apple m / build-windows (make, gfortran, 0, 0) (push) Has been cancelled
apple m / build-windows (make, gfortran, 0, 1) (push) Has been cancelled
apple m / build-windows (make, gfortran, 1, 0) (push) Has been cancelled
apple m / build-windows (make, gfortran, 1, 1) (push) Has been cancelled
apple m / xbuild-x86_64 (push) Has been cancelled
apple m / xbuild-ios (push) Has been cancelled
apple m / xbuild-ios32 (push) Has been cancelled
arm64 graviton cirun / build (cmake, gfortran) (push) Has been cancelled
arm64 graviton cirun / build (make, gfortran) (push) Has been cancelled
c910v qemu test / TEST (riscv64-linux-gnu, NO_SHARED=1 TARGET=C910V, C910V, riscv64-unknown-linux-gnu) (push) Has been cancelled
c910v qemu test / TEST (riscv64-linux-gnu, NO_SHARED=1 TARGET=RISCV64_GENERIC, RISCV64_GENERIC, riscv64-linux-gnu) (push) Has been cancelled
Run codspeed benchmarks / benchmarks (make, gfortran, ubuntu-22.04, 3.12) (push) Has been cancelled
Publish docs via GitHub Pages / Deploy docs (push) Has been cancelled
continuous build / build (cmake, clang, flang, ubuntu-latest) (push) Has been cancelled
continuous build / build (cmake, clang, gfortran, macos-latest) (push) Has been cancelled
continuous build / build (cmake, clang, gfortran, ubuntu-24.04-arm) (push) Has been cancelled
continuous build / build (cmake, clang, gfortran, ubuntu-latest) (push) Has been cancelled
continuous build / build (cmake, clang-21, flang, ubuntu-latest) (push) Has been cancelled
continuous build / build (cmake, clang-21, gfortran, ubuntu-24.04-arm) (push) Has been cancelled
continuous build / build (cmake, clang-21, gfortran, ubuntu-latest) (push) Has been cancelled
continuous build / build (cmake, gcc, flang, ubuntu-latest) (push) Has been cancelled
continuous build / build (cmake, gcc, gfortran, ubuntu-24.04-arm) (push) Has been cancelled
continuous build / build (cmake, gcc, gfortran, ubuntu-latest) (push) Has been cancelled
continuous build / build (make, clang, flang, ubuntu-latest) (push) Has been cancelled
continuous build / build (make, clang, gfortran, macos-latest) (push) Has been cancelled
continuous build / build (make, clang, gfortran, ubuntu-24.04-arm) (push) Has been cancelled
continuous build / build (make, clang, gfortran, ubuntu-latest) (push) Has been cancelled
continuous build / build (make, clang-21, flang, ubuntu-latest) (push) Has been cancelled
continuous build / build (make, clang-21, gfortran, ubuntu-24.04-arm) (push) Has been cancelled
continuous build / build (make, clang-21, gfortran, ubuntu-latest) (push) Has been cancelled
continuous build / build (make, gcc, flang, ubuntu-latest) (push) Has been cancelled
continuous build / build (make, gcc, gfortran, ubuntu-24.04-arm) (push) Has been cancelled
continuous build / build (make, gcc, gfortran, ubuntu-latest) (push) Has been cancelled
continuous build / msys2 (None, mingw-w64-ucrt-x86_64-fc, int32, UCRT64, mingw-w64-ucrt-x86_64) (push) Has been cancelled
continuous build / msys2 (Release, <nil>, int32, MINGW32, mingw-w64-i686) (push) Has been cancelled
continuous build / msys2 (Release, mingw-w64-clang-x86_64-fc, int32, CLANG64, mingw-w64-clang-x86_64) (push) Has been cancelled
continuous build / msys2 (Release, mingw-w64-clang-x86_64-fc, int64, -DBINARY=64 -DINTERFACE64=1, CLANG64, mingw-w64-clang-x86_64) (push) Has been cancelled
continuous build / msys2 (Release, mingw-w64-ucrt-x86_64-fc, int32, UCRT64, mingw-w64-ucrt-x86_64) (push) Has been cancelled
continuous build / msys2 (Release, mingw-w64-ucrt-x86_64-fc, int64, -DBINARY=64 -DINTERFACE64=1, UCRT64, mingw-w64-ucrt-x86_64) (push) Has been cancelled
continuous build / cross_build (DYNAMIC_ARCH=1 TARGET=GENERIC, mips64el, mips64el-linux-gnuabi64) (push) Has been cancelled
continuous build / cross_build (TARGET=EV4, alpha, alpha-linux-gnu) (push) Has been cancelled
continuous build / cross_build (TARGET=MIPS1004K, mipsel, mipsel-linux-gnu) (push) Has been cancelled
continuous build / cross_build (TARGET=RISCV64_GENERIC, riscv64, riscv64-linux-gnu) (push) Has been cancelled
continuous build / neoverse_build (push) Has been cancelled
continuous build / neoverse_n1_build (push) Has been cancelled
continuous build / neoverse_n1_omp_build (push) Has been cancelled
continuous build / neoverse_n1_ilp64_build (push) Has been cancelled
harmonyos / build (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=GENERIC, DYNAMIC_ARCH, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA264, LA264, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA464, LA464, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA64_GENERIC, LA64_GENERIC, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON2K1000, LOONGSON2K1000, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON3R5, LOONGSON3R5, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSONGENERIC, LOONGSONGENERIC, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=GENERIC, DYNAMIC_ARCH) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA264, LA264) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA464, LA464) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA64_GENERIC, LA64_GENERIC) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON2K1000, LOONGSON2K1000) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON3R5, LOONGSON3R5) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSONGENERIC, LOONGSONGENERIC) (push) Has been cancelled
mips64 qemu test / TEST (NO_SHARED=1 TARGET=I6400, I6400, mipsisa64r6el-linux-gnuabi64) (push) Has been cancelled
mips64 qemu test / TEST (NO_SHARED=1 TARGET=I6500, I6500, mipsisa64r6el-linux-gnuabi64) (push) Has been cancelled
mips64 qemu test / TEST (NO_SHARED=1 TARGET=MIPS64_GENERIC, MIPS64_GENERIC, mips64el-linux-gnuabi64) (push) Has been cancelled
mips64 qemu test / TEST (NO_SHARED=1 TARGET=P6600, P6600, mipsisa64r6el-linux-gnuabi64) (push) Has been cancelled
mips64 qemu test / TEST (NO_SHARED=1 TARGET=SICORTEX, SICORTEX, mips64el-linux-gnuabi64) (push) Has been cancelled
riscv64 zvl256b qemu test / TEST (TARGET=RISCV64_GENERIC BINARY=64 ARCH=riscv64 DYNAMIC_ARCH=1, rv64,g=true,c=true,v=true,vext_spec=v1.0,vlen=256,elen=64, DYNAMIC_ARCH=1) (push) Has been cancelled
riscv64 zvl256b qemu test / TEST (TARGET=RISCV64_ZVL128B BINARY=64 ARCH=riscv64, rv64,g=true,c=true,v=true,vext_spec=v1.0,vlen=128,elen=64, RISCV64_ZVL128B) (push) Has been cancelled
riscv64 zvl256b qemu test / TEST (TARGET=RISCV64_ZVL256B BINARY=64 ARCH=riscv64 BUILD_BFLOAT16=1 BUILD_HFLOAT16=1, rv64,g=true,c=true,v=true,vext_spec=v1.0,vlen=256,elen=64,zfh=true,zvfh=true,zvfbfwma=true, RISCV64_ZVL256B) (push) Has been cancelled
Windows ARM64 CI / build (push) Has been cancelled
Nightly-Homebrew-Build / build-OpenBLAS-with-Homebrew (push) Has been cancelled
Some checks failed
apple m / build-windows (cmake, gfortran, 0, 0) (push) Has been cancelled
apple m / build-windows (cmake, gfortran, 0, 1) (push) Has been cancelled
apple m / build-windows (cmake, gfortran, 1, 0) (push) Has been cancelled
apple m / build-windows (cmake, gfortran, 1, 1) (push) Has been cancelled
apple m / build-windows (make, gfortran, 0, 0) (push) Has been cancelled
apple m / build-windows (make, gfortran, 0, 1) (push) Has been cancelled
apple m / build-windows (make, gfortran, 1, 0) (push) Has been cancelled
apple m / build-windows (make, gfortran, 1, 1) (push) Has been cancelled
apple m / xbuild-x86_64 (push) Has been cancelled
apple m / xbuild-ios (push) Has been cancelled
apple m / xbuild-ios32 (push) Has been cancelled
arm64 graviton cirun / build (cmake, gfortran) (push) Has been cancelled
arm64 graviton cirun / build (make, gfortran) (push) Has been cancelled
c910v qemu test / TEST (riscv64-linux-gnu, NO_SHARED=1 TARGET=C910V, C910V, riscv64-unknown-linux-gnu) (push) Has been cancelled
c910v qemu test / TEST (riscv64-linux-gnu, NO_SHARED=1 TARGET=RISCV64_GENERIC, RISCV64_GENERIC, riscv64-linux-gnu) (push) Has been cancelled
Run codspeed benchmarks / benchmarks (make, gfortran, ubuntu-22.04, 3.12) (push) Has been cancelled
Publish docs via GitHub Pages / Deploy docs (push) Has been cancelled
continuous build / build (cmake, clang, flang, ubuntu-latest) (push) Has been cancelled
continuous build / build (cmake, clang, gfortran, macos-latest) (push) Has been cancelled
continuous build / build (cmake, clang, gfortran, ubuntu-24.04-arm) (push) Has been cancelled
continuous build / build (cmake, clang, gfortran, ubuntu-latest) (push) Has been cancelled
continuous build / build (cmake, clang-21, flang, ubuntu-latest) (push) Has been cancelled
continuous build / build (cmake, clang-21, gfortran, ubuntu-24.04-arm) (push) Has been cancelled
continuous build / build (cmake, clang-21, gfortran, ubuntu-latest) (push) Has been cancelled
continuous build / build (cmake, gcc, flang, ubuntu-latest) (push) Has been cancelled
continuous build / build (cmake, gcc, gfortran, ubuntu-24.04-arm) (push) Has been cancelled
continuous build / build (cmake, gcc, gfortran, ubuntu-latest) (push) Has been cancelled
continuous build / build (make, clang, flang, ubuntu-latest) (push) Has been cancelled
continuous build / build (make, clang, gfortran, macos-latest) (push) Has been cancelled
continuous build / build (make, clang, gfortran, ubuntu-24.04-arm) (push) Has been cancelled
continuous build / build (make, clang, gfortran, ubuntu-latest) (push) Has been cancelled
continuous build / build (make, clang-21, flang, ubuntu-latest) (push) Has been cancelled
continuous build / build (make, clang-21, gfortran, ubuntu-24.04-arm) (push) Has been cancelled
continuous build / build (make, clang-21, gfortran, ubuntu-latest) (push) Has been cancelled
continuous build / build (make, gcc, flang, ubuntu-latest) (push) Has been cancelled
continuous build / build (make, gcc, gfortran, ubuntu-24.04-arm) (push) Has been cancelled
continuous build / build (make, gcc, gfortran, ubuntu-latest) (push) Has been cancelled
continuous build / msys2 (None, mingw-w64-ucrt-x86_64-fc, int32, UCRT64, mingw-w64-ucrt-x86_64) (push) Has been cancelled
continuous build / msys2 (Release, <nil>, int32, MINGW32, mingw-w64-i686) (push) Has been cancelled
continuous build / msys2 (Release, mingw-w64-clang-x86_64-fc, int32, CLANG64, mingw-w64-clang-x86_64) (push) Has been cancelled
continuous build / msys2 (Release, mingw-w64-clang-x86_64-fc, int64, -DBINARY=64 -DINTERFACE64=1, CLANG64, mingw-w64-clang-x86_64) (push) Has been cancelled
continuous build / msys2 (Release, mingw-w64-ucrt-x86_64-fc, int32, UCRT64, mingw-w64-ucrt-x86_64) (push) Has been cancelled
continuous build / msys2 (Release, mingw-w64-ucrt-x86_64-fc, int64, -DBINARY=64 -DINTERFACE64=1, UCRT64, mingw-w64-ucrt-x86_64) (push) Has been cancelled
continuous build / cross_build (DYNAMIC_ARCH=1 TARGET=GENERIC, mips64el, mips64el-linux-gnuabi64) (push) Has been cancelled
continuous build / cross_build (TARGET=EV4, alpha, alpha-linux-gnu) (push) Has been cancelled
continuous build / cross_build (TARGET=MIPS1004K, mipsel, mipsel-linux-gnu) (push) Has been cancelled
continuous build / cross_build (TARGET=RISCV64_GENERIC, riscv64, riscv64-linux-gnu) (push) Has been cancelled
continuous build / neoverse_build (push) Has been cancelled
continuous build / neoverse_n1_build (push) Has been cancelled
continuous build / neoverse_n1_omp_build (push) Has been cancelled
continuous build / neoverse_n1_ilp64_build (push) Has been cancelled
harmonyos / build (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=GENERIC, DYNAMIC_ARCH, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA264, LA264, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA464, LA464, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA64_GENERIC, LA64_GENERIC, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON2K1000, LOONGSON2K1000, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON3R5, LOONGSON3R5, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSONGENERIC, LOONGSONGENERIC, loongarch64-linux-gnu) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=GENERIC, DYNAMIC_ARCH) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA264, LA264) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA464, LA464) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA64_GENERIC, LA64_GENERIC) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON2K1000, LOONGSON2K1000) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON3R5, LOONGSON3R5) (push) Has been cancelled
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSONGENERIC, LOONGSONGENERIC) (push) Has been cancelled
mips64 qemu test / TEST (NO_SHARED=1 TARGET=I6400, I6400, mipsisa64r6el-linux-gnuabi64) (push) Has been cancelled
mips64 qemu test / TEST (NO_SHARED=1 TARGET=I6500, I6500, mipsisa64r6el-linux-gnuabi64) (push) Has been cancelled
mips64 qemu test / TEST (NO_SHARED=1 TARGET=MIPS64_GENERIC, MIPS64_GENERIC, mips64el-linux-gnuabi64) (push) Has been cancelled
mips64 qemu test / TEST (NO_SHARED=1 TARGET=P6600, P6600, mipsisa64r6el-linux-gnuabi64) (push) Has been cancelled
mips64 qemu test / TEST (NO_SHARED=1 TARGET=SICORTEX, SICORTEX, mips64el-linux-gnuabi64) (push) Has been cancelled
riscv64 zvl256b qemu test / TEST (TARGET=RISCV64_GENERIC BINARY=64 ARCH=riscv64 DYNAMIC_ARCH=1, rv64,g=true,c=true,v=true,vext_spec=v1.0,vlen=256,elen=64, DYNAMIC_ARCH=1) (push) Has been cancelled
riscv64 zvl256b qemu test / TEST (TARGET=RISCV64_ZVL128B BINARY=64 ARCH=riscv64, rv64,g=true,c=true,v=true,vext_spec=v1.0,vlen=128,elen=64, RISCV64_ZVL128B) (push) Has been cancelled
riscv64 zvl256b qemu test / TEST (TARGET=RISCV64_ZVL256B BINARY=64 ARCH=riscv64 BUILD_BFLOAT16=1 BUILD_HFLOAT16=1, rv64,g=true,c=true,v=true,vext_spec=v1.0,vlen=256,elen=64,zfh=true,zvfh=true,zvfbfwma=true, RISCV64_ZVL256B) (push) Has been cancelled
Windows ARM64 CI / build (push) Has been cancelled
Nightly-Homebrew-Build / build-OpenBLAS-with-Homebrew (push) Has been cancelled
Fix 32-bit integer overflow in LAPACKE nancheck index arithmetic
This commit is contained in:
@@ -42,8 +42,8 @@ lapack_logical LAPACKE_c_nancheck( lapack_int n,
|
||||
if( incx == 0 ) return (lapack_logical) LAPACK_CISNAN( x[0] );
|
||||
inc = ( incx > 0 ) ? incx : -incx ;
|
||||
|
||||
for( i = 0; i < n*inc; i+=inc ) {
|
||||
if( LAPACK_CISNAN( x[i] ) )
|
||||
for( i = 0; i < n; i++ ) {
|
||||
if( LAPACK_CISNAN( x[(size_t)i*inc] ) )
|
||||
return (lapack_logical) 1;
|
||||
}
|
||||
return (lapack_logical) 0;
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
lapack_logical LAPACKE_chp_nancheck( lapack_int n,
|
||||
const lapack_complex_float *ap )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_c_nancheck( len, ap, 1 );
|
||||
}
|
||||
|
||||
@@ -40,6 +40,6 @@
|
||||
lapack_logical LAPACKE_cpf_nancheck( lapack_int n,
|
||||
const lapack_complex_float *a )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_c_nancheck( len, a, 1 );
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
lapack_logical LAPACKE_cpp_nancheck( lapack_int n,
|
||||
const lapack_complex_float *ap )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_c_nancheck( len, ap, 1 );
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
lapack_logical LAPACKE_csp_nancheck( lapack_int n,
|
||||
const lapack_complex_float *ap )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_c_nancheck( len, ap, 1 );
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ lapack_logical LAPACKE_ctf_nancheck( int matrix_layout, char transr,
|
||||
}
|
||||
} else {
|
||||
/* Non-unit case - just check whole array for NaNs. */
|
||||
len = n*(n+1)/2;
|
||||
len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_cge_nancheck( LAPACK_COL_MAJOR, len, 1, a, len );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ lapack_logical LAPACKE_ctp_nancheck( int matrix_layout, char uplo, char diag,
|
||||
return (lapack_logical) 0;
|
||||
} else {
|
||||
/* Non-unit case - just check whole array for NaNs. */
|
||||
len = n*(n+1)/2;
|
||||
len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_c_nancheck( len, ap, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,14 +68,14 @@ lapack_logical LAPACKE_ctr_nancheck( int matrix_layout, char uplo, char diag,
|
||||
if( ( colmaj || lower ) && !( colmaj && lower ) ) {
|
||||
for( j = st; j < n; j++ ) {
|
||||
for( i = 0; i < MIN( j+1-st, lda ); i++ ) {
|
||||
if( LAPACK_CISNAN( a[i+j*lda] ) )
|
||||
if( LAPACK_CISNAN( a[i+(size_t)j*lda] ) )
|
||||
return (lapack_logical) 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for( j = 0; j < n-st; j++ ) {
|
||||
for( i = j+st; i < MIN( n, lda ); i++ ) {
|
||||
if( LAPACK_CISNAN( a[i+j*lda] ) )
|
||||
if( LAPACK_CISNAN( a[i+(size_t)j*lda] ) )
|
||||
return (lapack_logical) 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,27 +103,27 @@ lapack_logical LAPACKE_ctz_nancheck( int matrix_layout, char direct, char uplo,
|
||||
}
|
||||
|
||||
/* Initial offsets and sizes of triangular and rectangular parts */
|
||||
lapack_int tri_offset = 0;
|
||||
int64_t tri_offset = 0;
|
||||
lapack_int tri_n = MIN(m,n);
|
||||
lapack_int rect_offset = -1;
|
||||
int64_t rect_offset = -1;
|
||||
lapack_int rect_m = ( m > n ) ? m - n : m;
|
||||
lapack_int rect_n = ( n > m ) ? n - m : n;
|
||||
|
||||
/* Fix offsets depending on the shape of the matrix */
|
||||
if( front ) {
|
||||
if( lower && m > n ) {
|
||||
rect_offset = tri_n * ( !colmaj ? lda : 1 );
|
||||
rect_offset = (int64_t)tri_n * ( !colmaj ? lda : 1 );
|
||||
} else if( !lower && n > m ) {
|
||||
rect_offset = tri_n * ( colmaj ? lda : 1 );
|
||||
rect_offset = (int64_t)tri_n * ( colmaj ? lda : 1 );
|
||||
}
|
||||
} else {
|
||||
if( m > n ) {
|
||||
tri_offset = rect_m * ( !colmaj ? lda : 1 );
|
||||
tri_offset = (int64_t)rect_m * ( !colmaj ? lda : 1 );
|
||||
if( !lower ) {
|
||||
rect_offset = 0;
|
||||
}
|
||||
} else if( n > m ) {
|
||||
tri_offset = rect_n * ( colmaj ? lda : 1 );
|
||||
tri_offset = (int64_t)rect_n * ( colmaj ? lda : 1 );
|
||||
if( lower ) {
|
||||
rect_offset = 0;
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ lapack_logical LAPACKE_d_nancheck( lapack_int n,
|
||||
if( incx == 0 ) return (lapack_logical) LAPACK_DISNAN( x[0] );
|
||||
inc = ( incx > 0 ) ? incx : -incx ;
|
||||
|
||||
for( i = 0; i < n*inc; i+=inc ) {
|
||||
if( LAPACK_DISNAN( x[i] ) )
|
||||
for( i = 0; i < n; i++ ) {
|
||||
if( LAPACK_DISNAN( x[(size_t)i*inc] ) )
|
||||
return (lapack_logical) 1;
|
||||
}
|
||||
return (lapack_logical) 0;
|
||||
|
||||
@@ -40,6 +40,6 @@
|
||||
lapack_logical LAPACKE_dpf_nancheck( lapack_int n,
|
||||
const double *a )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_d_nancheck( len, a, 1 );
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
lapack_logical LAPACKE_dpp_nancheck( lapack_int n,
|
||||
const double *ap )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_d_nancheck( len, ap, 1 );
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
lapack_logical LAPACKE_dsp_nancheck( lapack_int n,
|
||||
const double *ap )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_d_nancheck( len, ap, 1 );
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ lapack_logical LAPACKE_dtf_nancheck( int matrix_layout, char transr,
|
||||
}
|
||||
} else {
|
||||
/* Non-unit case - just check whole array for NaNs. */
|
||||
len = n*(n+1)/2;
|
||||
len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_dge_nancheck( LAPACK_COL_MAJOR, len, 1, a, len );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ lapack_logical LAPACKE_dtp_nancheck( int matrix_layout, char uplo, char diag,
|
||||
return (lapack_logical) 0;
|
||||
} else {
|
||||
/* Non-unit case - just check whole array for NaNs. */
|
||||
len = n*(n+1)/2;
|
||||
len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_d_nancheck( len, ap, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,14 +68,14 @@ lapack_logical LAPACKE_dtr_nancheck( int matrix_layout, char uplo, char diag,
|
||||
if( ( colmaj || lower ) && !( colmaj && lower ) ) {
|
||||
for( j = st; j < n; j++ ) {
|
||||
for( i = 0; i < MIN( j+1-st, lda ); i++ ) {
|
||||
if( LAPACK_DISNAN( a[i+j*lda] ) )
|
||||
if( LAPACK_DISNAN( a[i+(size_t)j*lda] ) )
|
||||
return (lapack_logical) 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for( j = 0; j < n-st; j++ ) {
|
||||
for( i = j+st; i < MIN( n, lda ); i++ ) {
|
||||
if( LAPACK_DISNAN( a[i+j*lda] ) )
|
||||
if( LAPACK_DISNAN( a[i+(size_t)j*lda] ) )
|
||||
return (lapack_logical) 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,27 +102,27 @@ lapack_logical LAPACKE_dtz_nancheck( int matrix_layout, char direct, char uplo,
|
||||
}
|
||||
|
||||
/* Initial offsets and sizes of triangular and rectangular parts */
|
||||
lapack_int tri_offset = 0;
|
||||
int64_t tri_offset = 0;
|
||||
lapack_int tri_n = MIN(m,n);
|
||||
lapack_int rect_offset = -1;
|
||||
int64_t rect_offset = -1;
|
||||
lapack_int rect_m = ( m > n ) ? m - n : m;
|
||||
lapack_int rect_n = ( n > m ) ? n - m : n;
|
||||
|
||||
/* Fix offsets depending on the shape of the matrix */
|
||||
if( front ) {
|
||||
if( lower && m > n ) {
|
||||
rect_offset = tri_n * ( !colmaj ? lda : 1 );
|
||||
rect_offset = (int64_t)tri_n * ( !colmaj ? lda : 1 );
|
||||
} else if( !lower && n > m ) {
|
||||
rect_offset = tri_n * ( colmaj ? lda : 1 );
|
||||
rect_offset = (int64_t)tri_n * ( colmaj ? lda : 1 );
|
||||
}
|
||||
} else {
|
||||
if( m > n ) {
|
||||
tri_offset = rect_m * ( !colmaj ? lda : 1 );
|
||||
tri_offset = (int64_t)rect_m * ( !colmaj ? lda : 1 );
|
||||
if( !lower ) {
|
||||
rect_offset = 0;
|
||||
}
|
||||
} else if( n > m ) {
|
||||
tri_offset = rect_n * ( colmaj ? lda : 1 );
|
||||
tri_offset = (int64_t)rect_n * ( colmaj ? lda : 1 );
|
||||
if( lower ) {
|
||||
rect_offset = 0;
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ lapack_logical LAPACKE_s_nancheck( lapack_int n,
|
||||
if( incx == 0 ) return (lapack_logical) LAPACK_SISNAN( x[0] );
|
||||
inc = ( incx > 0 ) ? incx : -incx ;
|
||||
|
||||
for( i = 0; i < n*inc; i+=inc ) {
|
||||
if( LAPACK_SISNAN( x[i] ) )
|
||||
for( i = 0; i < n; i++ ) {
|
||||
if( LAPACK_SISNAN( x[(size_t)i*inc] ) )
|
||||
return (lapack_logical) 1;
|
||||
}
|
||||
return (lapack_logical) 0;
|
||||
|
||||
@@ -40,6 +40,6 @@
|
||||
lapack_logical LAPACKE_spf_nancheck( lapack_int n,
|
||||
const float *a )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_s_nancheck( len, a, 1 );
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
lapack_logical LAPACKE_spp_nancheck( lapack_int n,
|
||||
const float *ap )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_s_nancheck( len, ap, 1 );
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
lapack_logical LAPACKE_ssp_nancheck( lapack_int n,
|
||||
const float *ap )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_s_nancheck( len, ap, 1 );
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ lapack_logical LAPACKE_stf_nancheck( int matrix_layout, char transr,
|
||||
}
|
||||
} else {
|
||||
/* Non-unit case - just check whole array for NaNs. */
|
||||
len = n*(n+1)/2;
|
||||
len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_sge_nancheck( LAPACK_COL_MAJOR, len, 1, a, len );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ lapack_logical LAPACKE_stp_nancheck( int matrix_layout, char uplo, char diag,
|
||||
return (lapack_logical) 0;
|
||||
} else {
|
||||
/* Non-unit case - just check whole array for NaNs. */
|
||||
len = n*(n+1)/2;
|
||||
len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_s_nancheck( len, ap, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,14 +68,14 @@ lapack_logical LAPACKE_str_nancheck( int matrix_layout, char uplo, char diag,
|
||||
if( ( colmaj || lower ) && !( colmaj && lower ) ) {
|
||||
for( j = st; j < n; j++ ) {
|
||||
for( i = 0; i < MIN( j+1-st, lda ); i++ ) {
|
||||
if( LAPACK_SISNAN( a[i+j*lda] ) )
|
||||
if( LAPACK_SISNAN( a[i+(size_t)j*lda] ) )
|
||||
return (lapack_logical) 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for( j = 0; j < n-st; j++ ) {
|
||||
for( i = j+st; i < MIN( n, lda ); i++ ) {
|
||||
if( LAPACK_SISNAN( a[i+j*lda] ) )
|
||||
if( LAPACK_SISNAN( a[i+(size_t)j*lda] ) )
|
||||
return (lapack_logical) 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,27 +102,27 @@ lapack_logical LAPACKE_stz_nancheck( int matrix_layout, char direct, char uplo,
|
||||
}
|
||||
|
||||
/* Initial offsets and sizes of triangular and rectangular parts */
|
||||
lapack_int tri_offset = 0;
|
||||
int64_t tri_offset = 0;
|
||||
lapack_int tri_n = MIN(m,n);
|
||||
lapack_int rect_offset = -1;
|
||||
int64_t rect_offset = -1;
|
||||
lapack_int rect_m = ( m > n ) ? m - n : m;
|
||||
lapack_int rect_n = ( n > m ) ? n - m : n;
|
||||
|
||||
/* Fix offsets depending on the shape of the matrix */
|
||||
if( front ) {
|
||||
if( lower && m > n ) {
|
||||
rect_offset = tri_n * ( !colmaj ? lda : 1 );
|
||||
rect_offset = (int64_t)tri_n * ( !colmaj ? lda : 1 );
|
||||
} else if( !lower && n > m ) {
|
||||
rect_offset = tri_n * ( colmaj ? lda : 1 );
|
||||
rect_offset = (int64_t)tri_n * ( colmaj ? lda : 1 );
|
||||
}
|
||||
} else {
|
||||
if( m > n ) {
|
||||
tri_offset = rect_m * ( !colmaj ? lda : 1 );
|
||||
tri_offset = (int64_t)rect_m * ( !colmaj ? lda : 1 );
|
||||
if( !lower ) {
|
||||
rect_offset = 0;
|
||||
}
|
||||
} else if( n > m ) {
|
||||
tri_offset = rect_n * ( colmaj ? lda : 1 );
|
||||
tri_offset = (int64_t)rect_n * ( colmaj ? lda : 1 );
|
||||
if( lower ) {
|
||||
rect_offset = 0;
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ lapack_logical LAPACKE_z_nancheck( lapack_int n,
|
||||
if( incx == 0 ) return (lapack_logical) LAPACK_ZISNAN( x[0] );
|
||||
inc = ( incx > 0 ) ? incx : -incx ;
|
||||
|
||||
for( i = 0; i < n*inc; i+=inc ) {
|
||||
if( LAPACK_ZISNAN( x[i] ) )
|
||||
for( i = 0; i < n; i++ ) {
|
||||
if( LAPACK_ZISNAN( x[(size_t)i*inc] ) )
|
||||
return (lapack_logical) 1;
|
||||
}
|
||||
return (lapack_logical) 0;
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
lapack_logical LAPACKE_zhp_nancheck( lapack_int n,
|
||||
const lapack_complex_double *ap )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_z_nancheck( len, ap, 1 );
|
||||
}
|
||||
|
||||
@@ -40,6 +40,6 @@
|
||||
lapack_logical LAPACKE_zpf_nancheck( lapack_int n,
|
||||
const lapack_complex_double *a )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_z_nancheck( len, a, 1 );
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
lapack_logical LAPACKE_zpp_nancheck( lapack_int n,
|
||||
const lapack_complex_double *ap )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_z_nancheck( len, ap, 1 );
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
lapack_logical LAPACKE_zsp_nancheck( lapack_int n,
|
||||
const lapack_complex_double *ap )
|
||||
{
|
||||
lapack_int len = n*(n+1)/2;
|
||||
lapack_int len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_z_nancheck( len, ap, 1 );
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ lapack_logical LAPACKE_ztf_nancheck( int matrix_layout, char transr,
|
||||
}
|
||||
} else {
|
||||
/* Non-unit case - just check whole array for NaNs. */
|
||||
len = n*(n+1)/2;
|
||||
len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_zge_nancheck( LAPACK_COL_MAJOR, len, 1, a, len );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ lapack_logical LAPACKE_ztp_nancheck( int matrix_layout, char uplo, char diag,
|
||||
return (lapack_logical) 0;
|
||||
} else {
|
||||
/* Non-unit case - just check whole array for NaNs. */
|
||||
len = n*(n+1)/2;
|
||||
len = (lapack_int)(((size_t)n*(n+1))/2);
|
||||
return LAPACKE_z_nancheck( len, ap, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,14 +68,14 @@ lapack_logical LAPACKE_ztr_nancheck( int matrix_layout, char uplo, char diag,
|
||||
if( ( colmaj || lower ) && !( colmaj && lower ) ) {
|
||||
for( j = st; j < n; j++ ) {
|
||||
for( i = 0; i < MIN( j+1-st, lda ); i++ ) {
|
||||
if( LAPACK_ZISNAN( a[i+j*lda] ) )
|
||||
if( LAPACK_ZISNAN( a[i+(size_t)j*lda] ) )
|
||||
return (lapack_logical) 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for( j = 0; j < n-st; j++ ) {
|
||||
for( i = j+st; i < MIN( n, lda ); i++ ) {
|
||||
if( LAPACK_ZISNAN( a[i+j*lda] ) )
|
||||
if( LAPACK_ZISNAN( a[i+(size_t)j*lda] ) )
|
||||
return (lapack_logical) 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,27 +103,27 @@ lapack_logical LAPACKE_ztz_nancheck( int matrix_layout, char direct, char uplo,
|
||||
}
|
||||
|
||||
/* Initial offsets and sizes of triangular and rectangular parts */
|
||||
lapack_int tri_offset = 0;
|
||||
int64_t tri_offset = 0;
|
||||
lapack_int tri_n = MIN(m,n);
|
||||
lapack_int rect_offset = -1;
|
||||
int64_t rect_offset = -1;
|
||||
lapack_int rect_m = ( m > n ) ? m - n : m;
|
||||
lapack_int rect_n = ( n > m ) ? n - m : n;
|
||||
|
||||
/* Fix offsets depending on the shape of the matrix */
|
||||
if( front ) {
|
||||
if( lower && m > n ) {
|
||||
rect_offset = tri_n * ( !colmaj ? lda : 1 );
|
||||
rect_offset = (int64_t)tri_n * ( !colmaj ? lda : 1 );
|
||||
} else if( !lower && n > m ) {
|
||||
rect_offset = tri_n * ( colmaj ? lda : 1 );
|
||||
rect_offset = (int64_t)tri_n * ( colmaj ? lda : 1 );
|
||||
}
|
||||
} else {
|
||||
if( m > n ) {
|
||||
tri_offset = rect_m * ( !colmaj ? lda : 1 );
|
||||
tri_offset = (int64_t)rect_m * ( !colmaj ? lda : 1 );
|
||||
if( !lower ) {
|
||||
rect_offset = 0;
|
||||
}
|
||||
} else if( n > m ) {
|
||||
tri_offset = rect_n * ( colmaj ? lda : 1 );
|
||||
tri_offset = (int64_t)rect_n * ( colmaj ? lda : 1 );
|
||||
if( lower ) {
|
||||
rect_offset = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user