Compare commits

...
338 Commits
Author SHA1 Message Date
Martin Kroeker 992a536238 Merge pull request #5902 from wxpppp/develop
LoongArch64: avoid SGEMM LA464 ncopy fallthrough from N2 to N1
2026-07-12 01:11:37 +02:00
Martin Kroeker d9788925a9 Merge pull request #5898 from moluopro/develop
Fix ARM64 SME direct-kernel build and dispatch
2026-07-11 10:52:51 +02:00
wangweijie 2707282e8c LoongArch64: avoid SGEMM LA464 ncopy fallthrough from N2 to N1 2026-07-09 20:53:05 +08:00
Martin Kroeker 7c991951a5 Merge pull request #5899 from mpwaser/fix/utest-ext-ctest
Fix CTest command for openblas_utest_ext
2026-07-09 11:12:58 +02:00
mpwaser 48c927bd1f Fix CTest command for openblas_utest_ext 2026-07-09 09:50:42 +02:00
moluopro 06d553d0b1 arm64: normalize SME direct source line endings 2026-07-09 13:44:29 +08:00
moluopro 6fdc8db640 arm64: tighten SME STRMM direct variants 2026-07-09 13:43:51 +08:00
moluopro 95cae64181 arm64: harden SME SGEMM direct heuristic 2026-07-09 13:42:48 +08:00
moluopro 18b41f3c4d interface: gate ARM64 STRMM direct fast path 2026-07-09 13:42:12 +08:00
moluopro a33e238b35 cmake: define ARM64 SME direct kernel variants 2026-07-09 13:41:10 +08:00
moluopro 8dcf13a87e cmake: clean up ARMV9SME Windows Clang flags 2026-07-09 13:40:22 +08:00
Martin Kroeker e7b4517435 Merge pull request #5564 from vtjnash/jn/build-exe
Add $(EXE) suffix to executables in Makefiles
2026-07-08 20:50:11 +02:00
Martin Kroeker 788d544f3a Merge pull request #5895 from moluopro/develop
RISC-V: Add TRSM RVV Kernels for ZVL Targets
2026-07-08 18:59:13 +02:00
Martin Kroeker 8af8d8f4b6 Merge branch 'develop' into jn/build-exe 2026-07-08 16:39:07 +02:00
Martin Kroeker baa253650a Merge pull request #5872 from jschueller/tcap
Add missing thread caps
2026-07-08 13:58:38 +02:00
moluopro 0e163c9db2 kernel/riscv64: enable RVV TRSM for ZVL256B 2026-07-08 19:42:26 +08:00
moluopro a8b8136114 kernel/riscv64: enable RVV TRSM for ZVL128B 2026-07-08 19:42:17 +08:00
moluopro 0723136260 kernel/riscv64: add RVV RT TRSM kernel 2026-07-08 19:42:09 +08:00
moluopro e4e3ad2430 kernel/riscv64: add RVV RN TRSM kernel 2026-07-08 19:41:58 +08:00
moluopro 945f4352d3 kernel/riscv64: add RVV LT TRSM kernel 2026-07-08 19:41:49 +08:00
moluopro 5282a38239 kernel/riscv64: add RVV LN TRSM kernel 2026-07-08 19:41:42 +08:00
Martin Kroeker 34f66e5004 Merge pull request #5894 from martin-frbg/getrf_tsan
Change atomic semantics in GETRF to acquire/release to fix tsan warnings
2026-07-08 08:44:14 +02:00
Martin Kroeker 57da6f5902 Change atomic semanrics to acquire/release to fix tsan warnings 2026-07-07 21:38:42 +02:00
Martin Kroeker 71e999bc9a Merge pull request #5891 from moluopro/fix/ci-badge-docs
Update README and CI job matrix documentation
2026-07-07 18:21:26 +02:00
Martin Kroeker 45199ce655 Merge pull request #5892 from moluopro/develop
Enable RVV ROTM for RISC-V ZVL Targets
2026-07-07 16:59:25 +02:00
Martin Kroeker 80d7922240 Merge pull request #5893 from martin-frbg/lapack1318
Fix  LAPACKE_?lacpy_work corrupting data in row-major mode  (Reference-LAPACK PR 1318)
2026-07-07 15:03:56 +02:00
Martin Kroeker 2b11a16f56 Fix row-major copy corrupting the other triangle (Reference-LAPACK PR 1318) 2026-07-07 10:55:25 +02:00
moluopro 09fd1da6fa kernel/riscv64: enable RVV ROTM for ZVL256B
Use the RVV ROTM kernel for single and double precision ROTM on the RISCV64_ZVL256B target.
2026-07-07 15:20:26 +08:00
moluopro a11b444d67 kernel/riscv64: enable RVV ROTM for ZVL128B
Use the RVV ROTM kernel for single and double precision ROTM on the RISCV64_ZVL128B target.
2026-07-07 15:20:26 +08:00
moluopro 395f8b347f fix(riscv64): keep signed strides in RVV ROTM
The general-stride ROTM path already computes kx/ky with the BLAS negative-increment starting offset. Converting negative increments to positive strides and moving dx/dy again double-adjusted the address and could access the wrong elements. Keep the signed byte strides for RVV strided loads and stores.
2026-07-07 15:20:17 +08:00
moluopro f82cf88caa fix(riscv64): handle zero-stride ROTM in RVV kernel
ROTM has loop-carried dependencies when incx or incy is zero because the same element is updated repeatedly across iterations. The RVV strided load/store path would compute lanes from the same old value and write them back in parallel, producing results that do not match BLAS ROTM semantics. Use a scalar path for zero-stride cases.
2026-07-07 15:20:06 +08:00
Martin Kroeker de54968e16 Merge pull request #5890 from martin-frbg/fixup5843
Apply the NEON S/DOMATCOPY kernels from PR 5843 to all arm64 targets
2026-07-07 00:47:11 +02:00
moluopro 27b0d441ad ci: skip Azure pipeline for docs-only changes
Add push and pull request path filters so docs-only changes do not trigger the Azure build matrix.
2026-07-07 00:15:30 +08:00
moluopro 1b538d7fd1 ci: skip FreeBSD workflow for docs-only changes
Add path filters so README and docs-only pull requests do not start the FreeBSD GitHub Actions jobs.
2026-07-07 00:15:30 +08:00
moluopro d560f6d74f docs: fix README supported OS references
Fix broken supported OS links for Windows, Android, and Cortex-M, and update the FreeBSD support note to mention its basic GitHub Actions coverage.
2026-07-06 23:50:31 +08:00
moluopro a0febbbc8d docs: update CI job matrix
Replace retired Cirrus CI entries with the corresponding GitHub Actions jobs for Apple M1, Neoverse N1, Graviton3, and FreeBSD runners.
2026-07-06 23:21:00 +08:00
moluopro 2497041827 docs: refresh README CI badges
Replace the retired Cirrus CI badge with the current GitHub Actions badge, label the Azure Pipelines badge, and remove stale public OSUOSL badges whose job pages no longer resolve.
2026-07-06 23:21:00 +08:00
Martin Kroeker 6468bcbdad Merge pull request #5889 from moluopro/develop
ARM64 SME: fix zero-scalar handling and clean up direct kernels
2026-07-06 16:50:48 +02:00
Martin Kroeker c61f95c8d3 Merge pull request #5888 from martin-frbg/lapack1297
Relax eigenvalue consistency criterion in testsuite (Reference-LAPACK PR 1297)
2026-07-06 16:34:53 +02:00
Martin Kroeker a2f9fc83df Merge pull request #5885 from martin-frbg/lapack1317
Increase deflation tolerance in ?LAED to match recent changes in ?SLASD  (Reference-LAPACK PR 1317)
2026-07-06 13:09:16 +02:00
Martin Kroeker a5d477f195 fix omatcopy filenames 2026-07-06 12:28:02 +02:00
Martin Kroeker 36365a602e Make the OMATCOPY kernels from 5843 universally available 2026-07-06 11:49:27 +02:00
moluopro 130102e661 Clean up SSYR2K SME direct warnings
Mark read-only transpose inputs const and limit sve_cntw and ldb definitions to the variants that use them.
2026-07-06 16:00:21 +08:00
moluopro 3781e2c15d Clean up SSYRK SME direct warnings
Mark the read-only B input const and limit sve_cntw and ldb definitions to the variants that use them.
2026-07-06 15:59:53 +08:00
moluopro edd8ab196d Clean up SSYMM SME preprocessing warnings
Use const source pointers in the symmetric preprocessing helpers and compile only the LU or LL helper needed by each object variant.
2026-07-06 15:59:25 +08:00
Martin Kroeker aa8b19de74 Relax eigenvalue consistency test (Reference-LAPACK PR 1297) 2026-07-06 09:43:58 +02:00
moluopro 8cde36c9b8 Use integer round-up in ARM64 SME direct kernels
The padded SME dimensions are integer quantities, so compute them with integer arithmetic and drop the now-unused math.h include.
2026-07-06 15:33:29 +08:00
moluopro d49cd021dd Handle zero alpha/beta in SSYR2K SME direct kernel
Avoid loading C when beta is zero, and skip A/B preprocessing for alpha == 0 or K == 0 by reusing the triangular direct kernel with k = 0.
2026-07-06 15:30:42 +08:00
moluopro 9925b29db5 Handle zero alpha/beta in SSYRK SME direct kernel
Avoid loading C when beta is zero, and skip A preprocessing for alpha == 0 or K == 0 by reusing the triangular direct kernel with k = 0.
2026-07-06 15:30:37 +08:00
moluopro 35a841fd49 Handle zero alpha in SSYMM SME direct kernel
When alpha is zero, avoid preprocessing the symmetric matrix and reuse the SGEMM alpha/beta direct kernel with k = 0 for the beta-only update.
2026-07-06 15:30:27 +08:00
moluopro ab27636deb Handle zero alpha/beta in SGEMM SME direct kernel
Avoid loading C when beta is zero; ZA has already been initialized to zero.

For alpha == 0 or K == 0, skip A preprocessing and reuse the direct kernel with k = 0 to perform only the beta update.
2026-07-06 15:30:22 +08:00
Martin Kroeker 882526a408 Merge pull request #5886 from martin-frbg/lapack1290
Avoid intermediate overflow in ?LARFGP (Reference-LAPACK PR 1290)
2026-07-06 08:59:14 +02:00
Martin Kroeker 170da5f679 Merge pull request #5883 from martin-frbg/lapack1300
Use QR  for bidiagonal SVD with vectors in ?BDSDC (Reference-LAPACK PR 1300)
2026-07-06 07:30:06 +02:00
Martin Kroeker ac394175e4 Merge pull request #5887 from martin-frbg/disable_cirrusci
CI: disable the remaining Cirrus jobs now that the service is gone
2026-07-06 00:39:32 +02:00
Martin Kroeker cc02866ef1 disable the remaining jobs now that Cirrus is gone 2026-07-06 00:38:31 +02:00
Martin Kroeker 022b1c6a03 Merge branch 'OpenMathLib:develop' into lapack1290 2026-07-05 22:05:59 +02:00
Martin Kroeker 6cd5516da2 Merge branch 'OpenMathLib:develop' into lapack1317 2026-07-05 22:05:40 +02:00
Martin Kroeker baa8c5d0b9 Merge branch 'OpenMathLib:develop' into lapack1300 2026-07-05 22:05:20 +02:00
Martin Kroeker 60d3fbea46 Merge pull request #5884 from martin-frbg/fixtinfo_ci
CI: update Ubuntu tinfo package version in gh workflow
2026-07-05 22:04:53 +02:00
Martin Kroeker f3f5fd9116 Avoid intermediate overflow (Reference-LAPACK PR 1290) 2026-07-05 17:43:58 +02:00
Martin Kroeker db20661747 Increase deflation tolerance to match recent ?SLASD changes (Reference-LAPACK PR 1317) 2026-07-05 17:37:17 +02:00
Martin Kroeker 78f06538c7 Merge pull request #5881 from moluopro/develop
ci, docs: fix documentation text and skip docs-only CI
2026-07-05 16:43:41 +02:00
Martin Kroeker a55df7c0c6 Update package name in the wget call too 2026-07-05 16:27:41 +02:00
Martin Kroeker a45da9e756 update Ubuntu tinfo package version 2026-07-05 15:04:43 +02:00
Martin Kroeker e70a7a735f Merge pull request #5868 from Vasudeva-bit/macTuneZEN4
Optimize Zen 4 GEMM macro block sizes (P, Q, R)
2026-07-05 00:01:20 +02:00
Martin Kroeker 5aa157c2cf Use QR instead of D&C for bidiagonal SVD with vectors (Reference-LAPACK PR 1300) 2026-07-04 23:26:22 +02:00
Martin Kroeker e97eb66c29 Merge pull request #5817 from martin-frbg/bsdqemu
[WIP] Create QEmu-based FreeBSD runner to replace deprecated Cirrus
2026-07-04 10:14:18 +02:00
Vasudeva-bit 58846317d9 fix C89 scoping, dynamic R for memory issues, robust zen4/5 check 2026-07-04 11:30:34 +05:30
Martin Kroeker 8f0b0333ba Merge pull request #5876 from kumaraditya303/openmp
fix thread safety and data races of openmp backend
2026-07-03 22:22:55 +02:00
moluopro 448622eeea ci: skip non-doc workflows for markdown-only changes 2026-07-04 02:52:02 +08:00
moluopro 45bf57426a ci: restrict docs workflow to docs inputs 2026-07-04 01:20:43 +08:00
moluopro e097d0b32c ci: skip non-doc workflows for docs-only changes 2026-07-04 01:20:37 +08:00
moluopro 1a2386b437 docs: fix miscellaneous documentation text 2026-07-04 00:32:31 +08:00
moluopro 68a988c441 docs: fix distributing guide wording 2026-07-04 00:32:24 +08:00
moluopro ac7fa5c7d3 docs: fix extensions table formatting 2026-07-04 00:32:16 +08:00
Martin Kroeker a8c41f73ed Merge pull request #5878 from moluopro/develop
docs: fix install guide typos
2026-07-03 15:28:22 +02:00
Martin Kroeker 34232eb5f4 Merge pull request #5880 from martin-frbg/issue5873-2
Fix broken conditional preventing ARM64 SME compilation with AppleClang
2026-07-03 15:24:31 +02:00
Martin Kroeker aedbcbc5a5 Fix conditional 2026-07-03 12:43:42 +02:00
Martin Kroeker e717107ba6 Merge pull request #5874 from jschueller/dev-fix
Fix ZA tile slice indices in ssyrk SME direct kernel
2026-07-03 12:40:37 +02:00
Martin Kroeker 8e6088de89 Merge pull request #5877 from hheei/fix/laed3-sqrt-nan-guard
Fix/laed3 sqrt nan guard
2026-07-02 20:52:15 +02:00
moluopro 1d7cbce8ba docs: fix install guide typos 2026-07-03 01:50:09 +08:00
hheei aea58b2b91 Add hheei to CONTRIBUTORS.md 2026-07-02 23:03:58 +08:00
hheei 71f2260186 lapack/laed3: guard sqrt(-w[i]) against spuriously positive w[i]
When eigenvalues are nearly degenerate, numerical accumulation in
the divide-and-conquer merge can push w[i] slightly above zero.
The subsequent sqrt(-w[i]) then produces NaN, which propagates
through the entire eigenvector output of DSYEVD/DSTEDC.

Use fmax(-w[i], 0.0) to safely clamp the sqrt argument, yielding
zero instead of NaN for spuriously positive w[i].  The fmax call
maps to a single vmaxsd instruction on x86_64 with zero overhead.

Add test/test_laed3_nan.c which exercises DSYEVD on a rank-1
perturbed identity matrix designed to create near-degenerate
eigenvalue clusters.
2026-07-02 23:03:38 +08:00
Kumar Aditya 2d75a67d89 setup CI 2026-07-02 15:50:18 +05:30
Kumar Aditya a2261f9e52 fix thread safety of openmp backend 2026-07-02 15:39:09 +05:30
Julien Schueller 43f0a90e1b Fix ZA tile slice indices in ssyrk SME direct kernel
The kernel_2x2 function uses 4 ZA tiles (0-3) each with svl slices.
Tiles 0/1 handle rows 0..svl-1 with slice indices 0..svl-1.
Tiles 2/3 handle rows svl..2*svl-1, so their slice indices
must start at 0, i.e. (i - svl) instead of i.

Fix all three tile 2/3 access sites:
- C load into ZA (svwrite_hor_za32_f32_m)
- C writeback for UPPER (svst1_hor_za32)
- C writeback for LOWER (svst1_hor_za32)

Fixes #5873
2026-07-02 09:29:32 +02:00
Martin Kroeker 0f51e2d22f Merge pull request #5871 from martin-frbg/lapack1163
Add non-trivial terminating case to ?LARFT (Reference-LAPACK PR 1163)
2026-07-01 00:42:11 +02:00
Martin Kroeker a782e10a22 Merge pull request #5858 from martin-frbg/lapack1286
Increase tolerance in ?LASD2 to improve ?BDSDC stability (Reference-LAPACK PR 1286)
2026-07-01 00:41:22 +02:00
Martin Kroeker 66d041d75f Merge pull request #5863 from martin-frbg/lapack1307
Change description of QMAX in ?LASQ3 to in/out (Reference-LAPACK PR 1307)
2026-06-30 22:48:36 +02:00
Martin Kroeker 6265056f19 relax tolerance in SGESDD benchmark (see discussion in Reference-LAPACK PR 1286) 2026-06-30 19:36:48 +02:00
Martin Kroeker a22ee97671 Merge branch 'OpenMathLib:develop' into lapack1286 2026-06-30 19:32:57 +02:00
Martin Kroeker 4ca72cb7a4 Add f2c conversions of ?larft_lvl2 and update ?larft (Reference-LAPACK PR 1163) 2026-06-30 19:27:11 +02:00
Martin Kroeker 0d820b8597 Add f2c-converted versions of larft_lvl2 from Reference-LAPACK 1163 2026-06-30 19:24:05 +02:00
Julien Schueller 5010c0abb8 blas: fix missing thread caps 2026-06-29 17:23:55 +02:00
Julien Schueller c0c2dadbd9 lapack: fix missing thread caps 2026-06-29 17:23:43 +02:00
Martin Kroeker 9cc2702c0f Add the LARFT_LVL2 functions from Reference-LAPACK PR 1163 2026-06-27 20:10:05 +02:00
Martin Kroeker fa597c2191 Add the ?LARFT_LVL2 functions from Reference-LAPACK PR 1163 2026-06-27 20:08:57 +02:00
Martin Kroeker fd89e78ff3 Add non-trivial terminating case for LARFT (Reference-LAPACK PR 1163) 2026-06-27 20:07:45 +02:00
Martin Kroeker dd3ba971bc Merge pull request #5845 from martin-frbg/pizlonator-filc
Add support for compiling with the Fil-C Memory Safe C toolchain
2026-06-27 15:36:25 +02:00
Martin Kroeker b997290389 Merge pull request #5862 from martin-frbg/lapack1293
Scale convergence thresholds in ?BBCSD to fix accuracy (Reference-LAPACK PR 1293)
2026-06-27 11:49:15 +02:00
Martin Kroeker 3f6241b8db Merge pull request #5865 from martin-frbg/lapack1315
Fix handling of negative increments in ?LARF/?LARF1F/?LARF1L (Reference-LAPACK PR 1315)
2026-06-26 22:50:38 +02:00
Martin Kroeker cd395c801a Merge pull request #5864 from martin-frbg/lapack1309
Fix bad scaling in ?LARFF causing slow DSYEVR/ZHEEVR (Reference-LAPACK PR 1309)
2026-06-26 22:50:15 +02:00
Martin Kroeker 7370b520d2 Merge pull request #5857 from martin-frbg/lapack1285
Fix premature return before fallback in ?BDSQR (Reference-LAPACK PR 1285)
2026-06-26 20:45:56 +02:00
Martin Kroeker 132f2a3ebd Merge pull request #5855 from martin-frbg/lapack1283
Avoid intermediate overflows in GEJSV,GESVJ,GESVDX,GEDMD (Reference-LAPACK PR 1283)
2026-06-26 20:45:23 +02:00
Martin Kroeker 71db152f80 Merge pull request #5869 from MaddyGuthridge/patch-1
mkdocs: set repo_name
2026-06-26 20:44:46 +02:00
Maddy Guthridge ac015fab8c mkdocs: set repo_name
That way the path to the GitHub repo is displayed instead of just the generic text "GitHub"
2026-06-26 03:00:45 +10:00
Martin Kroeker 100988fddd Merge branch 'OpenMathLib:develop' into lapack1286 2026-06-25 15:47:50 +02:00
Martin Kroeker 3cdf5dcf0b Merge pull request #5860 from martin-frbg/lapack1291
Handle degenerate cases in OR/UNCSD2BY1 (Reference-LAPACK PR 1291)
2026-06-25 15:40:27 +02:00
Vasudeva-bit 753604cfe2 Optimize Zen 4 GEMM macro block sizes (P, Q, R) 2026-06-25 19:06:26 +05:30
Martin Kroeker 56b08939f5 Merge pull request #5861 from martin-frbg/lapack1292
Fix workspace for tiny inputs in (ORM/UNM)(L/R)Q and Q(L/R) (Reference-LAPACK PR 1292)
2026-06-25 14:06:48 +02:00
Martin Kroeker e202bcb942 Merge pull request #5859 from martin-frbg/lapack1287
Fix row-major A dimension for SIDE=R in LAPACKE_?TPRFB_WORK (Reference-LAPACK PR 1287)
2026-06-25 14:05:24 +02:00
Martin Kroeker 72ebe7b777 Merge pull request #5856 from martin-frbg/lapack1284-2
Don't check LDU in LAPACKE_?GESVD_WORK when U is not used (from Reference-LAPACK PR 1284)
2026-06-25 12:27:19 +02:00
Martin Kroeker 68b4f228c0 Merge pull request #5854 from martin-frbg/lapack1275
Reject NB=0 in input of DLASWLQ (Reference-LAPACK PR 1275)
2026-06-25 10:20:11 +02:00
Martin Kroeker 1dd3ec9f1f Merge pull request #5853 from martin-frbg/lapack1274
Fix too small workspace queried in SGGEV3 (Reference-LAPACK PR 1274)
2026-06-25 10:19:47 +02:00
Martin Kroeker 854479839b Merge pull request #5852 from martin-frbg/lapack1273
Fix sign of error number returned by LWORK check in ?LAQZ0 (Reference-LAPACK PR 1273)
2026-06-25 10:19:14 +02:00
Martin Kroeker 4ba480e436 Merge pull request #5851 from martin-frbg/lapack1272
Fix operand number in errors of ?GGSVD3,?UN/ORBDB4, ?UN/ORCSD (Reference-LAPACK PR 1272)
2026-06-25 09:35:49 +02:00
Martin Kroeker 562aeed4a2 Fix handling of negative increments (Reference-LAPACK PR 1315) 2026-06-24 21:41:17 +02:00
Martin Kroeker faa10e60e4 Fix scaling of relative error to avoid spurious failures (Reference-LAPACK PR 1309) 2026-06-24 21:34:29 +02:00
Martin Kroeker 5cc9ff49f5 Fix description of QMAX to mark it as in/out (Reference-LAPACK PR 1307) 2026-06-24 21:27:43 +02:00
Martin Kroeker caa18db35f Scale thresholds to improve accuracy of singular vectors (Reference-LAPACK PR 1293) 2026-06-24 20:55:02 +02:00
Martin Kroeker c5cd266fff Reduce workspace demand for tiny M,N,K sizes (Reference-LAPACK PR 1292) 2026-06-24 20:44:27 +02:00
Martin Kroeker 9e9c5a541f Handle degenerate cases having R=0 (Reference-LAPACK PR 1291) 2026-06-24 20:35:34 +02:00
Martin Kroeker 2a859d5fc4 Fix row-major A dimension for SIDE=R (Reference-LAPACK PR 1287) 2026-06-24 18:33:45 +02:00
Martin Kroeker ea007b5c03 Increase deflation tolerance to match ?LASD7 (Reference-LAPACK PR 1286) 2026-06-24 16:50:13 +02:00
Martin Kroeker 788a2dfec4 Fix premature return before trying QR fallback (Reference-LAPACK PR 1285) 2026-06-24 16:16:15 +02:00
Martin Kroeker 9971940f04 Also don't check LDU when U is not used (from Reference-LAPACK PR 1284) 2026-06-24 16:06:24 +02:00
Martin Kroeker 6dd2948a2b Guard against intermediate overflows 2026-06-24 14:14:31 +02:00
Martin Kroeker 358d3676d0 Reject NB=0 in input (Reference-LAPACK PR 1275) 2026-06-24 13:31:40 +02:00
Martin Kroeker fb4e77d379 Query correct (larger) workspace for VL=N,VR=V (Reference-LAPACK PR 1274) 2026-06-24 13:27:17 +02:00
Martin Kroeker 6409343512 Fix sign of error number from LWORK check (Reference-LAPACK PR 1273) 2026-06-24 12:33:17 +02:00
Martin Kroeker aae8526e3a Fix bad operand indicator in error messages (Reference-LAPACK PR 1272) 2026-06-24 12:27:21 +02:00
Martin Kroeker a36e22cbb2 Merge pull request #5850 from martin-frbg/lapack1271
Update EXTERNAL declarations in various files (Reference-LAPACK PR 1271)
2026-06-24 10:36:37 +02:00
Martin Kroeker 1afb4c9ba1 Merge pull request #5849 from martin-frbg/lapack1270
Fix wrong workspace in DGEJSV potentially corrupting memory in DGESVJ (Reference-LAPACK PR 1270)
2026-06-24 10:36:15 +02:00
Martin Kroeker 6d648c6b4d Merge pull request #5848 from martin-frbg/lapack1269
Fix wrong JOBA type in SGESVJ call of SGEJSV (Reference-LAPACK PR 1269)
2026-06-24 10:35:54 +02:00
Martin Kroeker 648a53b5cb Merge pull request #5847 from martin-frbg/lapack1268
Fix wrong name in XERBLA call of ZLA_SYRFSX_EXTENDED (Reference-LAPACK PR 1268)
2026-06-24 10:35:34 +02:00
Martin Kroeker 7fdd58a7d6 Merge pull request #5846 from martin-frbg/lapack1265
Fix typo in ?ORBDB3/?UNBDB3 use of INCY (Reference-LAPACK PR 1265)
2026-06-24 10:35:11 +02:00
Martin Kroeker aae00921a9 Fix conditional 2026-06-24 00:19:32 +02:00
Martin Kroeker cfeb270288 Update EXTERNAL declarations in various files (Reference-LAPACK PR 1271) 2026-06-23 22:20:46 +02:00
Martin Kroeker 9f6c07c5a8 Fix workspace argument if DGESVJ call (Reference-LAPACK PR 1270) 2026-06-23 21:55:15 +02:00
Martin Kroeker 8f2b1e8c7c Fix wrong JOBA type in SGESVJ call (Reference-LAPACK PR 1269) 2026-06-23 21:51:22 +02:00
Martin Kroeker a08b1aa853 Fix wrong function name in XERBLA call (Reference-LAPACK PR 1268) 2026-06-23 21:44:14 +02:00
Martin Kroeker 5da71f5c5b Fix typo in passing leading dimension of Y to ?ROT (Reference-LAPACK PR 1265) 2026-06-23 21:25:17 +02:00
Martin Kroeker afcba13127 Use atomic_exchange builtin for spinlock with fil-c, add cc clobber to quickdivide 2026-06-23 21:14:39 +02:00
Martin Kroeker 08c8c1051f fil-c memory safety checker doesn't support syscall 237 (mbind) yet 2026-06-23 21:12:07 +02:00
Martin Kroeker 3ae1586d3f Add tool prefix to symbols when compiling with the fil-c memory checker 2026-06-23 21:08:15 +02:00
Martin Kroeker 5135d5c96c Merge pull request #5844 from kumaraditya303/develop
fix data races in blas_server and level3_thread
2026-06-23 20:56:40 +02:00
Kumar Aditya ea2a52d014 use OPENBLAS_NUM_THREADS=8 in tsan CI 2026-06-23 18:59:26 +05:30
Kumar Aditya 298d53c061 fix data races in blas_server and level3_thread 2026-06-23 18:42:25 +05:30
Martin Kroeker f986fd3322 Merge pull request #5843 from artem-dmitriev/omatcopy
AArch64: NEON omatcopy CT/RT kernels (s/d)
2026-06-21 23:09:45 +02:00
zhir 46aa158dcc AArch64: NEON omatcopy CT/RT kernels 2026-06-20 22:54:04 +03:00
Martin Kroeker 6773c85b16 Merge pull request #5842 from artem-dmitriev/patch-1
bench.h: fix getsec() double time conversion on Apple Silicon
2026-06-20 15:02:18 +02:00
artem dmitriev 2d9cbfc9e9 bench.h: fix getsec() double time conversion on Apple Silicon 2026-06-20 16:01:47 +04:00
Martin Kroeker 7ac17f4b6b Merge pull request #5819 from trg-rgb/docs/riscv-zvl-target-selection
docs: clarify RISC-V RVV target selection and GCC 14+ requirement for ZVL128B/ZVL256B
2026-06-18 10:10:28 +02:00
Martin Kroeker cf627715d9 Merge pull request #5840 from martin-frbg/issue5831
Add support for QEMU's virtual AMD cpu to avoid misdetection as  Opteron
2026-06-15 20:48:56 +02:00
Martin Kroeker 7126fcf40c fix extraneous brace 2026-06-15 15:42:16 +02:00
Martin Kroeker 18e2fe9fa4 Add support for QEMU's virtual AMD cpu to avoid misdetection as Opteron 2026-06-15 14:54:24 +02:00
Martin Kroeker 9bdf051b96 Merge pull request #5838 from ngoldbaum/fix-level3-thread-locks-2
Fix corruption due to lock sharding issues by centralizing locking
2026-06-15 12:35:35 +02:00
Martin Kroeker ef20ea1644 Merge pull request #5828 from amritahs-ibm/fix_dcbt_constraints
Fix incorrect inline assembly constraints in dcbt prefetch instructions
2026-06-15 11:22:10 +02:00
Nathan Goldbaum 7c7c65e692 fix windows build slowness and test errors 2026-06-14 17:09:44 -06:00
Nathan Goldbaum 9363452742 Fix corruption due to lock sharding issues by centralizing locking 2026-06-14 15:32:51 -06:00
Martin Kroeker 7aa79fbdff Merge pull request #5835 from changangela/fix-lapacke-nancheck-overflow
Fix 32-bit integer overflow in LAPACKE nancheck index arithmetic
2026-06-12 09:29:24 +02:00
Yue ChangandClaude Fable 5 ede136ee4e Fix 32-bit integer overflow in LAPACKE nancheck index arithmetic
The optional NaN checks performed by LAPACKE front-ends computed array
offsets and lengths in 32-bit lapack_int arithmetic, which overflows for
large matrices (e.g. LAPACKE_dpotrf with n = lda >= 46341 overflows
j*lda in LAPACKE_dtr_nancheck, leading to out-of-bounds reads and
crashes). Several nancheck helpers (ge, gb, tp, tf) already cast to
size_t; this applies the same treatment to the ones that were missed:

- ?tr_nancheck: cast a[i+j*lda] index to size_t (also covers po/sy/he
  checks, i.e. the POTRF/Cholesky path)
- ?_nancheck (vector): iterate by element count instead of n*inc, with
  size_t indexing
- ?sp/?pp/?pf/?hp/?tp/?tf_nancheck: compute n*(n+1)/2 length in size_t
- ?tz_nancheck: widen the part offsets to int64_t (keeping the -1
  sentinel) and compute them with a widening cast

Verified with UBSan: LAPACKE_str_nancheck at n = lda = 47000 previously
reported signed integer overflow and crashed with SEGV at -O0; it now
passes and still detects the NaN. Old and new code produce identical
results across 1907 enumerated small-size cases (all layouts, uplo,
diag, shapes and NaN positions for tr/tz/vector/packed variants).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 23:42:28 -04:00
Martin Kroeker a033631ee8 Merge pull request #5833 from ayappanec/fix-aix-build
Fix AIX build with OpenXL (ibm-clang)
2026-06-10 13:57:02 +02:00
Ayappan Perumal faf7ddbbea Fix AIX build with OpenXL (ibm-clang) 2026-06-10 04:22:48 -05:00
Martin Kroeker 94f85eb6b1 Merge pull request #5822 from ErnstPeng/la-dev
optimize zgemm, ic/zamin and sdot lsx kernel for 2k3000 cpu
2026-06-09 18:15:48 +02:00
amritahs-ibm 7e3877f263 Merge branch 'develop' into fix_dcbt_constraints 2026-06-09 14:45:02 +05:30
Martin Kroeker 901c214a9b Merge pull request #5827 from amritahs-ibm/use_lxvp_builtins
Power10: Replace vector pair loads with __builtin_vsx_lxvp
2026-06-09 09:41:47 +02:00
pengxu 4850f86e3d optimize sdot lsx kernel 2026-06-08 14:26:03 +08:00
pengxu d1df5928ae optimize ic/zamin lsx kernel 2026-06-08 14:25:26 +08:00
Martin Kroeker 16a5ea5b4c Merge pull request #5829 from martin-frbg/issue5825
Fix OpenMP reentrancy issues in LLVM compilations with gmake on ARM64
2026-06-06 10:55:52 +02:00
Martin Kroeker 7006a422b6 Merge pull request #5826 from ChipKerchner/fasterRVVGEMV
Faster GEMV for RVV
2026-06-05 23:56:49 +02:00
Martin Kroeker 1145c75a96 Comment out the libclang_rt.builtins kludge in preparation for removal 2026-06-05 23:06:28 +02:00
Martin Kroeker 8a767975b0 Comment out the libclang_rt kludge, for future removal 2026-06-05 20:37:28 +02:00
Martin Kroeker 7a08010406 Fix trashing of $data that breaks the check for C11 atomics 2026-06-05 19:22:10 +02:00
Amrita H S 831b822b94 Fix incorrect inline assembly constraints in dcbt prefetch instructions
Corrected the register constraints for the PowerPC dcbt (Data Cache Block
Touch) instruction in Power10 kernel implementations. The dcbt instruction
has special behavior where if the first operand (RA) is r0, it uses the
value 0 instead of the register contents. Therefore, RA must use the "b"
constraint (any GPR except r0), while RB can use "r" (any GPR including r0).

Changes:
- Changed first operand constraint from "r" to "b" to exclude r0
- Changed second operand constraint from "b" to "r" for flexibility

This ensures correct prefetch behavior and compliance with PowerPC ISA
specifications, preventing potential issues where r0 might be incorrectly
used as the base address register.

Signed-off-by: Amrita H S <amritahs@linux.vnet.ibm.com>
2026-06-04 01:49:08 -05:00
Amrita H S 3863a7778d Power10: Replace vector pair loads with __builtin_vsx_lxvp
Replace normal vector pair pointer dereferences with the optimized
__builtin_vsx_lxvp builtin across DGEMM, ZGEMM, and DGEMV kernels.

Also done some identation corrections in dgemm_kernel_power10.c.
This is done as part of POWER code cleanup and may not have any
performance impact.

Signed-off-by: Amrita H S <amritahs@linux.vnet.ibm.com>
2026-06-03 02:34:53 -05:00
Chip Kerchner 6a23c36313 Unroll inner loop - 2 rows at a time. Up to 1.5X faster. 2026-06-02 16:39:16 +00:00
Martin Kroeker 91f97c667e Merge pull request #5824 from mathomp4/bugfix/5823-fix-for-nag
Fix shared lib build with NAG Fortran on macOS
2026-05-30 20:50:42 +02:00
Matthew Thompson 7a2b8b5aa6 cmake: fix shared lib build with NAG Fortran on macOS
On Apple, the shared library link rule for Fortran used GCC-specific flags:
  -x f95-cpp-input   (GCC preprocessing flag; NAG does not support it)
  -Wl,-shared        (Linux linker flag; macOS needs -dynamiclib)

The fix is NAG-specific — other non-GNU compilers (Intel, flang, Cray,
etc.) are left alone since they may handle the existing code paths fine.

Fix in two places (both already inside if(APPLE) / if(APPLE AND BUILD_STATIC_LIBS)):

1. Before add_library() (affects the main CMake Fortran shared lib rule):
   For NAG Fortran, substitute CMAKE_C_CREATE_SHARED_LIBRARY so the
   C compiler link rule is used instead.

2. Inside the APPLE AND BUILD_STATIC_LIBS block (the static->shared
   conversion trick for long argument lists): add an elseif(NAG) branch
   that uses the C compiler with -dynamiclib and auto-detects the NAG
   Fortran runtime (libf72rts) from the compiler's directory so that
   NAGf90_* symbols resolve.

Tested with NAG 7.2.7243 on macOS/arm64.
2026-05-29 11:29:39 -04:00
pengxu 6731dac68b optimize zgemm lsx kernel for 2k3000 cpu 2026-05-29 10:05:39 +08:00
Chip Kerchner 5b22140dfc Merge branch 'develop' of https://github.com/OpenMathLib/OpenBLAS into develop 2026-05-28 15:11:22 +00:00
Tanmay GulhaneandVaibhav805 601ff0ef2a docs: clarify RISC-V RVV target selection and GCC 14+ requirement for ZVL128B/ZVL256B
Add a RISC-V subsection to docs/install.md inside 'Building from source',
between the existing MIPS and FreeBSD sections, covering:

  - Target selection table (RISCV64_GENERIC / RISCV64_ZVL128B /
    RISCV64_ZVL256B / C910V / x280) and what each is for.
  - The general property that GENERIC / ARCH_GENERIC targets across
    all architectures map to the non-vectorized plain-C reference
    path, with the Makefile.riscv64 scalar -march override noted as
    the RISC-V-specific compounding factor.
  - GCC 14+ requirement for the ZVL targets on current OpenBLAS
    releases (GCC 13 does not implement the __riscv_vsseg* intrinsics
    used by the _rvv.c kernels and falls back to scalar silently,
    detectable only by disassembly).
  - Reference objdump-based verification command and expected
    opcode-count range for a correct RISCV64_ZVL128B build.

README.md now keeps a single one-line pointer to the new install.md
section at the spot where users encounter the RISC-V build commands,
so the signposting is preserved without bloating the page that GitHub
renders by default.

v2 of this PR, addresses review feedback from @martin-frbg on
relocation and on the broader GENERIC framing.

Co-authored-by: Vaibhav805 <Vaibhav805@users.noreply.github.com>
2026-05-25 13:29:39 +00:00
Martin Kroeker 1bd74ad3d1 Merge pull request #5820 from martin-frbg/issue5818
Fix misoptimization of C/ZGETF2 by Clang on Apple M
2026-05-25 09:20:56 +02:00
Martin Kroeker 1f2ae720af Make temp1 volatile to keep Clang on AppleM from optimizing out the division guards 2026-05-25 00:35:40 +02:00
Martin Kroeker 804a77cb1a Merge pull request #5803 from Sid-MB/develop
Makefile.install: fix PKGFILE expression so it works with paths with spaces
2026-05-24 18:47:20 +02:00
Martin Kroeker cc84d9cccd add emulated arm64 2026-05-22 12:13:35 +02:00
Martin Kroeker e82de18f9f Update freebsd.yml 2026-05-22 08:09:01 +02:00
Martin Kroeker dc8fcad1ea Update freebsd.yml 2026-05-22 06:57:04 +02:00
Martin Kroeker 69668d1441 Update freebsd.yml 2026-05-21 23:17:58 +02:00
Martin Kroeker 774924e03b Create freebsd.yml 2026-05-21 21:27:52 +02:00
Martin Kroeker 70a5a53747 Fix contiguous memory check for SGEMM and DGEMM. (#5815) 2026-05-19 22:58:22 +02:00
Martin Kroeker fda55ad259 Fix gmake build of ARM64 DYNAMIC_ARCH on hosts lacking SVE (#5816)
* Add march=armv8.4-a+sve(+bf16) to non-PGI options for SVE-capable ARM64 targets
2026-05-19 22:46:13 +02:00
Chip Kerchner f3f718b228 Fix contiguous memory check for SGEMM and DGEMM. 2026-05-18 18:56:29 +00:00
Martin Kroeker 6506d703c9 Merge pull request #5814 from martin-frbg/issue5809
Replace dangerous usage of s_copy macro in C versions of LAPACK ILAENV and IPARMQ
2026-05-18 07:18:35 +02:00
Martin Kroeker 029a05fa84 Replace dangerous usage of s_copy macro with strncpy and fix various warnings 2026-05-17 22:18:58 +02:00
Martin Kroeker 55c72a934f Merge pull request #5813 from martin-frbg/issue5810
Fix TRSM on Barcelona target (and possibly others)
2026-05-15 20:16:25 +02:00
Martin Kroeker 26c4eb65d1 Restore the quick return in common code - the earlier one is CBLAS only 2026-05-15 20:10:51 +02:00
Martin Kroeker 3dc0ba50e2 Merge pull request #5812 from pkubaj/patch-4
Makefile.system: -lm is necessary on power as well
2026-05-15 17:01:02 +02:00
Chip Kerchner b528b9bbe2 Merge branch 'develop' of https://github.com/OpenMathLib/OpenBLAS into develop 2026-05-15 12:18:52 +00:00
Martin Kroeker a47b45d4eb Merge pull request #5801 from pkubaj/patch-2
Makefile.system: when Clang is used, check if gfortran is used
2026-05-14 18:43:36 +02:00
Martin Kroeker 693e22f1f8 Merge pull request #5804 from ayappanec/fix-aix-pwr10
Use -mpwr10 instead of -mpower10 to support AIX assembler
2026-05-14 16:58:45 +02:00
Martin Kroeker 125d79c02b Merge pull request #5797 from martin-frbg/issue5713-2
Fix compiler check for ARM64 SME support in CMake builds
2026-05-14 13:22:54 +02:00
Martin Kroeker 1877075414 Merge pull request #5805 from quic/fix/sgemm-direct-leading-dim-check
Fix incorrect leading dimension check for SME SGEMM direct kernel path
2026-05-14 13:22:03 +02:00
Piotr Kubaj 9cb7d3932f Makefile.system: -lm is necessary on power as well 2026-05-14 09:41:52 +00:00
Rajendra Prasad Matcha c32eefd87f Fix incorrect leading dimension check for SME SGEMM direct kernel path
For row-major matrices, the tight-packing condition should be k==lda
(A is m×k), n==ldb (B is k×n), and n==ldc (C is m×n). The old check
used m==lda and k==ldc, which prevented the SME/direct kernel from
being invoked except when m==k==n (square matrices).

Fixes https://github.com/OpenMathLib/OpenBLAS/issues/5794
2026-05-12 15:45:36 +05:30
Ayappan Perumal beed554ae5 Use -mpwr10 instead of -mpower10 to support AIX assembler 2026-05-10 22:25:03 -05:00
Siddharth M. Bhatia a4aae76382 Makefile.install: fix PKGFILE so it works with paths with spaces
Note that the second setting of PKGFILE, at line 194, is redundant because that line was treated as a shell command which only assigned the variable for that line's invocation.
2026-05-10 14:47:54 -07:00
Martin Kroeker d4d02fee71 Separate LLVM prerequisites for ARMV9SME and VORTEXM4 2026-05-06 22:59:53 +02:00
Martin Kroeker 3da0ff7bc2 Merge pull request #5802 from pkubaj/patch-3
Makefile.power: allow using power10 instructions
2026-05-06 22:19:33 +02:00
Martin Kroeker e8ad16cad1 Merge pull request #5800 from notaz/armv7_sgemm
provide a NEON version of arm/sgemm
2026-05-06 15:47:49 +02:00
Piotr Kubaj 627153fcdb Makefile.power: allow using power10 instructions
OpenBLAS uses various power9 and power10 instructions and they fail to build with errors like in https://github.com/OpenMathLib/OpenBLAS/issues/4793. Just allow the latest ISA, it will generate the same code, but actually allow the binaries to be assembled.
2026-05-06 10:42:07 +00:00
Piotr Kubaj 1dc25c14cd Makefile.system: when Clang is used, check if gfortran is used
At least on power, GCCVERSIONGT4 is checked for when gfortran is used, like at Makefile.power:59
2026-05-06 09:52:44 +00:00
Gražvydas Ignotas fc9d7c7fe3 rename arm32 sgemm_kernel to indicate neon support 2026-05-05 23:09:52 +03:00
Gražvydas Ignotas 9d58b8d64e provide a NEON version of arm/sgemm
benchmark/sgemm.goto before:
 M= 200, N= 200, K= 200 :     9262.97 MFlops   0.001727 sec
after:
 M= 200, N= 200, K= 200 :    30223.64 MFlops   0.000529 sec

Conveniently the registers are already allocated suitably for vector
operation, so the conversion from vfpv3 was rather straightforward.

Prefetching was left out because it doesn't help Cortex-A76,
only hurts it slightly.
2026-05-05 23:09:01 +03:00
Gražvydas Ignotas cd276c2c09 only save the required registers for arm/sgemm
According to ARM AAPCS (Procedure Call Standard) 5.1.2.1, only registers
s16-s31 must be preserved across subroutine calls; registers s0-s15
do not need to be preserved.
2026-05-05 22:36:08 +03:00
Gražvydas Ignotas d7aeae8933 convert labels to local labels for arm/sgemm
Non-local labels interfere with profiling. Same thing was done for arm64 in
commit a0128aa489.
2026-05-05 22:36:08 +03:00
Martin Kroeker 2fd0e2416f Merge branch 'OpenMathLib:develop' into issue5713-2 2026-05-05 19:33:43 +02:00
Martin Kroeker 45e5426e1c Merge pull request #5799 from martin-frbg/fixup5793
Fix inclusion of ARMV9SME in OSX DYNAMIC_ARCH builds with CMake and gcc
2026-05-05 19:33:19 +02:00
Martin Kroeker 373fa9da05 Fix logic for inclusion of ARMV9SME in OSX builds with gcc 2026-05-05 15:59:43 +02:00
Martin Kroeker 7b7aaac822 Merge pull request #5798 from martin-frbg/issue5713-3
Restore WoA compatibility fix in dynamic_arm64.c
2026-05-05 10:12:22 +02:00
Martin Kroeker 7324f370bf Restore use of strnicmp for strncasecmp on Windows 2026-05-05 00:00:47 +02:00
Martin Kroeker 8bc50c45ac Merge pull request #5796 from paulgessinger/fix/test-makefile
Use FEXTRALIB in test Makefile
2026-05-04 23:53:55 +02:00
Martin Kroeker 3cde598ea2 Correct file extension of assembly testcase for SME support 2026-05-04 23:33:22 +02:00
Paul Gessinger 88705a9328 Use FEXTRALIB in test Makefile
See https://github.com/OpenMathLib/OpenBLAS/issues/5795
When the compiler toolchain is not the same for C/C++ and fortran, the
linker can fail to resolve the `gfortran` library.
2026-05-04 17:13:04 +02:00
Martin Kroeker 416008431f Merge pull request #5793 from martin-frbg/issue5775
Reduce the default list of DYNAMIC_ARCH targets for ARM64-based Apple systems
2026-05-04 09:04:58 +02:00
Martin Kroeker bd3cd916a5 fix typo in redirect 2026-05-03 18:54:57 +02:00
Martin Kroeker 2f6a673980 Add target redirects for building on Apple hardware 2026-05-03 12:12:56 +02:00
Martin Kroeker 8e57c8667d Merge pull request #5791 from moluopro/develop
Fix Apple platform detection and iOS cross-build
2026-05-02 23:09:09 +02:00
Martin Kroeker 525070fdcd Reduce the default list of DYNAMIC_ARCH targets for ARM64-based Apple systems 2026-05-02 19:51:08 +02:00
Martin Kroeker 0dceb8313e Reduce the default list of DYNAMIC_ARCH targets for ARM64-based Apple systems 2026-05-02 19:50:16 +02:00
Martin Kroeker 08a67c87e4 Merge pull request #5792 from martin-frbg/issue5787
Fix 32bit builds on AMD Ryzen by mapping to NEHALEM rather than BARCELONA
2026-05-02 18:40:32 +02:00
Martin Kroeker f90b0d5bc5 expand target-prefix in fc-pkg 2026-05-02 13:50:09 +02:00
Martin Kroeker d394815eb2 rework msys2 install as mingw i686 has dropped gfortran 2026-05-02 11:54:40 +02:00
Martin Kroeker 3b23194778 Map 32bit ZEN to NEHALEM rather than old BARCELONA 2026-05-01 23:15:38 +02:00
Martin Kroeker 619c22a14a map 32bit ZEN to NEHALEM rather than BARCELONA 2026-05-01 23:14:06 +02:00
Martin Kroeker c8dbfd74e2 Merge pull request #5789 from luhenry/develop
Fix compilation with DYNAMIC_TARGET=1 and BUILD_BFLOAT16
2026-05-01 10:07:56 +02:00
moluopro 6419432e7d Update iOS documentation wording 2026-05-01 13:18:25 +08:00
moluopro a8ac7c91fc Update iOS crossbuild commands 2026-05-01 13:06:29 +08:00
moluopro e2174b31c1 Fix iOS target detection on Darwin 2026-05-01 13:06:14 +08:00
Martin Kroeker 4e5c4bf567 Merge pull request #5790 from martin-frbg/issue5627-3
Correct offsets in PowerPC SCAL assembly under FreeBSD and re-enable for PPC970
2026-04-30 23:20:04 +02:00
Martin Kroeker 33c14c66c7 spell out ifdefined 2026-04-30 17:31:01 +02:00
Martin Kroeker 703710763d Correct stack offset of FLAG on FreeBSD 2026-04-30 17:29:31 +02:00
Martin Kroeker 54efe8ae71 Correct stack offset of FLAG on FreeBSD 2026-04-30 17:28:10 +02:00
Martin Kroeker 57765364fc Return to using assembly SCAL kernels on FreeBSD 2026-04-30 17:25:25 +02:00
Ludovic Henry 43aa35c2ef Fix compilation with DYNAMIC_TARGET=1 and BUILD_BFLOAT16
coremsg isn't defined outside the BUILD_BFLOAT16 and BUILD_HFLOAT16 blocks, leading to the use of an undefined variable
2026-04-30 16:28:56 +02:00
Martin Kroeker 1ecfee24b3 Merge pull request #5788 from martin-frbg/move-cirrus-neoversen1-jobs
CI: Move NeoverseN1 jobs from deprecated Cirrus to gh workflows
2026-04-30 14:30:06 +02:00
Martin Kroeker 75791e4d0a fix typo 2026-04-30 07:51:51 +02:00
Martin Kroeker b4dececea7 Disable all tasks except the FreeBSD ones 2026-04-30 00:14:33 +02:00
Martin Kroeker fd09633cdf Add NEOVERSEN1 jobs from the deprecated Cirrus setup 2026-04-30 00:09:51 +02:00
Martin Kroeker d4824562d9 Merge pull request #5786 from martin-frbg/macos-runner-port-cirrus
GH runner macos: Add cross-compilation to x86_64 based on the Cirrus CI job
2026-04-29 22:11:09 +02:00
Martin Kroeker a8974e0f7a Add Android NDK-ARMV7 crossbuild 2026-04-29 21:16:29 +02:00
Martin Kroeker a3cd2eeaa7 Update apple_m.yml 2026-04-29 14:55:22 +02:00
Martin Kroeker 65ae31125f Update apple_m.yml 2026-04-28 11:12:56 +02:00
Martin Kroeker beb4ab7bf6 Update MacOS image for xbuild to Tahoe 2026-04-27 23:16:15 +02:00
Martin Kroeker f2c5129b40 Update apple_m.yml 2026-04-27 22:56:01 +02:00
Martin Kroeker 5fa0aec3cf Update apple_m.yml 2026-04-27 22:44:13 +02:00
Martin Kroeker 94b4c6c47c Add cross-compilation to x86_64 based on the Cirrus CI job 2026-04-27 20:14:36 +02:00
Martin Kroeker 10cf63eea4 Merge pull request #5784 from martin-frbg/issue5783
Fix printing of Loongarch LSX/LASX status to the config file
2026-04-27 14:20:56 +02:00
Martin Kroeker 0a3e061977 Update cpuid_loongarch64.c
fix conditional printing of LSX/LASX status to the configuration files
2026-04-27 08:56:38 +02:00
Martin Kroeker 2347cdd77f Merge pull request #5781 from martin-frbg/zhaoxin_cpuids
Add AVX2 capability check to generic Zhaoxin cpu autodetection
2026-04-26 10:09:01 +02:00
Martin Kroeker 7367af6649 Merge pull request #5780 from martin-frbg/lapack1225
Calculate LWORK in CUNMLQ K=0 case like ZUNMLQ  (Reference-LAPACK PR 1225)
2026-04-25 22:18:37 +02:00
Martin Kroeker feca8f994d Recognize other AVX2-capable Zhaoxin cpus 2026-04-25 19:18:28 +02:00
Martin Kroeker 9019f9b6ff Recognize other recent AVX2-capable Zhaoxin cpus 2026-04-25 19:15:57 +02:00
Martin Kroeker 0b3b486606 Calculate LWORK in K=0 case consistently with ZUNMLQ (Reference-LAPACK PR 1225) 2026-04-25 19:11:43 +02:00
Martin Kroeker 05ecfc6d47 Merge pull request #5779 from martin-frbg/issue5778
Keep getarch from generating a conflicting -j argument for gmake
2026-04-25 17:26:57 +02:00
Martin Kroeker a90ffae6b2 Automate use of MAKE_NB_JOBS=-1 to avoid adding a conflicting job count entry to MAKEFLAGS 2026-04-25 14:14:34 +02:00
Martin Kroeker a8469771b5 Merge pull request #5777 from gruenich/feature/update-github-actions
[ci] Update GitHub Actions to latest major release
2026-04-24 22:48:34 +02:00
Martin Kroeker 662d80bf37 Merge pull request #5776 from chris-se/cmake-macos-ninja
CMake: properly fix build on macOS with Ninja (cf. to response files)
2026-04-24 13:45:58 +02:00
Christoph Grüninger 91f83f00b9 [ci] Set CodSpeedHQ/action's mode to simulation
v4 requires the mode to me explicitly set.
2026-04-24 07:18:11 +02:00
Christoph Grüninger 0a74cb6dcc [ci] Update GitHub Actions to latest major release
Fixes deprecations warnings that Node20.js will stop
working in June.
2026-04-23 21:37:42 +02:00
Christian Seiler ca4d867cbb CMake: properly fix build on macOS with Ninja (related to response files)
On macOS several build-related programs (`cc`, `ar`) will not accept
the linker line if too many files have been added to it in the
DYNAMIC_ARCH case. (This now occurs on all platforms where macOS
runs / used to run, as there are enough ARM variants that are
build with DYNAMIC_ARCH that the number of files exceeds the
intrinsic limit on macOS.)

The workaround for this is to use response files that contain the
file list themselves, and pass these to the build system. For
dynamic libraries this works fine, but for static libraries it
doesn't because `ar` doesn't accept response files on macOS. For this
reason there was previously a workaround in CMakeLists.txt to handle
this, but the workaround didn't take into consideration that when
building only a shared library it is not actually necessary, and
when building static libraries the response file CMake generates for
Ninja is at a different location than the response files CMake
generates for Unix Makefiles.

This commit cleans this all up by setting the necessary options for
the response files to be properly generated, and adjusts the additional
workaround to only be applicable in the case a static library is
built. The workaround is also adjusted to handle the Ninja case.

Fixes GitHub issue #5775
2026-04-23 15:48:26 +02:00
Martin Kroeker 3c553ef705 Update version to 0.3.33.dev 2026-04-23 14:00:39 +02:00
Martin Kroeker 7aa181e819 Update version to 0.3.33.dev 2026-04-23 13:59:53 +02:00
Martin Kroeker c696bdcfa8 Merge pull request #5774 from OpenMathLib/release-0.3.0
merge back from release branch to copy tag
2026-04-23 13:59:07 +02:00
Martin Kroeker 62bcfb0dc9 Update version to 0.3.33
apple m / build (cmake, gfortran, 0, 0) (push) Canceled after 0s
apple m / build (cmake, gfortran, 0, 1) (push) Canceled after 0s
apple m / build (cmake, gfortran, 1, 0) (push) Canceled after 0s
apple m / build (cmake, gfortran, 1, 1) (push) Canceled after 0s
apple m / build (make, gfortran, 0, 0) (push) Canceled after 0s
apple m / build (make, gfortran, 0, 1) (push) Canceled after 0s
apple m / build (make, gfortran, 1, 0) (push) Canceled after 0s
apple m / build (make, gfortran, 1, 1) (push) Canceled after 0s
c910v qemu test / TEST (riscv64-linux-gnu, NO_SHARED=1 TARGET=C910V, C910V, riscv64-unknown-linux-gnu) (push) Canceled after 0s
c910v qemu test / TEST (riscv64-linux-gnu, NO_SHARED=1 TARGET=RISCV64_GENERIC, RISCV64_GENERIC, riscv64-linux-gnu) (push) Canceled after 0s
Run codspeed benchmarks / benchmarks (make, gfortran, ubuntu-22.04, 3.12) (push) Canceled after 0s
continuous build / build (cmake, clang, flang, ubuntu-latest) (push) Canceled after 0s
continuous build / build (cmake, clang, gfortran, macos-latest) (push) Canceled after 0s
continuous build / build (cmake, clang, gfortran, ubuntu-24.04-arm) (push) Canceled after 0s
continuous build / build (cmake, clang, gfortran, ubuntu-latest) (push) Canceled after 0s
continuous build / build (cmake, clang-21, flang, ubuntu-latest) (push) Canceled after 0s
continuous build / build (cmake, clang-21, gfortran, ubuntu-24.04-arm) (push) Canceled after 0s
continuous build / build (cmake, clang-21, gfortran, ubuntu-latest) (push) Canceled after 0s
continuous build / build (cmake, gcc, flang, ubuntu-latest) (push) Canceled after 0s
continuous build / build (cmake, gcc, gfortran, ubuntu-24.04-arm) (push) Canceled after 0s
continuous build / build (cmake, gcc, gfortran, ubuntu-latest) (push) Canceled after 0s
continuous build / build (make, clang, flang, ubuntu-latest) (push) Canceled after 0s
continuous build / build (make, clang, gfortran, macos-latest) (push) Canceled after 0s
continuous build / build (make, clang, gfortran, ubuntu-24.04-arm) (push) Canceled after 0s
continuous build / build (make, clang, gfortran, ubuntu-latest) (push) Canceled after 0s
continuous build / build (make, clang-21, flang, ubuntu-latest) (push) Canceled after 0s
continuous build / build (make, clang-21, gfortran, ubuntu-24.04-arm) (push) Canceled after 0s
continuous build / build (make, clang-21, gfortran, ubuntu-latest) (push) Canceled after 0s
continuous build / build (make, gcc, flang, ubuntu-latest) (push) Canceled after 0s
continuous build / build (make, gcc, gfortran, ubuntu-24.04-arm) (push) Canceled after 0s
continuous build / build (make, gcc, gfortran, ubuntu-latest) (push) Canceled after 0s
continuous build / msys2 (None, fc, int32, UCRT64, mingw-w64-ucrt-x86_64) (push) Canceled after 0s
continuous build / msys2 (Release, fc, int32, CLANG64, mingw-w64-clang-x86_64) (push) Canceled after 0s
continuous build / msys2 (Release, fc, int32, MINGW32, mingw-w64-i686) (push) Canceled after 0s
continuous build / msys2 (Release, fc, int32, UCRT64, mingw-w64-ucrt-x86_64) (push) Canceled after 0s
continuous build / msys2 (Release, fc, int64, -DBINARY=64 -DINTERFACE64=1, CLANG64, mingw-w64-clang-x86_64) (push) Canceled after 0s
continuous build / msys2 (Release, fc, int64, -DBINARY=64 -DINTERFACE64=1, UCRT64, mingw-w64-ucrt-x86_64) (push) Canceled after 0s
continuous build / cross_build (DYNAMIC_ARCH=1 TARGET=GENERIC, mips64el, mips64el-linux-gnuabi64) (push) Canceled after 0s
continuous build / cross_build (TARGET=EV4, alpha, alpha-linux-gnu) (push) Canceled after 0s
continuous build / cross_build (TARGET=MIPS1004K, mipsel, mipsel-linux-gnu) (push) Canceled after 0s
continuous build / cross_build (TARGET=RISCV64_GENERIC, riscv64, riscv64-linux-gnu) (push) Canceled after 0s
continuous build / neoverse_build (push) Canceled after 0s
harmonyos / build (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=GENERIC, DYNAMIC_ARCH, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA264, LA264, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA464, LA464, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA64_GENERIC, LA64_GENERIC, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON2K1000, LOONGSON2K1000, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON3R5, LOONGSON3R5, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSONGENERIC, LOONGSONGENERIC, loongarch64-linux-gnu) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=GENERIC, DYNAMIC_ARCH) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA264, LA264) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA464, LA464) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LA64_GENERIC, LA64_GENERIC) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON2K1000, LOONGSON2K1000) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSON3R5, LOONGSON3R5) (push) Canceled after 0s
loongarch64 clang qemu test / TEST (NO_SHARED=1 DYNAMIC_ARCH=1 TARGET=LOONGSONGENERIC, LOONGSONGENERIC) (push) Canceled after 0s
mips64 qemu test / TEST (NO_SHARED=1 TARGET=I6400, I6400, mipsisa64r6el-linux-gnuabi64) (push) Canceled after 0s
mips64 qemu test / TEST (NO_SHARED=1 TARGET=I6500, I6500, mipsisa64r6el-linux-gnuabi64) (push) Canceled after 0s
mips64 qemu test / TEST (NO_SHARED=1 TARGET=MIPS64_GENERIC, MIPS64_GENERIC, mips64el-linux-gnuabi64) (push) Canceled after 0s
mips64 qemu test / TEST (NO_SHARED=1 TARGET=P6600, P6600, mipsisa64r6el-linux-gnuabi64) (push) Canceled after 0s
mips64 qemu test / TEST (NO_SHARED=1 TARGET=SICORTEX, SICORTEX, mips64el-linux-gnuabi64) (push) Canceled after 0s
Nightly-Homebrew-Build / build-OpenBLAS-with-Homebrew (push) Canceled after 0s
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) Canceled after 0s
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) Canceled after 0s
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) Canceled after 0s
2026-04-23 13:50:46 +02:00
Martin Kroeker a8ffcea555 Merge pull request #5773 from OpenMathLib/develop
Merge from develop for 0.3.33 release
2026-04-23 13:49:27 +02:00
Martin Kroeker b0a0364be7 Merge branch 'release-0.3.0' into develop 2026-04-23 13:49:10 +02:00
Martin Kroeker dbad3e1e19 Update version to 0.3.33 2026-04-23 13:44:05 +02:00
Martin Kroeker 2bbd11129c Merge pull request #5772 from martin-frbg/changelog0333
Update the Changelog for 0.3.33
2026-04-23 13:41:04 +02:00
Martin Kroeker 81bf61b118 Update for 0.3.33 2026-04-23 13:02:04 +02:00
Martin Kroeker c7356182f4 Merge pull request #5771 from martin-frbg/lapack1257
Fix EXTERNAL declarations in CLARF1F and ZUPMTR  (Reference-LAPACK PR 1257)
2026-04-23 12:24:34 +02:00
Martin Kroeker 70d1c2f7b2 Fix EXTERNAL declarations (Reference-LAPACK PR 1257) 2026-04-23 09:44:16 +02:00
Martin Kroeker 07e7594ffe Merge pull request #5769 from martin-frbg/issue5768
Fix CMake builds on Apple that use the Ninja generator
2026-04-22 23:15:36 +02:00
Martin Kroeker e447f2c7ce Merge pull request #5770 from martin-frbg/undef_prefsize
Undefine GEMM_PREFERRED_SIZE before redefining to silence warning
2026-04-22 21:18:25 +02:00
Martin Kroeker ded9a96920 Merge pull request #5767 from martin-frbg/issue5763
Fix ARM64 DYNAMIC_ARCH unconditionally branching into the SME code for STRMM
2026-04-22 20:11:31 +02:00
Martin Kroeker c1bb49dc51 Omit the entire APPLE-specific block if using Ninja 2026-04-22 17:48:59 +02:00
Martin Kroeker 54b939e4e3 Undefine GEMM_PREFERRED_SIZE before redefining to silence warning 2026-04-22 16:30:12 +02:00
Martin Kroeker d270dcb123 Using response files on Mac is incompatible (and unnecessary) with Ninja 2026-04-22 15:58:04 +02:00
Martin Kroeker 59cfea0859 Move quick return out of the scope of the potential DYNAMIC_ARCH check 2026-04-22 15:38:04 +02:00
Martin Kroeker fd862d43b6 Remove redundant quick return 2026-04-22 15:36:57 +02:00
Martin Kroeker 74486799bb Move quick return out of the scope of the DYNAMIC_ARCH conditional for SME 2026-04-22 12:22:09 +02:00
Martin Kroeker 9a46ffba36 Merge pull request #5766 from martin-frbg/lapack1251
Optimize ?LACPY/?LASCL/?LANTR looping in fat matrix cases with UPLO=L (Reference-LAPACK PR 1251)
2026-04-21 23:53:10 +02:00
Martin Kroeker 775f467be6 Optimize looping over the lower triangular in fat matrix cases 2026-04-21 21:30:36 +02:00
Martin Kroeker 41dbca901e Merge pull request #5765 from martin-frbg/issue5764
Disable gcc-specific version checks for NVIDIA HPC in CMake builds
2026-04-21 14:33:11 +02:00
Martin Kroeker c87e4fca72 Disable gcc-specific version checks for NVIDIA HPC 2026-04-21 12:16:10 +02:00
Martin Kroeker 02dc625d42 Merge pull request #5762 from martin-frbg/issue5750
Guard against eventual overflow of the config string
2026-04-17 00:03:09 +02:00
Martin Kroeker 6f0dfd5276 Guard against eventual overflow of the config string 2026-04-16 18:37:08 +02:00
Martin Kroeker b8bb6d08f7 Merge pull request #5761 from martin-frbg/fixup5759
Add part code for NeoverseV3 to the build-time detection as well
2026-04-16 18:09:16 +02:00
Martin Kroeker 2a5d33a95d Add part code for NeoverseV3 2026-04-16 14:45:41 +02:00
Martin Kroeker b77cd0ae06 Merge pull request #5760 from teddygood/wasm-trsm
Add WebAssembly SIMD STRSM and DTRSM kernels
2026-04-16 14:39:26 +02:00
Martin Kroeker 4991de5f3e Merge pull request #5759 from nSircombe/feature/v3support
Add CPU ID for Neoverse V3
2026-04-16 14:38:32 +02:00
Martin Kroeker fe23eadd17 Merge pull request #5758 from martin-frbg/spack_bignuma
Automatically assume BIGNUMA if more than 256 CPUs defined/detected
2026-04-16 11:46:53 +02:00
teddygood ecca5e480d Add WASM128_GENERIC STRSM and DTRSM kernels 2026-04-16 17:52:37 +09:00
teddygood 2847354ffb Allow target-specific GEMM and TRSM overrides 2026-04-16 17:52:37 +09:00
Nathan John Sircombe 5f4a5b323d Update (c) years and contributors 2026-04-16 08:53:32 +01:00
Nathan John Sircombe 3a3903a49e Add CPU ID for Neoverse V3 2026-04-15 22:07:32 +01:00
Martin Kroeker 822b873c7c Automatically assume BIGNUMA if more than 256 CPUs 2026-04-15 22:59:12 +02:00
Martin Kroeker 330abcd5a9 Merge pull request #5707 from vtjnash/jn/makefile-rule-dynamic-2
Reapply "build: fix rule for building dynamic files"
2026-04-15 21:58:21 +02:00
Martin Kroeker 7073b680ee Merge pull request #5757 from martin-frbg/lapack1212+1228
Fix typos in EIG DMD tests and initialize cutoff (Reference-LAPACK PRs 1212&1228)
2026-04-15 19:02:47 +02:00
Martin Kroeker 1d15733ff5 Fix typos and initialize cutoff value (Reference-LAPACK PRs 1212&1228) 2026-04-15 12:16:03 +02:00
Martin Kroeker 70faa9f19d Merge pull request #5756 from OpenMathLib/issue5267
Work around miscompilation of the AVX512 ?GEMM kernels by Windows LLVM
2026-04-15 07:58:21 +02:00
Martin Kroeker 172f41c818 Merge pull request #5674 from ChipKerchner/fasterRVVEdges
Improve performance on edges of GEMM for RISC-V
2026-04-11 22:04:21 +02:00
Chip Kerchner 0a4d6b2e11 Forgot files from previous check-in. 2026-04-02 20:15:32 +00:00
Chip Kerchner cc1b5794a0 Reduce number of vectors in use from 32 to 24 for last stage of main block - now full LMUL2. 2026-04-02 20:14:57 +00:00
Chip Kerchner 22b7950baa Use LMUL2 for calculations in main block - just break them apart before last stage. 2026-04-02 16:24:15 +00:00
Chip Kerchner 3b1aef12c7 Use LMUL2 loads in main block. 2026-04-02 13:20:16 +00:00
Chip Kerchner daa3215fb4 Remove shadow variable. 2026-03-31 14:41:38 +00:00
Chip Kerchner d69be17b6f Convert 2X LMUL1 instructions to 1X LMUL2. Improved FP64 GEMM edges - up to more than 3X faster. 2026-03-30 18:50:27 +00:00
Chip Kerchner 8fc0004024 Fix another typo. 2026-03-24 13:04:54 +00:00
Jameson Nash c114ca5247 Reapply "build: fix rule for building dynamic files"
This reverts commit 7eab365219 and fixes
the pattern rule requirement "% must match a non-empty stem" to match at
least '.' in the pattern.

This whole file could actually be substantially simplified to just:

	%.$(SUFFIX): %.c
		$(CC) $(CFLAGS) -c $< -o $(@F)

	%.$(PSUFFIX): %.c
		$(CC) $(PFLAGS) -c $< -o $(@F)

if desired to entirely avoid the copy-paste duplication, but the net
effect is the same.
2026-03-23 23:09:47 -04:00
Martin Kroeker 983fca52d5 Merge branch 'develop' into jn/build-exe 2026-03-23 18:59:02 +01:00
Chip Kerchner ebf4cd1c6e Fix typo. 2026-03-22 18:28:21 +00:00
Chip Kerchner 1bb72b223d Only initialize unused variables to prevent GCC warnings. 2026-03-20 16:00:33 +00:00
Chip Kerchner a8a00bbf4f Avoid greater than 4 segment load and store penalties by using 2. Fix mf2 length. 2026-03-19 21:17:20 +00:00
Chip Kerchner 1e48686df8 Merge remote-tracking branch 'origin/develop' into fasterRVVEdges 2026-03-19 12:15:19 +00:00
Chip Kerchner d832ee5086 More global optimzation and clean up. 2026-03-18 13:43:03 +00:00
Chip Kerchner 477dd40f07 Simplier loops. 2026-03-17 21:18:30 +00:00
Chip Kerchner 79d9fe39c2 Use mf2 instead of m1. 2026-03-17 16:06:54 +00:00
Chip Kerchner f927b9448a Global optimizations. 2026-03-16 21:32:17 +00:00
Chip Kerchner 010f24f961 Better K. 2026-03-16 13:22:31 +00:00
Chip Kerchner b0ee407943 Preserve K. 2026-03-14 17:46:42 +00:00
Chip Kerchner eb9bbcc299 Common unroll code. 2026-03-14 16:38:12 +00:00
Chip Kerchner fda433f25a Unroll K for N less than or equal to 4. 2026-03-13 22:17:47 +00:00
Chip Kerchner 9c16449dfd Add K-unrolling to M = 8. Other small changes. 2026-03-13 15:59:29 +00:00
Chip Kerchner 6d6af1dee5 Add bool types for C. 2026-03-12 13:13:34 +00:00
Chip Kerchner 376d3a138f Fast performing edges for FP32 GEMM of RVV. 2026-03-12 12:33:25 +00:00
Chip Kerchner 548a9f3eaa Merge remote-tracking branch 'origin/develop' into HEAD 2026-03-11 21:07:28 +00:00
Jameson NashandClaude Opus 4.5 7414e363f0 Add $(EXE) suffix to executables in Makefiles
Define EXE variable in Makefile.system (set to .exe on Windows,
empty otherwise) and update all test executables to use it for
Windows compatibility.

- Makefile.system: Add EXE variable definition
- test/Makefile: Update all executables with $(EXE) suffix
- ctest/Makefile: Update all executables with $(EXE) suffix
- utest/Makefile: Update UTESTBIN and UTESTEXTBIN with $(EXE) suffix
- Makefile.install: Update install_tests target with $(EXE) suffix
- .gitignore: Add *.exe pattern

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 14:49:34 -05:00
362 changed files with 31244 additions and 16237 deletions
+122 -121
View File
@@ -1,6 +1,6 @@
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:latest
#macos_instance:
# image: ghcr.io/cirruslabs/macos-monterey-xcode:latest
#
#task:
# name: AppleM1/LLVM
# compile_script:
@@ -9,7 +9,7 @@ macos_instance:
# - export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
# - export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
# - make TARGET=VORTEX USE_OPENMP=1 CC=clang
#
#task:
# name: AppleM1/LLVM/ILP64
# compile_script:
@@ -18,7 +18,7 @@ macos_instance:
# - export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
# - export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
# - make TARGET=VORTEX USE_OPENMP=1 CC=clang INTERFACE64=1
#
#task:
# name: AppleM1/LLVM/CMAKE
# compile_script:
@@ -30,7 +30,7 @@ macos_instance:
# - cd build
# - cmake -DTARGET=VORTEX -DCMAKE_C_COMPILER=clang -DBUILD_SHARED_LIBS=ON ..
# - make -j 4
#
#task:
# name: AppleM1/GCC/MAKE/OPENMP
# compile_script:
@@ -39,124 +39,125 @@ macos_instance:
# - export LDFLAGS="-L/opt/homebrew/lib"
# - export CPPFLAGS="-I/opt/homebrew/include"
# - make CC=gcc-11 FC=gfortran-11 USE_OPENMP=1
macos_instance:
image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest
task:
name: AppleM1/LLVM x86_64 xbuild
compile_script:
- #brew install llvm
- export #PATH=/opt/homebrew/opt/llvm/bin:$PATH
- export #LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
- export #CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
- export ARCHS="i386 x86_64"
- export ARCHS_STANDARD="i386 x86_64"
- export ARCHS_STANDARD_32_64_BIT="i386 x86_64"
- export ARCHS_STANDARD_64_BIT=x86_64
- export ARCHS_STANDARD_INCLUDING_64_BIT="i386 x86_64"
- export ARCHS_UNIVERSAL_IPHONE_OS="i386 x86_64"
- export VALID_ARCHS="i386 x86_64"
- xcrun --sdk macosx --show-sdk-path
- xcodebuild -version
- export CC=/Applications/Xcode_26.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
- export CFLAGS="-O2 -unwindlib=none -Wno-macro-redefined -isysroot /Applications/Xcode_26.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk -arch x86_64"
- make TARGET=CORE2 DYNAMIC_ARCH=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1 RANLIB="ls -l"
always:
config_artifacts:
path: "*conf*"
type: text/plain
#
#macos_instance:
# image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest
#task:
# name: AppleM1/LLVM x86_64 xbuild
# compile_script:
# - #brew install llvm
# - export #PATH=/opt/homebrew/opt/llvm/bin:$PATH
# - export #LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
# - export #CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
# - export ARCHS="i386 x86_64"
# - export ARCHS_STANDARD="i386 x86_64"
# - export ARCHS_STANDARD_32_64_BIT="i386 x86_64"
# - export ARCHS_STANDARD_64_BIT=x86_64
# - export ARCHS_STANDARD_INCLUDING_64_BIT="i386 x86_64"
# - export ARCHS_UNIVERSAL_IPHONE_OS="i386 x86_64"
# - export VALID_ARCHS="i386 x86_64"
# - xcrun --sdk macosx --show-sdk-path
# - xcodebuild -version
# - export CC=/Applications/Xcode_26.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
# - export CFLAGS="-O2 -unwindlib=none -Wno-macro-redefined -isysroot /Applications/Xcode_26.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk -arch x86_64"
# - make TARGET=CORE2 DYNAMIC_ARCH=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1 RANLIB="ls -l"
# always:
# config_artifacts:
# path: "*conf*"
# type: text/plain
# lib_artifacts:
# path: "libopenblas*"
# type: application/octet-streamm
macos_instance:
image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest
task:
name: AppleM1/LLVM armv8-ios xbuild
compile_script:
- #brew install llvm
- export #PATH=/opt/homebrew/opt/llvm/bin:$PATH
- export #LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
- export #CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
- export CC=/Applications/Xcode_26.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
- export CFLAGS="-O2 -unwindlib=none -Wno-macro-redefined -isysroot /Applications/Xcode_26.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.0.sdk -arch arm64 -miphoneos-version-min=10.0"
- xcrun --sdk iphoneos --show-sdk-path
- ls -l /Applications
- make TARGET=ARMV8 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1 CROSS=1
always:
config_artifacts:
path: "*conf*"
type: text/plain
macos_instance:
image: ghcr.io/cirruslabs/macos-tahoe-xcode:latest
task:
name: AppleM1/LLVM armv7-androidndk xbuild
compile_script:
- brew install --cask android-ndk
- export ANDROID_NDK_HOME="/opt/homebrew/share/android-ndk"
- export CC=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi23-clang
- export AR=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar
- export RANLIB=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib
- make TARGET=ARMV7 ARM_SOFTFP_ABI=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1
always:
config_artifacts:
path: "*conf*"
type: text/plain
task:
name: NeoverseN1
arm_container:
image: node:latest
compile_script:
- make
task:
name: NeoverseN1-ILP64
arm_container:
image: node:latest
compile_script:
- make INTERFACE64=1
task:
name: NeoverseN1-OMP
arm_container:
image: node:latest
cpu: 8
compile_script:
- make USE_OPENMP=1
FreeBSD_task:
name: FreeBSD-gcc
freebsd_instance:
image_family: freebsd-14-3
install_script:
- pkg update -f && pkg upgrade -y && pkg install -y gmake gcc
compile_script:
- ls -l /usr/local/lib
- gmake CC=gcc
FreeBSD_task:
name: freebsd-gcc-ilp64
freebsd_instance:
image_family: freebsd-14-3
install_script:
- pkg update -f && pkg upgrade -y && pkg install -y gmake gcc
compile_script:
- ls -l /usr/local/lib
- gmake CC=gcc INTERFACE64=1
FreeBSD_task:
name: FreeBSD-clang-openmp
freebsd_instance:
image_family: freebsd-14-3
install_script:
- pkg update -f && pkg upgrade -y && pkg install -y gmake gcc
- ln -s /usr/local/lib/gcc14/libgfortran.so.5.0.0 /usr/lib/libgfortran.so
compile_script:
- gmake CC=clang FC=gfortran USE_OPENMP=1 CPP_THREAD_SAFETY_TEST=1
#
#macos_instance:
# image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest
#task:
# name: AppleM1/LLVM armv8-ios xbuild
# compile_script:
# - #brew install llvm
# - export #PATH=/opt/homebrew/opt/llvm/bin:$PATH
# - export #LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
# - export #CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
# - export CC=/Applications/Xcode_26.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
# - export CFLAGS="-O2 -unwindlib=none -Wno-macro-redefined -isysroot /Applications/Xcode_26.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.0.sdk -arch arm64 -miphoneos-version-min=10.0"
# - xcrun --sdk iphoneos --show-sdk-path
# - ls -l /Applications
# - make TARGET=ARMV8 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1 CROSS=1
# always:
# config_artifacts:
# path: "*conf*"
# type: text/plain
#
#macos_instance:
# image: ghcr.io/cirruslabs/macos-tahoe-xcode:latest
#task:
# name: AppleM1/LLVM armv7-androidndk xbuild
# compile_script:
# - brew install --cask android-ndk
# - export ANDROID_NDK_HOME="/opt/homebrew/share/android-ndk"
# - export CC=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi23-clang
# - export AR=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar
# - export RANLIB=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib
# - make TARGET=ARMV7 ARM_SOFTFP_ABI=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1
# always:
# config_artifacts:
# path: "*conf*"
# type: text/plain
#
#task:
# name: NeoverseN1
# arm_container:
# image: node:latest
# compile_script:
# - make
#
# task:
# name: NeoverseN1-ILP64
# arm_container:
# image: node:latest
# compile_script:
# - make INTERFACE64=1
#
#task:
# name: NeoverseN1-OMP
# arm_container:
# image: node:latest
# cpu: 8
# compile_script:
# - make USE_OPENMP=1
#
#
#FreeBSD_task:
# name: FreeBSD-gcc
# freebsd_instance:
# image_family: freebsd-14-3
# install_script:
# - pkg update -f && pkg upgrade -y && pkg install -y gmake gcc
# compile_script:
# - ls -l /usr/local/lib
# - gmake CC=gcc
#
#
#FreeBSD_task:
# name: freebsd-gcc-ilp64
# freebsd_instance:
# image_family: freebsd-14-3
# install_script:
# - pkg update -f && pkg upgrade -y && pkg install -y gmake gcc
# compile_script:
# - ls -l /usr/local/lib
# - gmake CC=gcc INTERFACE64=1
#
#FreeBSD_task:
# name: FreeBSD-clang-openmp
# freebsd_instance:
# image_family: freebsd-14-3
# install_script:
# - pkg update -f && pkg upgrade -y && pkg install -y gmake gcc
# - ln -s /usr/local/lib/gcc14/libgfortran.so.5.0.0 /usr/lib/libgfortran.so
# compile_script:
# - gmake CC=clang FC=gfortran USE_OPENMP=1 CPP_THREAD_SAFETY_TEST=1
#
#task:
# name: Windows/LLVM16 --- too slow ---
# windows_container:
+150 -4
View File
@@ -1,6 +1,14 @@
name: apple m
on: [push, pull_request]
on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -10,7 +18,7 @@ permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
build-windows:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: macos-14
@@ -24,7 +32,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Print system information
run: |
@@ -52,7 +60,7 @@ jobs:
fi
- name: Compilation cache
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ~/.ccache
# We include the commit sha in the cache key, as new cache entries are
@@ -155,3 +163,141 @@ jobs:
exit 1
;;
esac
xbuild-x86_64:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: macos-26
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Print system information
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
sysctl -a | grep machdep.cpu
else
echo "::error::$RUNNER_OS not supported"
exit 1
fi
- name: Install Dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -y gfortran cmake ccache libtinfo5
elif [ "$RUNNER_OS" == "macOS" ]; then
# It looks like "gfortran" isn't working correctly unless "gcc" is re-installed.
brew reinstall gcc
brew install coreutils ccache
brew install llvm
else
echo "::error::$RUNNER_OS not supported"
exit 1
fi
- name: Crossbuild OpenBLAS to x86_64
run: |
#export PATH=/opt/homebrew/opt/llvm/bin:$PATH
#export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
#export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
export ARCHS="i386 x86_64"
export ARCHS_STANDARD="i386 x86_64"
export ARCHS_STANDARD_32_64_BIT="i386 x86_64"
export ARCHS_STANDARD_64_BIT=x86_64
export ARCHS_STANDARD_INCLUDING_64_BIT="i386 x86_64"
export ARCHS_UNIVERSAL_IPHONE_OS="i386 x86_64"
export VALID_ARCHS="i386 x86_64"
xcrun --sdk macosx --show-sdk-path
xcodebuild -version
export CC=/Applications/Xcode_26.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
export CFLAGS="-O2 -unwindlib=none -Wno-macro-redefined -isysroot /Applications/Xcode_26.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk -arch x86_64"
make TARGET=CORE2 DYNAMIC_ARCH=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1 RANLIB="ls -l"
xbuild-ios:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: macos-26
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Print system information
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
sysctl -a | grep machdep.cpu
else
echo "::error::$RUNNER_OS not supported"
exit 1
fi
- name: Install Dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -y gfortran cmake ccache libtinfo5
elif [ "$RUNNER_OS" == "macOS" ]; then
# It looks like "gfortran" isn't working correctly unless "gcc" is re-installed.
brew reinstall gcc
brew install coreutils ccache
brew install llvm
else
echo "::error::$RUNNER_OS not supported"
exit 1
fi
- name: Crossbuild to iOS
run: |
CC="$(xcrun --sdk iphoneos --find clang)"
SDKROOT="$(xcrun --sdk iphoneos --show-sdk-path)"
echo "CC=${CC}"
echo "SDKROOT=${SDKROOT}"
make TARGET=ARMV8 DYNAMIC_ARCH=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1 \
CC="${CC}" CFLAGS="-O2 -Wno-macro-redefined -isysroot ${SDKROOT} -arch arm64 -miphoneos-version-min=10.0"
xbuild-ios32:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: macos-26
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Print system information
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
sysctl -a | grep machdep.cpu
else
echo "::error::$RUNNER_OS not supported"
exit 1
fi
- name: Install Dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -y gfortran cmake ccache libtinfo5
elif [ "$RUNNER_OS" == "macOS" ]; then
# It looks like "gfortran" isn't working correctly unless "gcc" is re-installed.
brew reinstall gcc
brew install coreutils ccache
brew install llvm
brew install --cask android-ndk
else
echo "::error::$RUNNER_OS not supported"
exit 1
fi
- name: AppleM1/LLVM armv7-androidndk xbuild
run: |
export ANDROID_NDK_HOME="/opt/homebrew/share/android-ndk"
export CC=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi23-clang
export AR=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar
export RANLIB=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib
make TARGET=ARMV7 ARM_SOFTFP_ABI=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1
+8 -2
View File
@@ -5,10 +5,16 @@ on:
branches:
- develop
- release-**
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
branches:
- develop
- release-**
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -30,7 +36,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Print system information
run: |
@@ -52,7 +58,7 @@ jobs:
fi
- name: Compilation cache
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ~/.ccache
# We include the commit sha in the cache key, as new cache entries are
+12 -4
View File
@@ -1,6 +1,14 @@
name: c910v qemu test
on: [push, pull_request]
on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -31,7 +39,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: install build deps
run: |
@@ -40,7 +48,7 @@ jobs:
gcc-${{ matrix.apt_triple }} gfortran-${{ matrix.apt_triple }} libgomp1-riscv64-cross libglib2.0-dev
- name: checkout qemu
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: XUANTIE-RV/qemu
path: qemu
@@ -58,7 +66,7 @@ jobs:
make install
- name: Compilation cache
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
+14 -5
View File
@@ -1,6 +1,14 @@
name: Run codspeed benchmarks
on: [push, pull_request]
on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -21,8 +29,8 @@ jobs:
pyver: ["3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.pyver }}
@@ -43,7 +51,7 @@ jobs:
fi
- name: Compilation cache
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ~/.ccache
# We include the commit sha in the cache key, as new cache entries are
@@ -147,8 +155,9 @@ jobs:
OPENBLAS_NUM_THREADS=1 pytest benchmarks/bench_blas.py -k 'gesdd'
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
uses: CodSpeedHQ/action@v4
with:
mode: simulation
token: ${{ secrets.CODSPEED_TOKEN }}
run: |
cd benchmark/pybench
+10 -2
View File
@@ -4,9 +4,17 @@ on:
push:
branches:
- develop
paths:
- 'docs/**'
- 'mkdocs.yml'
- '.github/workflows/docs.yml'
pull_request:
branches:
- develop
paths:
- 'docs/**'
- 'mkdocs.yml'
- '.github/workflows/docs.yml'
jobs:
build:
@@ -14,11 +22,11 @@ jobs:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: "3.10"
+349 -18
View File
@@ -1,6 +1,15 @@
name: continuous build
on: [push, pull_request, workflow_dispatch]
on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -33,7 +42,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Print system information
run: |
@@ -61,8 +70,8 @@ jobs:
sudo ./llvm.sh 21
fi
if [ "${{ matrix.fortran }}" == "flang" ]; then
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.2_amd64.deb
sudo apt install ./libtinfo5_6.3-2ubuntu0.2_amd64.deb
else
sudo apt-get install -y ${{ matrix.fortran }}
fi
@@ -76,7 +85,7 @@ jobs:
fi
- name: Compilation cache
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ~/.ccache
# We include the commit sha in the cache key, as new cache entries are
@@ -196,29 +205,29 @@ jobs:
- msystem: UCRT64
idx: int32
target-prefix: mingw-w64-ucrt-x86_64
fc-pkg: fc
fc-pkg: mingw-w64-ucrt-x86_64-fc
- msystem: MINGW32
idx: int32
target-prefix: mingw-w64-i686
fc-pkg: fc
fc-pkg:
- msystem: CLANG64
idx: int32
target-prefix: mingw-w64-clang-x86_64
fc-pkg: fc
fc-pkg: mingw-w64-clang-x86_64-fc
- msystem: UCRT64
idx: int64
idx64-flags: -DBINARY=64 -DINTERFACE64=1
target-prefix: mingw-w64-ucrt-x86_64
fc-pkg: fc
fc-pkg: mingw-w64-ucrt-x86_64-fc
- msystem: CLANG64
idx: int64
idx64-flags: -DBINARY=64 -DINTERFACE64=1
target-prefix: mingw-w64-clang-x86_64
fc-pkg: fc
fc-pkg: mingw-w64-clang-x86_64-fc
- msystem: UCRT64
idx: int32
target-prefix: mingw-w64-ucrt-x86_64
fc-pkg: fc
fc-pkg: mingw-w64-ucrt-x86_64-fc
build-type: None
exclude:
- msystem: MINGW32
@@ -247,13 +256,13 @@ jobs:
install: >-
base-devel
${{ matrix.target-prefix }}-cc
${{ matrix.target-prefix }}-${{ matrix.fc-pkg }}
${{ matrix.fc-pkg }}
${{ matrix.target-prefix }}-cmake
${{ matrix.target-prefix }}-ninja
${{ matrix.target-prefix }}-ccache
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Prepare ccache
# Get cache location of ccache
@@ -266,7 +275,7 @@ jobs:
echo "key=ccache-msys2-${{ matrix.msystem }}-${{ matrix.idx }}-${{ matrix.build-type }}-${{ github.ref }}-${{ github.sha }}" >> $GITHUB_OUTPUT
- name: Restore ccache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v5
with:
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
key: ${{ steps.ccache-prepare.outputs.key }}
@@ -311,7 +320,7 @@ jobs:
- name: Save ccache
# Save the cache after we are done (successfully) building
uses: actions/cache/save@v3
uses: actions/cache/save@v5
with:
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
key: ${{ steps.ccache-prepare.outputs.key }}
@@ -334,6 +343,277 @@ jobs:
echo "::endgroup::"
linux_thread_stress:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
name: ${{ matrix.check-name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- backend: pthread
check-name: "linux_thread_stress (pthread)"
- backend: openmp
check-name: "linux_thread_stress (openmp)"
- backend: tsan
check-name: linux_thread_sanitizer
- backend: tsan-openmp
check-name: linux_thread_sanitizer_openmp
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Dependencies
run: |
cat << EOF | sudo tee -a /etc/apt/apt.conf.d/01norecommend
APT::Install-Recommends "0";
APT::Install-Suggests "0";
EOF
sudo apt-get update
sudo apt-get install -y ccache cmake ninja-build
case "${{ matrix.backend }}" in
tsan|tsan-openmp) sudo apt-get install -y clang llvm ;;
esac
if [ "${{ matrix.backend }}" = "tsan-openmp" ]; then
sudo apt-get install -y libomp-dev
fi
- name: Compilation cache
uses: actions/cache@v5
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-thread-${{ matrix.backend }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-thread-${{ matrix.backend }}-${{ github.ref }}
ccache-${{ runner.os }}-thread-${{ matrix.backend }}
- name: Configure ccache
# Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota.
run: |
test -d ~/.ccache || mkdir -p ~/.ccache
echo "max_size = 250M" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
ccache -s
- name: Configure OpenBLAS
run: |
mkdir build && cd build
build_type=Release
c_compiler=gcc
cxx_compiler=g++
dynamic_arch=ON
use_openmp=OFF
cpp_thread_safety_use_openmp=ON
dgemm_args="512;12;4"
dgemm_mixed_args="524288;16;20"
dgemv_args="512;12;4"
sanitizer_flags=
if [ "${{ matrix.backend }}" = "openmp" ]; then
use_openmp=ON
elif [ "${{ matrix.backend }}" = "tsan" ] || [ "${{ matrix.backend }}" = "tsan-openmp" ]; then
build_type=RelWithDebInfo
c_compiler=clang
cxx_compiler=clang++
dynamic_arch=OFF
cpp_thread_safety_use_openmp=OFF
dgemm_args="64;4;1"
dgemm_mixed_args="131072;8;10"
dgemv_args="64;4;1"
sanitizer_flags="-fsanitize=thread -g -O1 -fno-omit-frame-pointer"
if [ "${{ matrix.backend }}" = "tsan-openmp" ]; then
use_openmp=ON
cpp_thread_safety_use_openmp=ON
fi
fi
cmake_args=(
-G Ninja
"-DCMAKE_BUILD_TYPE=$build_type"
"-DCMAKE_C_COMPILER=$c_compiler"
"-DCMAKE_CXX_COMPILER=$cxx_compiler"
-DBUILD_SHARED_LIBS=ON
-DBUILD_STATIC_LIBS=OFF
-DBUILD_WITHOUT_LAPACK=ON
-DBUILD_SINGLE=OFF
-DBUILD_DOUBLE=ON
-DBUILD_COMPLEX=OFF
-DBUILD_COMPLEX16=OFF
"-DDYNAMIC_ARCH=$dynamic_arch"
-DNOFORTRAN=ON
-DUSE_THREAD=ON
"-DUSE_OPENMP=$use_openmp"
-DNUM_THREADS=32
-DNUM_PARALLEL=2
-DTARGET=CORE2
-DCPP_THREAD_SAFETY_TEST=ON
"-DCPP_THREAD_SAFETY_USE_OPENMP=$cpp_thread_safety_use_openmp"
"-DCPP_THREAD_SAFETY_DGEMM_ARGS=$dgemm_args"
"-DCPP_THREAD_SAFETY_DGEMM_MIXED_ARGS=$dgemm_mixed_args"
"-DCPP_THREAD_SAFETY_DGEMV_ARGS=$dgemv_args"
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
)
if [ "${{ matrix.backend }}" = "tsan" ] || [ "${{ matrix.backend }}" = "tsan-openmp" ]; then
cmake_args+=(
"-DCMAKE_C_FLAGS=$sanitizer_flags"
"-DCMAKE_CXX_FLAGS=$sanitizer_flags"
-DCMAKE_SHARED_LINKER_FLAGS=-fsanitize=thread
-DCMAKE_EXE_LINKER_FLAGS=-fsanitize=thread
)
fi
cmake "${cmake_args[@]}" ..
- name: Build OpenBLAS
run: |
cd build
cmake --build . --target dgemm_thread_safety dgemm_thread_safety_mixed dgemv_thread_safety
- name: Show ccache status
continue-on-error: true
run: ccache -s
- name: Run thread stress tests
timeout-minutes: 30
run: |
cd build
if [ "${{ matrix.backend }}" = "tsan" ] || [ "${{ matrix.backend }}" = "tsan-openmp" ]; then
export LLVM_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
export TSAN_OPTIONS=halt_on_error=1:exitcode=66:second_deadlock_stack=1
fi
if [ "${{ matrix.backend }}" = "tsan-openmp" ]; then
# Load Archer (the OMPT tool from Ubuntu's libomp-dev) so TSan
# understands libomp's barriers instead of flagging them as false positives. The OpenMP runtime will load this tool automatically if OMP_TOOL_LIBRARIES is set.
archer=$(clang -print-file-name=libarcher.so)
[ -f "$archer" ] || archer=$(find /usr/lib/llvm-* -name libarcher.so 2>/dev/null | head -1)
if [ ! -f "$archer" ]; then
echo "::error::libarcher.so not found (expected from libomp-dev)"
exit 1
fi
echo "Using distro Archer: $archer"
export OMP_TOOL_LIBRARIES="$archer"
export TSAN_OPTIONS="$TSAN_OPTIONS:ignore_noninstrumented_modules=1"
fi
if [ "${{ matrix.backend }}" != "tsan" ]; then
export OMP_NUM_THREADS=16
fi
export OPENBLAS_NUM_THREADS=8
ctest -R 'dgemm_thread_safety|dgemm_thread_safety_mixed|dgemv_thread_safety' --output-on-failure
msys2_thread_stress:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
env:
CHERE_INVOKING: 1
steps:
- name: Get CPU name
shell: pwsh
run : |
Get-CIMInstance -Class Win32_Processor | Select-Object -Property Name
- name: Install build dependencies
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
release: false # Use pre-installed version
install: >-
base-devel
mingw-w64-ucrt-x86_64-cc
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-ninja
mingw-w64-ucrt-x86_64-ccache
- name: Checkout repository
uses: actions/checkout@v6
- name: Prepare ccache
# Get cache location of ccache
# Create key that is used in action/cache/restore and action/cache/save steps
id: ccache-prepare
run: |
echo "ccachedir=$(cygpath -m $(ccache -k cache_dir))" >> $GITHUB_OUTPUT
# We include the commit sha in the cache key, as new cache entries are
# only created if there is no existing entry for the key yet.
echo "key=ccache-msys2-thread-stress-${{ github.ref }}-${{ github.sha }}" >> $GITHUB_OUTPUT
- name: Restore ccache
uses: actions/cache/restore@v5
with:
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
key: ${{ steps.ccache-prepare.outputs.key }}
# Restore a matching ccache cache entry. Prefer same branch.
restore-keys: |
ccache-msys2-thread-stress-${{ github.ref }}
ccache-msys2-thread-stress
- name: Configure ccache
# Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota.
run: |
which ccache
test -d ${{ steps.ccache-prepare.outputs.ccachedir }} || mkdir -p ${{ steps.ccache-prepare.outputs.ccachedir }}
echo "max_size = 250M" > ${{ steps.ccache-prepare.outputs.ccachedir }}/ccache.conf
echo "compression = true" >> ${{ steps.ccache-prepare.outputs.ccachedir }}/ccache.conf
ccache -p
ccache -s
- name: Configure OpenBLAS
run: |
mkdir build && cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
-DBUILD_WITHOUT_LAPACK=ON \
-DBUILD_SINGLE=OFF \
-DBUILD_DOUBLE=ON \
-DBUILD_COMPLEX=OFF \
-DBUILD_COMPLEX16=OFF \
-DDYNAMIC_ARCH=OFF \
-DNOFORTRAN=ON \
-DUSE_THREAD=ON \
-DUSE_OPENMP=OFF \
-DNUM_THREADS=32 \
-DTARGET=CORE2 \
-DCPP_THREAD_SAFETY_TEST=ON \
-DCPP_THREAD_SAFETY_DGEMM_ARGS="384;8;4" \
-DCPP_THREAD_SAFETY_DGEMM_MIXED_ARGS="524288;16;20" \
-DCPP_THREAD_SAFETY_DGEMV_ARGS="384;8;4" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
..
- name: Build OpenBLAS
run: |
cd build
cmake --build . --target dgemm_thread_safety dgemm_thread_safety_mixed dgemv_thread_safety
- name: Show ccache status
continue-on-error: true
run: ccache -s
- name: Save ccache
# Save the cache after we are done (successfully) building
uses: actions/cache/save@v5
with:
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
key: ${{ steps.ccache-prepare.outputs.key }}
- name: Run thread stress tests
timeout-minutes: 30
run: |
cd build
export PATH="$PWD/lib:$PATH"
OPENBLAS_NUM_THREADS=8 OMP_NUM_THREADS=16 ctest -R 'dgemm_thread_safety|dgemm_thread_safety_mixed|dgemv_thread_safety' --output-on-failure
cross_build:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: ubuntu-22.04
@@ -357,7 +637,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Install Dependencies
run: |
@@ -365,7 +645,7 @@ jobs:
sudo apt-get install -y ccache gcc-${{ matrix.triple }} gfortran-${{ matrix.triple }} libgomp1-${{ matrix.target }}-cross
- name: Compilation cache
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
@@ -392,7 +672,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Install Dependencies
run: |
@@ -404,4 +684,55 @@ jobs:
make -j${nproc}
make -j${nproc} lapack-test
neoverse_n1_build:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc gfortran make
- name: Build OpenBLAS
run: |
make -j${nproc} TARGET=NEOVERSEN1
make -j${nproc} TARGET=NEOVERSEN1 lapack-test
neoverse_n1_omp_build:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc gfortran make
- name: Build OpenBLAS
run: |
make -j${nproc} TARGET=NEOVERSEN1 USE_OPENMP=1
neoverse_n1_ilp64_build:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc gfortran make
- name: Build OpenBLAS
run: |
make -j${nproc} TARGET=NEOVERSEN1 INTERFACE64=1
make -j${nproc} TARGET=NEOVERSEN1 INTERFACE64=1 lapack-test
+63
View File
@@ -0,0 +1,63 @@
name: freebsd
on:
push:
branches:
- develop
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
branches:
- develop
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
bsd-x86:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
- name: build
id: freebsd_x86_64
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
run: |
freebsd-version
sysctl hw.ncpu
pkg install -y gmake gcc15
gmake CC=gcc15 FC=gfortran15
bsd-aarch64:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
- name: build
id: freebsd_arm64
uses: vmactions/freebsd-vm@v1
with:
arch: aarch64
usesh: true
run: |
freebsd-version
sysctl hw.ncpu
pkg install -y gmake gcc15
gmake CC=gcc15 FC=gfortran15
+10 -2
View File
@@ -1,6 +1,14 @@
name: harmonyos
on: [push, pull_request]
on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -20,7 +28,7 @@ jobs:
-DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_BUILD_TYPE=Release \
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: ndk-install
run: |
wget https://repo.huaweicloud.com/harmonyos/os/4.1.1-Release/ohos-sdk-windows_linux-public.tar.gz
+11 -3
View File
@@ -1,6 +1,14 @@
name: loongarch64 qemu test
on: [push, pull_request]
on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -38,7 +46,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Install APT deps
run: |
@@ -47,7 +55,7 @@ jobs:
gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu gfortran-14-loongarch64-linux-gnu
- name: Compilation cache
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
+12 -4
View File
@@ -1,6 +1,14 @@
name: loongarch64 clang qemu test
on: [push, pull_request]
on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -31,7 +39,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Install libffi6
run: |
@@ -51,7 +59,7 @@ jobs:
tar -xf loongson-gnu-toolchain-8.3-x86_64-loongarch64-linux-gnu-rc1.3.tar.xz -C /opt
- name: Checkout qemu
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
repository: qemu/qemu
path: qemu
@@ -69,7 +77,7 @@ jobs:
echo "PATH=$GITHUB_WORKSPACE:/opt/clang+llvm_8.0.1-6_amd64-linux-gnu_debian-10/bin:/opt/loongson-gnu-toolchain-8.3-x86_64-loongarch64-linux-gnu-rc1.3/bin:$PATH" >> $GITHUB_ENV
- name: Compilation cache
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
+12 -4
View File
@@ -1,6 +1,14 @@
name: mips64 qemu test
on: [push, pull_request]
on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -35,7 +43,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: install build deps
run: |
@@ -44,7 +52,7 @@ jobs:
gcc-${{ matrix.triple }} gfortran-${{ matrix.triple }} libgomp1-mips64el-cross libglib2.0-dev
- name: checkout qemu
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
repository: qemu/qemu
path: qemu
@@ -58,7 +66,7 @@ jobs:
make install
- name: Compilation cache
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
+2 -2
View File
@@ -48,7 +48,7 @@ jobs:
sleep ${delay}
if: github.event_name == 'schedule'
- uses: actions/checkout@v2
- uses: actions/checkout@v6
# This isn't even needed, technically. Homebrew will get `develop` via git
- name: Update Homebrew
@@ -69,7 +69,7 @@ jobs:
mv *.bottle.tar.gz bottles
- name: Upload bottle
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: openblas--HEAD.catalina.bottle.tar.gz
path: bottles
+11 -3
View File
@@ -1,6 +1,14 @@
name: riscv64 zvl256b qemu test
on: [push, pull_request]
on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -34,7 +42,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: install build deps
run: |
@@ -48,7 +56,7 @@ jobs:
chmod +x /opt/riscv/bin/qemu-riscv64
- name: Compilation cache
uses: actions/cache@v3
uses: actions/cache@v5
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
+7 -1
View File
@@ -4,9 +4,15 @@ on:
push:
branches:
- develop
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
branches:
- develop
paths-ignore:
- 'docs/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -21,7 +27,7 @@ jobs:
runs-on: windows-11-arm
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Install LLVM for Win-ARM64
shell: pwsh
+1
View File
@@ -4,6 +4,7 @@
*.dylib
*.def
*.o
*.exe
*.out
*.tmp
lapack-3.1.1
+75 -19
View File
@@ -9,7 +9,7 @@ project(OpenBLAS C ASM)
set(OpenBLAS_MAJOR_VERSION 0)
set(OpenBLAS_MINOR_VERSION 3)
set(OpenBLAS_PATCH_VERSION 32.dev)
set(OpenBLAS_PATCH_VERSION 33.dev)
set(OpenBLAS_VERSION "${OpenBLAS_MAJOR_VERSION}.${OpenBLAS_MINOR_VERSION}.${OpenBLAS_PATCH_VERSION}")
@@ -58,9 +58,10 @@ else()
set(NO_AFFINITY 1)
endif()
option(CPP_THREAD_SAFETY_TEST "Run a massively parallel DGEMM test to confirm thread safety of the library (requires OpenMP and about 1.3GB of RAM)" OFF)
option(CPP_THREAD_SAFETY_TEST "Run massively parallel DGEMM tests to confirm thread safety of the library (requires about 1.3GB of RAM)" OFF)
option(CPP_THREAD_SAFETY_USE_OPENMP "Use OpenMP to launch the C++ thread safety tests" ON)
option(CPP_THREAD_SAFETY_GEMV "Run a massively parallel DGEMV test to confirm thread safety of the library (requires OpenMP)" OFF)
option(CPP_THREAD_SAFETY_GEMV "Run a massively parallel DGEMV test to confirm thread safety of the library" OFF)
option(BUILD_STATIC_LIBS "Build static library" OFF)
option(BUILD_SHARED_LIBS "Build shared library" OFF)
if(NOT BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS)
@@ -243,6 +244,38 @@ if (${DYNAMIC_ARCH})
endforeach()
endif ()
# Work around Apple issue with "argument list too long" when linking.
# Seen for DYNAMIC_ARCH when there are a _LOT_ of variants build, previously
# mostly with older versions on POWERPC or Intel CPUs, but with newer ARM
# CPUs and newer compilers this will also occur on ARM.
#
# This must happen before the add_library() calls, otherwise this will have
# no effect.
#
# Unfortunately, while this workaround will work for shared libraries (with
# either Ninja oder Unix Makefiles), but not for static libraries, as ar
# does not accept response files. So for the case where we (also) build
# static libraries we need an additional workaround, see below. (The
# generation of the response files by CMake must still be enabled, so this
# is required regardless.)
if(APPLE)
set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS ON)
set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES ON)
if(NOT NOFORTRAN)
set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS ON)
set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_LIBRARIES ON)
# NAG Fortran does not support the GCC-specific -x f95-cpp-input flag
# used in the shared library link rule below. Override
# CMAKE_Fortran_CREATE_SHARED_LIBRARY early (before targets are defined)
# to use the C compiler link rule instead; the shared library contains
# only C and assembler objects so this is safe.
if(CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
set(CMAKE_Fortran_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY})
endif()
endif()
set(CMAKE_NINJA_FORCE_RESPONSE_FILE ON)
endif()
# add objects to the openblas lib
if(NOT NO_LAPACK)
add_library(LAPACK_OVERRIDES OBJECT ${LA_SOURCES})
@@ -308,20 +341,22 @@ if (USE_OPENMP)
endif()
endif()
# Fix "Argument list too long" for macOS - mostly seen with older OS versions on POWERPC or Intel CPUs
if(APPLE)
# Use response files
set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
# Second part of "Argument list too long" fix when static libraries are
# built. See above for details.
if(APPLE AND BUILD_STATIC_LIBS)
# Always build static library first
if(BUILD_STATIC_LIBS)
set(STATIC_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${OpenBLAS_LIBNAME}.a")
set(STATIC_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${OpenBLAS_LIBNAME}.a")
# Handle differences in how many response files are generated and/or where
# they are stored for Ninja / Unix Makefiles.
if("${CMAKE_GENERATOR}" MATCHES "Ninja")
set(CREATE_STATIC_LIBRARY_COMMAND
"sh -c 'cat ${CMAKE_BINARY_DIR}/CMakeFiles/openblas_static.rsp | xargs -n 1024 ${CMAKE_AR} -ru ${STATIC_PATH} && exit 0' "
"sh -c '${CMAKE_AR} -rs ${STATIC_PATH} ${CMAKE_BINARY_DIR}/driver/others/CMakeFiles/driver_others.dir/xerbla.c.o && exit 0' ")
else()
add_library(${OpenBLAS_LIBNAME}_static STATIC ${TARGET_OBJS} ${OpenBLAS_DEF_FILE})
set(STATIC_PATH "lib${OpenBLAS_LIBNAME}.a")
set(CREATE_STATIC_LIBRARY_COMMAND
"sh -c 'cat ${CMAKE_BINARY_DIR}/CMakeFiles/${OpenBLAS_LIBNAME}_static.dir/objects*.rsp | xargs -n 1024 ${CMAKE_AR} -ru ${STATIC_PATH} && exit 0' "
"sh -c '${CMAKE_AR} -rs ${STATIC_PATH} ${CMAKE_BINARY_DIR}/driver/others/CMakeFiles/driver_others.dir/xerbla.c.o && exit 0' ")
endif()
set(CREATE_STATIC_LIBRARY_COMMAND
"sh -c 'cat ${CMAKE_BINARY_DIR}/CMakeFiles/${OpenBLAS_LIBNAME}_static.dir/objects*.rsp | xargs -n 1024 ${CMAKE_AR} -ru ${STATIC_PATH} && exit 0' "
"sh -c '${CMAKE_AR} -rs ${STATIC_PATH} ${CMAKE_BINARY_DIR}/driver/others/CMakeFiles/driver_others.dir/xerbla.c.o && exit 0' ")
if(BUILD_SHARED_LIBS)
add_dependencies(${OpenBLAS_LIBNAME}_shared ${OpenBLAS_LIBNAME}_static)
set(SHARED_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libopenblas.${OpenBLAS_MAJOR_VERSION}.${OpenBLAS_MINOR_VERSION}.dylib")
@@ -332,12 +367,34 @@ if(APPLE)
set(OMP_LIB "")
endif()
if(NOT NOFORTRAN)
set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 1)
set(CMAKE_Fortran_CREATE_STATIC_LIBRARY ${CREATE_STATIC_LIBRARY_COMMAND})
if(BUILD_SHARED_LIBS)
set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
"sh -c 'echo \"\" | ${CMAKE_Fortran_COMPILER} -o dummy.o -c -x f95-cpp-input - '"
"sh -c '${CMAKE_Fortran_COMPILER} -fpic -shared -Wl,-all_load -Wl,-force_load,${STATIC_PATH} dummy.o -o ${SHARED_PATH} ${OMP_LIB}'")
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
"sh -c 'echo \"\" | ${CMAKE_Fortran_COMPILER} -o dummy.o -c -x f95-cpp-input - '"
"sh -c '${CMAKE_Fortran_COMPILER} -fpic -shared -Wl,-all_load -Wl,-force_load,${STATIC_PATH} dummy.o -o ${SHARED_PATH} ${OMP_LIB}'")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
# NAG does not support -x f95-cpp-input, and macOS needs -dynamiclib
# rather than -Wl,-shared. Use the C compiler as the linker driver
# and add the NAG Fortran runtime so NAGf90_* symbols resolve.
# Locate the NAG Fortran runtime (libf<XY>rts) without hardcoding the
# version digits: NAG 7.1 ships libf71rts, 7.2 ships libf72rts, etc.
get_filename_component(_NAG_FC_DIR "${CMAKE_Fortran_COMPILER}" DIRECTORY)
set(_NAG_RTS_DIR "${_NAG_FC_DIR}/../lib/NAG_Fortran")
file(GLOB _NAG_RTS_CANDIDATES
"${_NAG_RTS_DIR}/libf*rts.dylib"
"${_NAG_RTS_DIR}/libf*rts.a")
if(_NAG_RTS_CANDIDATES)
list(GET _NAG_RTS_CANDIDATES 0 _NAG_RTS_LIB)
get_filename_component(_NAG_RTS_NAME "${_NAG_RTS_LIB}" NAME_WE)
string(REGEX REPLACE "^lib" "" _NAG_RTS_LIBNAME "${_NAG_RTS_NAME}")
set(_NAG_RTS_FLAGS "-L${_NAG_RTS_DIR} -l${_NAG_RTS_LIBNAME}")
else()
set(_NAG_RTS_FLAGS "")
endif()
set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
"sh -c '${CMAKE_C_COMPILER} -dynamiclib -Wl,-all_load -Wl,-force_load,${STATIC_PATH} -o ${SHARED_PATH} ${OMP_LIB} ${_NAG_RTS_FLAGS}'")
endif()
endif()
else()
set(CMAKE_C_CREATE_STATIC_LIBRARY ${CREATE_STATIC_LIBRARY_COMMAND})
@@ -764,4 +821,3 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PN}ConfigVersion.cmake
install(EXPORT "${PN}${SUFFIX64}Targets"
NAMESPACE "${PN}${SUFFIX64}::"
DESTINATION ${CMAKECONFIG_INSTALL_DIR})
+4
View File
@@ -275,3 +275,7 @@ In chronological order:
* Fadi Arafeh <fadi.arafeh@arm.com>
* [2026-03-05] Accelerate SVE128 SBGEMM/BGEMM
* Nathan Sircombe <nathan.sircombe@arm.com>
* [2026-04-16] Add CPU ID for Neoverse V3
hheei <hheei@users.noreply.github.com>
+50
View File
@@ -1,4 +1,54 @@
OpenBLAS ChangeLog
====================================================================
Version 0.3.33
23-Apr-2026
general:
- fixed an incorrect cast in the SBGEMM test case that could lead to spurious test failures
- fixed an invalid memory access in the converted C version of the CBLAS tests
- made the BIGNUMA setting automatic when the number of cores exceeds 256
- Imported recent updates from Reference-LAPACK to realign with its upcoming 3.13.0 release:
- Implement ?LARF1F and ?ORM2R (Reference-LAPACK PRs 1019,1020,1196,1257)
- Change loop order in ?GETC2 to improve performance (Reference-LAPACK PR 1023)
- Change WORK array dimension in ?GELQS/?GEQRS (Reference-LAPACK PR 1094)
- Add NaN checks for input matrix A in ?GEEV (Reference-LAPACK PR 1136)
- Fix support for jobu/v in LAPACKE_?GESVDQ_WORK (Reference-LAPACK PRs 1146,1221)
- Fix display of version number in LAPACK testsuite (Reference-LAPACK PR 1149)
- Fix DGGES test seed to avoid bad matrix cases (Reference-LAPACK PR 1187)
- Fix truncation of large WORK array sizes in ZHE (Reference-LAPACK PR 1195)
- Fix overwriting of LDSWORK parameter in ?TRSYL3 (Reference-LAPACK PR 1206)
- Fix overwriting of error states in some EIG tests (Reference-LAPACK PR 1207)
- Remove unused parameter in DORBDB3/ZUNBDB3 (Reference-LAPACK PR 1209)
- Re-enable testing of ?BB and ?GG driver functions (Reference-LAPACK PR 1211)
- Fix workspace size calculation in ?TGSEN (Reference-LAPACK PR 774)
- Fix typos in the EIG DMD tests and initialized the cutoff variable (PR 1212,1228)
- Optimized looping in ?LACPY/?LASCL/?LANTR with fat matrix and UPLO=L (PR 1251)
arm64:
- worked around a serious miscompilation of the DDOT kernel by GCC15, affecting
most non-SVE targets, and SVE targets in the case of non-unit array stride)
- fixed an accuracy issue in the GEMV kernel for Neoverse V1 and other SVE targets
- fixed broken STRMM and SSYMM in DYNAMIC_ARCH builds when running on non-SME hardware
- added an optimized SHGEMM kernel for Neoverse N2
- fixed DYNAMIC_ARCH builds under Windows on Arm
- Added autodetection of Cortex A75/A76 in DYNAMIC_ARCH builds
- Added autodetection of Neoverse V3, currently supported through V2 kernels
- Re-added support for the "VORTEX" target in DYNAMIC_ARCH builds with DYNAMIC_LIST
- Fixed CMake-based builds that use the "Ninja" generator
loongarch64:
- fixed a build failure due to missing support for the new half-precision float type
- fixed a long-standing bug in asserting 64bit capability in the c_check helper script
x86_64:
- added a workaround for miscompilation of the AVX512 GEMM kernels by LLVM on Windows
- fixed a build failure in the LAED3 code when compiling with MinGW on Windows
- fixed CMake-based compilation with the NVIDIA HPC compiler
- Fixed CMake-based builds that use the "Ninja" generator
wasm:
- added optimized kernels for STRSM and DTRSM
====================================================================
Version 0.3.32
23-Mar-2026
+2 -1
View File
@@ -1,6 +1,7 @@
TOPDIR = .
include ./Makefile.system
LNCMD = ln -fs
OSNAME_DISPLAY ?= $(OSNAME)
ifeq ($(FIXED_LIBNAME), 1)
LNCMD = true
endif
@@ -58,7 +59,7 @@ all :: tests
@echo
@echo " OpenBLAS build complete. ($(LIB_COMPONENTS))"
@echo
@echo " OS ... $(OSNAME) "
@echo " OS ... $(OSNAME_DISPLAY) "
@echo " Architecture ... $(ARCH) "
ifndef BINARY64
@echo " BINARY ... 32bit "
+4 -6
View File
@@ -34,7 +34,7 @@ endif
ifeq ($(C_COMPILER), FUJITSU)
ISCLANG=1
endif
ifneq (1, $(filter 1,$(GCCVERSIONGT4) $(ISCLANG)))
ifeq "$(or $(GCCVERSIONGT4),$(ISCLANG))" ""
CCOMMON_OPT += -march=armv8-a
ifneq ($(F_COMPILER), NAG)
FCOMMON_OPT += -march=armv8-a
@@ -310,12 +310,10 @@ endif
ifeq ($(CORE), VORTEXM4)
ifneq ($(C_COMPILER), GCC)
ifeq ($(APPLECLANG),1)
CCOMMON_OPT += -march=armv8.4-a+sme
else
CCOMMON_OPT += -march=armv8.4-a+sme
override LDFLAGS += -lclang_rt_builtins-aarch64
endif
#ifneq ($(APPLECLANG),1)
#override LDFLAGS += -lclang_rt_builtins-aarch64
#endif
else
CCOMMON_OPT += -march=armv8.4-a
endif
+35 -37
View File
@@ -32,7 +32,7 @@ PKG_EXTRALIB := $(EXTRALIB)
ifeq ($(INTERFACE64),1)
SUFFIX64=64
endif
PKGFILE="$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE)$(SUFFIX64).pc"
PKGFILE := $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE)$(SUFFIX64).pc
ifeq ($(USE_OPENMP), 1)
ifeq ($(C_COMPILER), PGI)
@@ -191,8 +191,6 @@ endif
ifeq ($(INTERFACE64),1)
SUFFIX64=64
endif
PKGFILE="$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/$(LIBSONAMEBASE)$(SUFFIX64).pc"
@echo Generating $(LIBSONAMEBASE)$(SUFFIX64).pc in "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)"
@echo 'libdir='$(OPENBLAS_LIBRARY_DIR) > "$(PKGFILE)"
@echo 'libprefix='$(LIBNAMEPREFIX) >> "$(PKGFILE)"
@@ -271,46 +269,46 @@ endif
install_tests : lib.grd
ifneq ($(ONLY_CBLAS), 1)
@install -m 666 utest/openblas_utest $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 utest/openblas_utest_ext $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 utest/openblas_utest$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 utest/openblas_utest_ext$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN)))
ifndef NO_FBLAS
ifeq ($(BUILD_BFLOAT16),1)
@install -m 666 test/test_sbgemm $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/test_sbgemm$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
endif
ifeq ($(BUILD_SINGLE),1)
@install -m 666 test/sblat1 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/sblat2 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/sblat3 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/sblat1$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/sblat2$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/sblat3$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/sblat2.dat $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/sblat3.dat $(DESTDIR)$(OPENBLAS_BINARY_DIR)
endif
ifeq ($(BUILD_DOUBLE),1)
@install -m 666 test/dblat1 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/dblat2 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/dblat3 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/dblat1$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/dblat2$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/dblat3$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/dblat2.dat $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/dblat3.dat $(DESTDIR)$(OPENBLAS_BINARY_DIR)
endif
ifeq ($(BUILD_COMPLEX),1)
@install -m 666 test/cblat1 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/cblat2 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/cblat3 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/cblat1$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/cblat2$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/cblat3$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/cblat2.dat $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/cblat3.dat $(DESTDIR)$(OPENBLAS_BINARY_DIR)
ifeq ($(ARCH), filter($(ARCH), x86 x86_64 ia64 MIPS))
@install -m 666 test/cblat3_3m $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/cblat3_3m$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/cblat3_3m.dat $(DESTDIR)$(OPENBLAS_BINARY_DIR)
endif
endif
ifeq ($(BUILD_COMPLEX16),1)
@install -m 666 test/zblat1 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/zblat2 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/zblat3 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/zblat1$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/zblat2$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/zblat3$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/zblat2.dat $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/zblat3.dat $(DESTDIR)$(OPENBLAS_BINARY_DIR)
ifeq ($(ARCH), filter($(ARCH), x86 x86_64 ia64 MIPS))
@install -m 666 test/zblat3_3m $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/zblat3_3m$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 test/zblat3_3m.dat $(DESTDIR)$(OPENBLAS_BINARY_DIR)
endif
endif
@@ -318,46 +316,46 @@ endif
endif
ifneq ($(ONLY_CBLAS), 1)
ifeq ($(BUILD_SINGLE),1)
@install -m 666 ctest/xscblat1 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xscblat2 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xscblat3 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xscblat1$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xscblat2$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xscblat3$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/sin2 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/sin3 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
endif
ifeq ($(BUILD_DOUBLE),1)
@install -m 666 ctest/xdcblat1 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xdcblat2 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xdcblat3 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xdcblat1$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xdcblat2$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xdcblat3$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/din2 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/din3 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
endif
ifeq ($(BUILD_COMPLEX),1)
@install -m 666 ctest/xccblat1 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xccblat2 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xccblat3 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xccblat1$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xccblat2$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xccblat3$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/cin2 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/cin3 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
ifeq ($(ARCH), filter($(ARCH), x86 x86_64 ia64 MIPS))
@install -m 666 ctest/xccblat3_3m $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xccblat3_3m$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/cin3_3m $(DESTDIR)$(OPENBLAS_BINARY_DIR)
endif
endif
ifeq ($(BUILD_COMPLEX16),1)
@install -m 666 ctest/xzcblat1 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xzcblat2 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xzcblat3 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xzcblat1$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xzcblat2$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xzcblat3$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/zin2 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/zin3 $(DESTDIR)$(OPENBLAS_BINARY_DIR)
ifeq ($(ARCH), filter($(ARCH), x86 x86_64 ia64 MIPS))
@install -m 666 ctest/xzcblat3_3m $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/xzcblat3_3m$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 ctest/zin3_3m $(DESTDIR)$(OPENBLAS_BINARY_DIR)
endif
endif
endif
ifeq ($(CPP_THREAD_SAFETY_TEST), 1)
@install -m 666 cpp_thread_test/dgemm_tester $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 cpp_thread_test/dgemv_tester $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 cpp_thread_test/dgemm_tester$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 cpp_thread_test/dgemm_mixed_tester$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
@install -m 666 cpp_thread_test/dgemv_tester$(EXE) $(DESTDIR)$(OPENBLAS_BINARY_DIR)
endif
endif
+1 -1
View File
@@ -111,7 +111,7 @@ endif
endif
ifeq ($(C_COMPILER), CLANG)
CCOMMON_OPT += -fno-integrated-as
CCOMMON_OPT += -fno-integrated-as -Wa,-mpwr10
endif
# workaround for C->FORTRAN ABI violation in LAPACKE
ifeq ($(F_COMPILER), GFORTRAN)
+4 -4
View File
@@ -3,7 +3,7 @@
#
# This library's version
VERSION = 0.3.32.dev
VERSION = 0.3.33.dev
# If you set this prefix, the library name will be lib$(LIBNAMESUFFIX)openblas.a
# and lib$(LIBNAMESUFFIX)openblas.so, with a matching soname in the shared library
@@ -290,10 +290,10 @@ COMMON_PROF = -pg
# This is mostly intended as a developer feature to spot regressions, but users and
# package maintainers can enable this if they have doubts about the thread safety of
# the library, given the configuration in this file.
# By default, the thread safety tester launches 52 concurrent calculations at the same
# time.
# By default, the thread safety testers launch many concurrent calculations at
# the same time.
#
# Please note that the test uses ~1300 MiB of RAM for the DGEMM test.
# Please note that the tests use ~1300 MiB of RAM for the DGEMM test.
#
# The test requires CBLAS to be built, a C++11 capable compiler and the presence of
# an OpenMP implementation. If you are cross-compiling this test will probably not
+36 -2
View File
@@ -194,7 +194,7 @@ ifeq ($(TARGET_CORE), EXCAVATOR)
GETARCH_FLAGS := -DFORCE_BARCELONA
endif
ifeq ($(TARGET_CORE), ZEN)
GETARCH_FLAGS := -DFORCE_BARCELONA
GETARCH_FLAGS := -DFORCE_NEHALEM
endif
endif
@@ -247,6 +247,11 @@ NO_PARALLEL_MAKE=0
endif
GETARCH_FLAGS += -DNO_PARALLEL_MAKE=$(NO_PARALLEL_MAKE)
ifndef MAKE_NB_JOBS
ifneq (,$(patsubst -j%,%,$(filter -j%,$(MAKEFLAGS))))
MAKE_NB_JOBS=-1
endif
endif
ifdef MAKE_NB_JOBS
GETARCH_FLAGS += -DMAKE_NB_JOBS=$(MAKE_NB_JOBS)
endif
@@ -417,6 +422,9 @@ endif
ifeq ($(C_COMPILER), CLANG)
CLANGVERSIONGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9)
CLANGVERSIONGTEQ12 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 12)
ifeq ($(F_COMPILER), GFORTRAN)
GCCVERSIONGT4 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 4)
endif
endif
#
@@ -469,7 +477,7 @@ EXTRALIB += -lm
endif
ifeq ($(OSNAME), $(filter $(OSNAME),FreeBSD OpenBSD NetBSD DragonFly))
ifeq ($(ARCH), $(filter $(ARCH),arm arm64))
ifeq ($(ARCH), $(filter $(ARCH),arm arm64 power))
EXTRALIB += -lm
endif
endif
@@ -733,6 +741,20 @@ DYNAMIC_CORE += THUNDERX2T99
DYNAMIC_CORE += TSV110
DYNAMIC_CORE += EMAG8180
DYNAMIC_CORE += THUNDERX3T110
ifeq ($(OSNAME), Darwin)
DYNAMIC_CORE = ARMV8
DYNAMIC_CORE += NEOVERSEN1
ifneq ($(NO_SME), 1)
DYNAMIC_CORE += ARMV9SME
ifeq ($(OSNAME), Darwin)
ifneq ($(C_COMPILER), GCC)
DYNAMIC_CORE += VORTEXM4
endif
endif
endif
endif
ifdef DYNAMIC_LIST
override DYNAMIC_CORE = ARMV8 $(DYNAMIC_LIST)
XCCOMMON_OPT = -DDYNAMIC_LIST -DDYN_ARMV8
@@ -1626,7 +1648,11 @@ ifneq ($(C_COMPILER), SUN)
CCOMMON_OPT += -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME
endif
endif
ifeq ( ,$(findstring pizfix,$(CEXTRALIB)))
CCOMMON_OPT += -DASMNAME=$(FU)$(*F) -DASMFNAME=$(FU)$(*F)$(BU) -DNAME=$(*F)$(BU) -DCNAME=$(*F) -DCHAR_NAME=\"$(*F)$(BU)\" -DCHAR_CNAME=\"$(*F)\"
else
CCOMMON_OPT += -DASMNAME=$(FU)pizlonated_$(*F) -DASMFNAME=$(FU)pizlonated_$(*F)$(BU) -DNAME=$(*F)$(BU) -DCNAME=$(*F) -DCHAR_NAME=\"$(*F)$(BU)\" -DCHAR_CNAME=\"$(*F)\"
endif
ifeq ($(CORE), PPC440)
CCOMMON_OPT += -DALLOC_QALLOC
@@ -1796,6 +1822,14 @@ ifndef LIBSUFFIX
LIBSUFFIX = a
endif
ifndef EXE
ifeq ($(OSNAME), $(filter $(OSNAME),WINNT CYGWIN_NT))
EXE = .exe
else
EXE =
endif
endif
ifneq ($(DYNAMIC_ARCH), 1)
ifndef SMP
LIBNAME = $(LIBPREFIX)_$(LIBCORE)$(REVISION).$(LIBSUFFIX)
+11 -12
View File
@@ -2,15 +2,10 @@
[![Join the chat at https://gitter.im/xianyi/OpenBLAS](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/xianyi/OpenBLAS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Cirrus CI: [![Build Status](https://api.cirrus-ci.com/github/xianyi/OpenBLAS.svg?branch=develop)](https://cirrus-ci.com/github/xianyi/OpenBLAS)
GitHub Actions: [![Build Status](https://github.com/OpenMathLib/OpenBLAS/actions/workflows/dynamic_arch.yml/badge.svg?branch=develop)](https://github.com/OpenMathLib/OpenBLAS/actions/workflows/dynamic_arch.yml?query=branch%3Adevelop)
Azure Pipelines: [![Build Status](https://dev.azure.com/xianyi/OpenBLAS/_apis/build/status/xianyi.OpenBLAS?branchName=develop)](https://dev.azure.com/xianyi/OpenBLAS/_build/latest?definitionId=1&branchName=develop)
[![Build Status](https://dev.azure.com/xianyi/OpenBLAS/_apis/build/status/xianyi.OpenBLAS?branchName=develop)](https://dev.azure.com/xianyi/OpenBLAS/_build/latest?definitionId=1&branchName=develop)
OSUOSL POWERCI [![Build Status](https://powerci.osuosl.org/buildStatus/icon?job=OpenBLAS_gh%2Fdevelop)](http://powerci.osuosl.org/job/OpenBLAS_gh/job/develop/)
OSUOSL IBMZ-CI [![Build Status](http://ibmz-ci.osuosl.org/buildStatus/icon?job=OpenBLAS-Z%2Fdevelop)](http://ibmz-ci.osuosl.org/job/OpenBLAS-Z/job/develop/)
## Introduction
OpenBLAS is an optimized BLAS (Basic Linear Algebra Subprograms) library based on GotoBLAS2 1.13 BSD version.
@@ -176,7 +171,7 @@ Please read `GotoBLAS_01Readme.txt` for older CPU models already supported by th
- **Cortex-A53**: same as ARMV8 (different cpu specifications)
- **Cortex-A55**: same as ARMV8 (different cpu specifications)
- **Cortex A57**: Optimized Level-3 and Level-2 functions
- **Cortex A72**: same as A57 ( different cpu specifications)
- **Cortex A72**: same as A57 (different cpu specifications)
- **Cortex A73**: same as A57 (different cpu specifications)
- **Cortex A76**: same as A57 (different cpu specifications)
- **Falkor**: same as A57 (different cpu specifications)
@@ -189,6 +184,8 @@ Please read `GotoBLAS_01Readme.txt` for older CPU models already supported by th
- **Neoverse V1**: (AWS Graviton3) optimized Level-3 BLAS
- **Neoverse N2**: preliminary support
- **Neoverse V2**: preliminary support
- **Neoverse V3**: preliminary support
- **Neoverse V3AE**: preliminary support
- **Apple Vortex**: preliminary support based on ThunderX2/3
- **Apple VortexM4**: preliminary support based on ThunderX2/3, SME kernels for SGEMM,SSYMM,STRMM,SSYRK,SSYR2K
- **A64FX**: preliminary support, optimized Level-3 BLAS
@@ -224,6 +221,8 @@ Please read `GotoBLAS_01Readme.txt` for older CPU models already supported by th
make HOSTCC=gcc TARGET=x280 NUM_THREADS=8 CC=riscv64-unknown-linux-gnu-clang FC=riscv64-unknown-linux-gnu-gfortran
```
(For RVV 1.0 target selection and compiler requirements, see the [RISC-V section in docs/install.md](docs/install.md#risc-v).)
- **ZVL???B**: Level-3 BLAS and Level-1,2 including vectorised kernels targeting generic RISCV cores with vector support with registers of at least the corresponding width; ZVL128B and ZVL256B are available.
e.g.:
```sh
@@ -288,17 +287,17 @@ Please note that it is not possible to combine support for different architectur
### Supported OS
- **GNU/Linux**
- **MinGW or Visual Studio (CMake)/Windows**: Please read <https://github.com/OpenMathLib/OpenBLAS/docs/nstall.md#visual-studio-native-windows-abi>.
- **MinGW or Visual Studio (CMake)/Windows**: Please read <https://github.com/OpenMathLib/OpenBLAS/blob/develop/docs/install.md#visual-studio--native-windows-abi>.
- **Darwin/macOS/OSX/iOS**: Already supported on PPC and x86 by the original GotoBLAS, now also on ARM64 but we are not OSX/iOS experts.
- **FreeBSD**: Supported by the community. We don't actively test the library on this OS.
- **FreeBSD**: Supported by the community. Basic test coverage is provided by GitHub Actions.
- **OpenBSD**: Supported by the community. We don't actively test the library on this OS.
- **NetBSD**: Supported by the community. We don't actively test the library on this OS.
- **DragonFly BSD**: Supported by the community. We don't actively test the library on this OS.
- **Android**: Supported by the community. Please read <https://github.com/OpenMathLib/OpenBLAS/docs/install.md#android>.
- **Android**: Supported by the community. Please read <https://github.com/OpenMathLib/OpenBLAS/blob/develop/docs/install.md#android>.
- **AIX**: Supported on PPC up to POWER10 but testing is increasingly problematic due to lack of publicly available systems
- **Haiku**: Supported by the community. We don't actively test the library on this OS.
- **SunOS**: Supported by the community. We don't actively test the library on this OS.
- **Cortex-M**: Supported by the community. Please read <https://github.com/OpenMathLib/OpenBLAS/docs/install.md#cortex-m>.
- **Cortex-M**: Supported by the community. Please read <https://github.com/OpenMathLib/OpenBLAS/blob/develop/docs/install.md#cortex-m>.
## Usage
+9
View File
@@ -4,6 +4,15 @@ trigger:
branches:
include:
- develop
paths:
exclude:
- 'docs/**'
- '**/*.md'
pr:
paths:
exclude:
- 'docs/**'
- '**/*.md'
resources:
containers:
- container: oneapi-hpckit
+1 -3
View File
@@ -95,7 +95,6 @@ static void *aligned_alloc_cacheline(size_t n)
#if defined(__WIN32__) || defined(__WIN64__) || !defined(_POSIX_TIMERS)
struct timeval start, stop;
#elif defined(__APPLE__)
mach_timebase_info_data_t info;
uint64_t start = 0, stop = 0;
#else
struct timespec start = { 0, 0 }, stop = { 0, 0 };
@@ -106,8 +105,7 @@ double getsec()
#if defined(__WIN32__) || defined(__WIN64__) || !defined(_POSIX_TIMERS)
return (double)(stop.tv_sec - start.tv_sec) + (double)((stop.tv_usec - start.tv_usec)) * 1.e-6;
#elif defined(__APPLE__)
mach_timebase_info(&info);
return (double)(((stop - start) * info.numer)/info.denom) * 1.e-9;
return (double)(stop - start) * 1.e-9;
#else
return (double)(stop.tv_sec - start.tv_sec) + (double)((stop.tv_nsec - start.tv_nsec)) * 1.e-9;
#endif
+1 -1
View File
@@ -236,7 +236,7 @@ def test_gesdd(benchmark, mn, variant):
assert info == 0
atol = {'s': 1e-5, 'd': 1e-13}
atol = {'s': 5e-5, 'd': 1e-13}
np.testing.assert_allclose(u @ np.diag(s) @ vt, a, atol=atol[variant])
+8 -8
View File
@@ -23,7 +23,7 @@ config="$2"
compiler_name="$3"
shift 3
flags="$*"
is_ios=false
darwin_os=""
# First, we need to know the target OS and compiler name
{
@@ -70,7 +70,7 @@ case "$data" in *OS_FREEBSD*) os=FreeBSD ;; esac
case "$data" in *OS_NETBSD*) os=NetBSD ;; esac
case "$data" in *OS_OPENBSD*) os=OpenBSD ;; esac
case "$data" in *OS_DRAGONFLY*) os=DragonFly ;; esac
case "$data" in *OS_DARWIN*) os=Darwin ;; esac
case "$data" in *OS_DARWIN*) os=Darwin; darwin_os=macOS ;; esac
case "$data" in *OS_SUNOS*) os=SunOS ;; esac
case "$data" in *OS_AIX*) os=AIX ;; esac
case "$data" in *OS_OSF*) os=osf ;; esac
@@ -79,7 +79,7 @@ case "$data" in *OS_CYGWIN_NT*) os=CYGWIN_NT ;; esac
case "$data" in *OS_INTERIX*) os=Interix ;; esac
case "$data" in *OS_ANDROID*) os=Android ;; esac
case "$data" in *OS_HAIKU*) os=Haiku ;; esac
case "$data" in *OS_IOS*) is_ios=true ;; esac
case "$data" in *OS_IOS*) darwin_os=iOS ;; esac
case "$data" in
*ARCH_X86_64*) architecture=x86_64 ;;
@@ -342,8 +342,8 @@ no_sme=0
is_appleclang=0
if [ "$architecture" = "arm64" ]; then
if [ "$compiler" = "CLANG" ]; then
data=`$compiler_name --version`
case "$data" in Apple*)
vdata=`$compiler_name --version`
case "$vdata" in Apple*)
is_appleclang=1
esac
fi
@@ -404,7 +404,7 @@ fi
data=`$compiler_name $flags -S ctest1.c && grep globl ctest1.s | head -n 1 && rm -f ctest1.s`
need_fu=''
if echo "$data" | grep 'globl[[:space:]][_\.]'; then
if echo "$data" | grep -q 'globl[[:space:]][_\.]'; then
need_fu="${data##*globl[[:space:]]}"
need_fu="${need_fu%%[!_\.]*}"
fi
@@ -421,7 +421,7 @@ fi
[ "$os" = "Android" ] && [ "$hostos" = "Linux" ] && [ -n "$TERMUX_APP_PID" ] \
&& cross=0
[ "$is_ios" = true ] && cross=1
[ "$darwin_os" = iOS ] && cross=1
[ "$USE_OPENMP" != 1 ] && openmp=''
@@ -489,11 +489,11 @@ done
:> "$makefile" || exit 1
:> "$config" || exit 1
# print $data, "\n";
{
printf "OSNAME=%s\n" "$os"
[ -n "$darwin_os" ] && printf "OSNAME_DISPLAY=%s\n" "$darwin_os"
printf "ARCH=%s\n" "$architecture"
printf "C_COMPILER=%s\n" "$compiler"
[ $binformat != 'bin32' ] && printf "BINARY32=\n"
+10 -1
View File
@@ -56,6 +56,7 @@ if ($@){
}
$compiler = "";
$darwin_os = "";
$compiler = LSB if ($data =~ /COMPILER_LSB/);
$compiler = CLANG if ($data =~ /COMPILER_CLANG/);
$compiler = PGI if ($data =~ /COMPILER_PGI/);
@@ -73,7 +74,13 @@ $os = FreeBSD if ($data =~ /OS_FREEBSD/);
$os = NetBSD if ($data =~ /OS_NETBSD/);
$os = OpenBSD if ($data =~ /OS_OPENBSD/);
$os = DragonFly if ($data =~ /OS_DRAGONFLY/);
$os = Darwin if ($data =~ /OS_DARWIN/);
if ($data =~ /OS_DARWIN/) {
$os = Darwin;
$darwin_os = "macOS";
}
if ($data =~ /OS_IOS/) {
$darwin_os = "iOS";
}
$os = SunOS if ($data =~ /OS_SUNOS/);
$os = AIX if ($data =~ /OS_AIX/);
$os = osf if ($data =~ /OS_OSF/);
@@ -391,6 +398,7 @@ if ($architecture ne $hostarch) {
$cross = 1 if ($os ne $hostos);
$cross = 0 if (($os eq "Android") && ($hostos eq "Linux") && ($ENV{TERMUX_APP_PID} != ""));
$cross = 1 if $darwin_os eq "iOS";
$openmp = "" if $ENV{USE_OPENMP} != 1;
@@ -454,6 +462,7 @@ open(CONFFILE, "> $config" ) || die "Can't create $config";
# print $data, "\n";
print MAKEFILE "OSNAME=$os\n";
print MAKEFILE "OSNAME_DISPLAY=$darwin_os\n" if $darwin_os ne "";
print MAKEFILE "ARCH=$architecture\n";
print MAKEFILE "C_COMPILER=$compiler\n";
print MAKEFILE "BINARY32=\n" if $binformat ne bin32;
+17 -2
View File
@@ -48,12 +48,27 @@ if (DYNAMIC_ARCH)
if (${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 11) # SVE ACLE supported in LLVM >= 11
set(DYNAMIC_CORE ${DYNAMIC_CORE} NEOVERSEV1 NEOVERSEN2 ARMV8SVE A64FX)
endif ()
if (${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 17) # SME ACLE supported in LLVM >= 17
set(DYNAMIC_CORE ${DYNAMIC_CORE} ARMV9SME)
endif()
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
if (${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 19 OR (${CMAKE_C_COMPILER_ID} MATCHES AppleClang AND ${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 17) ) # SME ACLE supported in LLVM >= 19 and AppleClang >= 17
set(DYNAMIC_CORE ${DYNAMIC_CORE} ARMV9SME VORTEXM4)
if (${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 19 OR (${CMAKE_C_COMPILER_ID} MATCHES AppleClang AND ${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 17) ) # SME w/out SVE supported in LLVM >= 19 and AppleClang >= 17
set(DYNAMIC_CORE ${DYNAMIC_CORE} VORTEXM4)
endif()
endif()
endif ()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR ${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
set(DYNAMIC_CORE ARMV8 NEOVERSEN1)
if (${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 19 OR (${CMAKE_C_COMPILER_ID} MATCHES AppleClang AND ${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 17) ) # SME ACLE supported in LLVM >= 19 and AppleClang >= 17
set(DYNAMIC_CORE ${DYNAMIC_CORE} VORTEXM4)
endif()
if (${CMAKE_C_COMPILER_VERSION} VERSION_GREATER_EQUAL 14) # SME ACLE supported in GCC >= 14
set(DYNAMIC_CORE ${DYNAMIC_CORE} ARMV9SME)
endif()
endif()
if (DYNAMIC_LIST)
set(DYNAMIC_CORE ARMV8 ${DYNAMIC_LIST})
endif ()
+6 -5
View File
@@ -113,6 +113,7 @@ if (${CMAKE_C_COMPILER_ID} STREQUAL "PGI")
endif ()
if (${CMAKE_C_COMPILER_ID} STREQUAL "NVHPC")
set (GCC_VERSION 100)
if (POWER)
set(CCOMMON_OPT "${CCOMMON_OPT} -tp pwr8")
elseif (X86_64)
@@ -312,13 +313,13 @@ endif ()
if (${CORE} STREQUAL ARMV9SME)
if (NOT DYNAMIC_ARCH)
if (${CMAKE_C_COMPILER_ID} STREQUAL "NVHPC" AND NOT NO_SVE)
set (CCOMMON_OPT "${CCOMMON_OPT} -tp=host")
set (CCOMMON_OPT "${CCOMMON_OPT} -tp=host")
else ()
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv9-a+sme")
if (${OSNAME} STREQUAL Windows AND ${CMAKE_C_COMPILER_ID} MATCHES "Clang" )
set (CCOMMON_OPT "${CCOMMON_OPT} --aarch64-stack-hazard-size=0")
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv9-a+sme")
if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
set (CCOMMON_OPT "${CCOMMON_OPT} --aarch64-stack-hazard-size=0")
endif ()
endif ()
endif ()
endif ()
endif ()
+12 -12
View File
@@ -70,8 +70,8 @@ set(SLASRC
slaqgb.f slaqge.f slaqp2.f slaqps.f slaqp2rk.f slaqp3rk.f slaqsb.f slaqsp.f slaqsy.f
slaqr0.f slaqr1.f slaqr2.f slaqr3.f slaqr4.f slaqr5.f
slaqtr.f slar1v.f slar2v.f ilaslr.f ilaslc.f
slarf.f slarfb.f slarfb_gett.f slarfg.f slarfgp.f slarft.f slarfx.f slarfy.f slargv.f
slarf1f.f slarf1l.f slarrv.f slartv.f
slarf.f slarfb.f slarfb_gett.f slarfg.f slarfgp.f slarft.f slarft_lvl2.f slarfx.f
slarfy.f slargv.f slarf1f.f slarf1l.f slarrv.f slartv.f
slarz.f slarzb.f slarzt.f slasy2.f
slasyf.f slasyf_rook.f slasyf_rk.f slasyf_aa.f
slatbs.f slatdf.f slatps.f slatrd.f slatrs.f slatrz.f
@@ -177,7 +177,7 @@ set(CLASRC
claqr0.f claqr1.f claqr2.f claqr3.f claqr4.f claqr5.f
claqz0.f claqz1.f claqz2.f claqz3.f
claqsp.f claqsy.f clar1v.f clar2v.f ilaclr.f ilaclc.f
clarf.f clarfb.f clarfb_gett.f clarfg.f clarfgp.f clarft.f
clarf.f clarfb.f clarfb_gett.f clarfg.f clarfgp.f clarft.f clarft_lvl2.f
clarf1f.f clarf1l.f
clarfx.f clarfy.f clargv.f clarnv.f clarrv.f clartg.f90 clartv.f
clarz.f clarzb.f clarzt.f clascl.f claset.f clasr.f classq.f90
@@ -262,8 +262,8 @@ set(DLASRC
dlaqgb.f dlaqge.f dlaqp2.f dlaqp2rk.f dlaqp3rk.f dlaqps.f dlaqsb.f dlaqsp.f dlaqsy.f
dlaqr0.f dlaqr1.f dlaqr2.f dlaqr3.f dlaqr4.f dlaqr5.f
dlaqtr.f dlar1v.f dlar2v.f iladlr.f iladlc.f
dlarf.f dlarfb.f dlarfb_gett.f dlarfg.f dlarfgp.f dlarft.f dlarfx.f dlarfy.f
dlarf1f.f dlarf1l.f dlargv.f dlarrv.f dlartv.f
dlarf.f dlarfb.f dlarfb_gett.f dlarfg.f dlarfgp.f dlarft.f dlarft_lvl2.f
dlarfx.f dlarfy.f dlarf1f.f dlarf1l.f dlargv.f dlarrv.f dlartv.f
dlarz.f dlarzb.f dlarzt.f dlasy2.f
dlasyf.f dlasyf_rook.f dlasyf_rk.f dlasyf_aa.f
dlatbs.f dlatdf.f dlatps.f dlatrd.f dlatrs.f dlatrz.f
@@ -372,7 +372,7 @@ set(ZLASRC
zlaqr0.f zlaqr1.f zlaqr2.f zlaqr3.f zlaqr4.f zlaqr5.f
zlaqsp.f zlaqsy.f zlar1v.f zlar2v.f ilazlr.f ilazlc.f
zlarcm.f zlarf.f zlarfb.f zlarfb_gett.f
zlarfg.f zlarfgp.f zlarft.f zlarf1f.f zlarf1l.f
zlarfg.f zlarfgp.f zlarft.f zlarft_lvl2.f zlarf1f.f zlarf1l.f
zlarfx.f zlarfy.f zlargv.f zlarnv.f zlarrv.f zlartg.f90 zlartv.f
zlarz.f zlarzb.f zlarzt.f zlascl.f zlaset.f zlasr.f
zlassq.f90 zlasyf.f zlasyf_rook.f zlasyf_rk.f zlasyf_aa.f
@@ -575,8 +575,8 @@ set(SLASRC
slaqgb.c slaqge.c slaqp2.c slaqp2rk.c slaqp3rk.c slaqps.c slaqsb.c slaqsp.c slaqsy.c
slaqr0.c slaqr1.c slaqr2.c slaqr3.c slaqr4.c slaqr5.c
slaqtr.c slar1v.c slar2v.c ilaslr.c ilaslc.c
slarf.c slarfb.c slarfb_gett.c slarfg.c slarfgp.c slarft.c slarfx.c slarfy.c slargv.c
slarf1f.c slarf1l.c slarrv.c slartv.c
slarf.c slarfb.c slarfb_gett.c slarfg.c slarfgp.c slarft.c slarft_lvl2.c slarfx.c
slarfy.c slargv.c slarf1f.c slarf1l.c slarrv.c slartv.c
slarz.c slarzb.c slarzt.c slasy2.c
slasyf.c slasyf_rook.c slasyf_rk.c slasyf_aa.c
slatbs.c slatdf.c slatps.c slatrd.c slatrs.c slatrz.c
@@ -682,7 +682,7 @@ set(CLASRC
claqr0.c claqr1.c claqr2.c claqr3.c claqr4.c claqr5.c
claqsp.c claqsy.c clar1v.c clar2v.c ilaclr.c ilaclc.c
clarf.c clarfb.c clarfb_gett.c clarfg.c clarfgp.c clarft.c
clarf1f.c clarf1l.c
clarft_lvl2.c clarf1f.c clarf1l.c
clarfx.c clarfy.c clargv.c clarnv.c clarrv.c clartg.c clartv.c
clarz.c clarzb.c clarzt.c clascl.c claset.c clasr.c classq.c
clasyf.c clasyf_rook.c clasyf_rk.c clasyf_aa.c
@@ -765,8 +765,8 @@ set(DLASRC
dlaqgb.c dlaqge.c dlaqp2.c dlaqp2rk.c dlaqp3rk.c dlaqps.c dlaqsb.c dlaqsp.c dlaqsy.c
dlaqr0.c dlaqr1.c dlaqr2.c dlaqr3.c dlaqr4.c dlaqr5.c
dlaqtr.c dlar1v.c dlar2v.c iladlr.c iladlc.c
dlarf.c dlarfb.c dlarfb_gett.c dlarfg.c dlarfgp.c dlarft.c dlarfx.c dlarfy.c
dlarf1f.c dlarf1l.c dlargv.c dlarrv.c dlartv.c
dlarf.c dlarfb.c dlarfb_gett.c dlarfg.c dlarfgp.c dlarft.c dlarft_lvl2.c
dlarfx.c dlarfy.c dlarf1f.c dlarf1l.c dlargv.c dlarrv.c dlartv.c
dlarz.c dlarzb.c dlarzt.c dlasy2.c
dlasyf.c dlasyf_rook.c dlasyf_rk.c dlasyf_aa.c
dlatbs.c dlatdf.c dlatps.c dlatrd.c dlatrs.c dlatrz.c
@@ -874,7 +874,7 @@ set(ZLASRC
zlaqr0.c zlaqr1.c zlaqr2.c zlaqr3.c zlaqr4.c zlaqr5.c
zlaqsp.c zlaqsy.c zlar1v.c zlar2v.c ilazlr.c ilazlc.c
zlarcm.c zlarf.c zlarfb.c zlarfb_gett.c zlarf1f.c zlarf1l.c
zlarfg.c zlarfgp.c zlarft.c
zlarfg.c zlarfgp.c zlarft.c zlarft_lvl2.c
zlarfx.c zlarfy.c zlargv.c zlarnv.c zlarrv.c zlartg.c zlartv.c
zlarz.c zlarzb.c zlarzt.c zlascl.c zlaset.c zlasr.c
zlassq.c zlasyf.c zlasyf_rook.c zlasyf_rk.c zlasyf_aa.c
+2 -2
View File
@@ -68,10 +68,10 @@ endif ()
if (DEFINED BINARY AND DEFINED TARGET AND BINARY EQUAL 32)
message(STATUS "Compiling a ${BINARY}-bit binary.")
set(NO_AVX 1)
if (${TARGET} STREQUAL "HASWELL" OR ${TARGET} STREQUAL "SANDYBRIDGE" OR ${TARGET} STREQUAL "SKYLAKEX" OR ${TARGET} STREQUAL "COOPERLAKE" OR ${TARGET} STREQUAL "SAPPHIRERAPIDS")
if (${TARGET} STREQUAL "HASWELL" OR ${TARGET} STREQUAL "ZEN" OR ${TARGET} STREQUAL "SANDYBRIDGE" OR ${TARGET} STREQUAL "SKYLAKEX" OR ${TARGET} STREQUAL "COOPERLAKE" OR ${TARGET} STREQUAL "SAPPHIRERAPIDS")
set(TARGET "NEHALEM")
endif ()
if (${TARGET} STREQUAL "BULLDOZER" OR ${TARGET} STREQUAL "PILEDRIVER" OR ${TARGET} STREQUAL "ZEN")
if (${TARGET} STREQUAL "BULLDOZER" OR ${TARGET} STREQUAL "PILEDRIVER")
set(TARGET "BARCELONA")
endif ()
if (${TARGET} STREQUAL "ARMV8" OR ${TARGET} STREQUAL "CORTEXA57" OR ${TARGET} STREQUAL "CORTEXA53" OR ${TARGET} STREQUAL "CORTEXA55")
+3 -3
View File
@@ -157,12 +157,12 @@ endif()
endif()
if (NOT NO_SME)
file(WRITE ${PROJECT_BINARY_DIR}/sme.c ".text \n.global sme_test\n\nsme_test:\nsmstart\nsmstop\nret\n")
execute_process(COMMAND ${CMAKE_C_COMPILER} -march=armv9-a+sve2+sme -c -v -o ${PROJECT_BINARY_DIR}/sme.o ${PROJECT_BINARY_DIR}/sme.c OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE NO_SME)
file(WRITE ${PROJECT_BINARY_DIR}/sme.S ".text \n.global sme_test\n\nsme_test:\nsmstart\nsmstop\nret\n")
execute_process(COMMAND ${CMAKE_C_COMPILER} -march=armv9-a+sve2+sme -c -v -o ${PROJECT_BINARY_DIR}/sme.o ${PROJECT_BINARY_DIR}/sme.S OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE NO_SME)
if (NO_SME EQUAL 1)
set (CCOMMON_OPT "${CCOMMON_OPT} -DNO_SME")
endif()
file(REMOVE "${PROJECT_BINARY_DIR}/sme.c" "${PROJECT_BINARY_DIR}/sme.o")
file(REMOVE "${PROJECT_BINARY_DIR}/sme.S" "${PROJECT_BINARY_DIR}/sme.o")
endif()
endif()
+43 -17
View File
@@ -79,6 +79,22 @@ extern "C" {
#endif
#endif
#ifndef ASSEMBLER
#ifdef HAVE_C11
#if defined(C_GCC) && ( __GNUC__ < 7)
// workaround for GCC bug 65467
#ifndef _Atomic
#define _Atomic volatile
#endif
#endif
#include <stdatomic.h>
#else
#ifndef _Atomic
#define _Atomic volatile
#endif
#endif
#endif
#if !defined(NOINCLUDE) && !defined(ASSEMBLER)
#include <stdio.h>
#include <stdlib.h>
@@ -430,6 +446,12 @@ please https://github.com/xianyi/OpenBLAS/issues/246
#include "common_quad.h"
#endif
#ifndef ASSEMBLER
#ifdef HAVE_C11
#define BLAS_LOCK_DEFINED
#endif
#endif
#ifdef ARCH_ALPHA
#include "common_alpha.h"
#endif
@@ -557,6 +579,27 @@ static __inline void blas_lock(volatile BLASULONG *address){
#define BLAS_LOCK_DEFINED
#endif
#ifdef HAVE_C11
static __inline void blas_lock(volatile BLASULONG *address) {
BLASULONG expected = 0;
while (!atomic_compare_exchange_strong((volatile _Atomic BLASULONG *)address,
&expected, (BLASULONG)1)) {
expected = 0;
YIELDING;
}
}
#endif
static __inline void blas_unlock(volatile BLASULONG *address){
#ifdef HAVE_C11
atomic_store((volatile _Atomic BLASULONG *)address, (BLASULONG)0);
#else
MB;
*address = 0;
#endif
}
#ifndef RPCC_DEFINED
#error "rpcc() implementation is missing for your platform"
#endif
@@ -740,19 +783,6 @@ __declspec(dllimport) int __cdecl omp_in_parallel(void);
__declspec(dllimport) int __cdecl omp_get_num_procs(void);
#endif
#ifdef HAVE_C11
#if defined(C_GCC) && ( __GNUC__ < 7)
// workaround for GCC bug 65467
#ifndef _Atomic
#define _Atomic volatile
#endif
#endif
#include <stdatomic.h>
#else
#ifndef _Atomic
#define _Atomic volatile
#endif
#endif
#else
#ifdef __ELF__
@@ -761,10 +791,6 @@ int omp_get_num_procs(void) __attribute__ ((weak));
#endif
#endif
static __inline void blas_unlock(volatile BLASULONG *address){
MB;
*address = 0;
}
#ifdef OS_WINDOWSSTORE
static __inline int readenv_atoi(char *env) {
+2
View File
@@ -45,6 +45,7 @@
#define WMB asm("wmb")
#define RMB asm("mb")
#ifndef BLAS_LOCK_DEFINED
static __inline void blas_lock(unsigned long *address){
#ifndef __DECC
unsigned long tmp1, tmp2;
@@ -78,6 +79,7 @@ static __inline void blas_lock(unsigned long *address){
#endif
}
#define BLAS_LOCK_DEFINED
#endif
static __inline unsigned int rpcc(void){
+2
View File
@@ -53,6 +53,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#if defined(ARMV6) || defined(ARMV7) || defined(ARMV8)
#ifndef BLAS_LOCK_DEFINED
static __inline void blas_lock(volatile BLASULONG *address){
int register ret;
@@ -75,6 +76,7 @@ static __inline void blas_lock(volatile BLASULONG *address){
#define BLAS_LOCK_DEFINED
#endif
#endif
static inline int blas_quickdivide(blasint x, blasint y){
return x / y;
+2
View File
@@ -68,6 +68,7 @@ static __inline int WhereAmI(void){
}
#endif
#ifndef BLAS_LOCK_DEFINED
static __inline void blas_lock(volatile BLASULONG *address){
BLASULONG ret;
@@ -101,6 +102,7 @@ static __inline void blas_lock(volatile BLASULONG *address){
}
#define BLAS_LOCK_DEFINED
#endif
#if !defined(OS_DARWIN) && !defined (OS_ANDROID)
static __inline BLASULONG rpcc(void){
+4
View File
@@ -56,6 +56,7 @@
#define RPCC64BIT
#ifndef __ECC
#ifndef BLAS_LOCK_DEFINED
static __inline void blas_lock(volatile unsigned long *address){
unsigned long ret;
@@ -70,6 +71,7 @@ static __inline void blas_lock(volatile unsigned long *address){
} while (ret);
}
#define BLAS_LOCK_DEFINED
#endif
static __inline unsigned long rpcc(void) {
unsigned long clocks;
@@ -98,11 +100,13 @@ static __inline void ldmxcsr(unsigned long fp) {
#else
#ifndef BLAS_LOCK_DEFINED
static __inline void blas_lock(volatile unsigned long *address){
while (*address || _InterlockedCompareExchange((volatile int *) address,1,0))
;
}
#define BLAS_LOCK_DEFINED
#endif
static __inline unsigned int rpcc(void) {
return __getReg(_IA64_REG_AR_ITC);
+1 -1
View File
@@ -70,7 +70,7 @@ extern long int syscall (long int __sysno, ...);
static inline int my_mbind(void *addr, unsigned long len, int mode,
unsigned long *nodemask, unsigned long maxnode,
unsigned flags) {
#if defined (__LSB_VERSION__) || defined(ARCH_ZARCH)
#if defined (__LSB_VERSION__) || defined(ARCH_ZARCH) || defined(__PIZLONATOR_WAS_HERE__)
// So far, LSB (Linux Standard Base) don't support syscall().
// https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3482
return 0;
+2
View File
@@ -89,6 +89,7 @@
void *qalloc(int flags, size_t bytes);
#ifndef BLAS_LOCK_DEFINED
static inline void blas_lock(volatile unsigned long *address){
long int ret, val = 1;
@@ -123,6 +124,7 @@ static inline void blas_lock(volatile unsigned long *address){
} while (ret);
}
#define BLAS_LOCK_DEFINED
#endif
static inline unsigned long rpcc(void){
unsigned long ret;
+2
View File
@@ -45,6 +45,7 @@
#ifndef ASSEMBLER
#ifndef BLAS_LOCK_DEFINED
static __inline void blas_lock(volatile unsigned long *address){
long int ret = 1;
@@ -60,6 +61,7 @@ static __inline void blas_lock(volatile unsigned long *address){
} while (ret);
}
#define BLAS_LOCK_DEFINED
#endif
static __inline unsigned long rpcc(void){
unsigned long clocks;
+4 -1
View File
@@ -51,7 +51,7 @@ extern void goto_set_num_threads(int nthreads);
#undef TIMING_DEBUG
/* Global Parameter */
extern int blas_cpu_number;
extern _Atomic int blas_cpu_number;
extern int blas_num_threads;
extern int blas_omp_linked;
@@ -191,6 +191,9 @@ int exec_blas(BLASLONG num_cpu, blas_param_t *param, void *buffer);
#ifndef ASSEMBLER
void blas_level3_thread_enter(void);
void blas_level3_thread_leave(void);
int blas_level1_thread(int mode, BLASLONG m, BLASLONG n, BLASLONG k, void *alpha,
void *a, BLASLONG lda,
void *b, BLASLONG ldb,
+2
View File
@@ -54,6 +54,7 @@
#define __volatile__
#endif
#ifndef BLAS_LOCK_DEFINED
static __inline void blas_lock(volatile BLASULONG *address){
int ret;
@@ -83,6 +84,7 @@ static __inline void blas_lock(volatile BLASULONG *address){
}
#define BLAS_LOCK_DEFINED
#endif
static __inline unsigned long long rpcc(void){
#if defined(_MSC_VER) && !defined(__clang__)
+7 -1
View File
@@ -70,6 +70,7 @@
#define RMB
#endif
#ifndef BLAS_LOCK_DEFINED
static __inline void blas_lock(volatile BLASULONG *address){
@@ -83,11 +84,15 @@ static __inline void blas_lock(volatile BLASULONG *address){
while (*address) {YIELDING;}
#ifndef C_MSVC
#ifdef __PIZLONATOR_WAS_HERE__
ret=__atomic_exchange_n(address, 1, __ATOMIC_SEQ_CST);
#else
__asm__ __volatile__(
"xchgl %0, %1\n"
: "=r"(ret), "=m"(*address)
: "0"(1), "m"(*address)
: "memory");
#endif
#else
ret=InterlockedExchange64((volatile LONG64 *)(address), 1);
#endif
@@ -95,6 +100,7 @@ static __inline void blas_lock(volatile BLASULONG *address){
}
#define BLAS_LOCK_DEFINED
#endif
static __inline BLASULONG rpcc(void){
#ifdef C_MSVC
@@ -237,7 +243,7 @@ static __inline unsigned int blas_quickdivide(unsigned int x, unsigned int y){
y = blas_quick_divide_table[y];
__asm__ __volatile__ ("mull %0" :"=d" (result), "+a"(x) : "0" (y));
__asm__ __volatile__ ("mull %0" :"=d" (result), "+a"(x) : "0" (y) : "cc");
return result;
}
#endif
+26 -10
View File
@@ -5,19 +5,35 @@ enable_language(CXX)
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -DADD${BU} -DCBLAS")
if (USE_OPENMP)
set(CPP_THREAD_SAFETY_LIBS ${OpenBLAS_LIBNAME})
find_package(Threads REQUIRED)
list(APPEND CPP_THREAD_SAFETY_LIBS Threads::Threads)
add_definitions(-DOPENBLAS_USE_GENERATED_CBLAS_H)
if ((CPP_THREAD_SAFETY_TEST OR CPP_THREAD_SAFETY_GEMV) AND CPP_THREAD_SAFETY_USE_OPENMP)
find_package(OpenMP REQUIRED COMPONENTS CXX)
list(APPEND CPP_THREAD_SAFETY_LIBS OpenMP::OpenMP_CXX)
add_definitions(-DCPP_THREAD_SAFETY_USE_OPENMP)
endif()
set(CPP_THREAD_SAFETY_DGEMM_ARGS "" CACHE STRING "Arguments passed to the DGEMM thread safety test")
set(CPP_THREAD_SAFETY_DGEMM_MIXED_ARGS "" CACHE STRING "Arguments passed to the mixed DGEMM thread safety test")
set(CPP_THREAD_SAFETY_DGEMV_ARGS "" CACHE STRING "Arguments passed to the DGEMV thread safety test")
if (CPP_THREAD_SAFETY_TEST)
message(STATUS building thread safety test)
add_executable(dgemm_thread_safety dgemm_thread_safety.cpp)
target_link_libraries(dgemm_thread_safety ${OpenBLAS_LIBNAME})
add_test( dgemm_thread_safety ${CMAKE_CURRENT_BINARY_DIR}/dgemm_thread_safety)
message(STATUS "building thread safety test")
add_executable(dgemm_thread_safety dgemm_thread_safety.cpp)
target_link_libraries(dgemm_thread_safety ${CPP_THREAD_SAFETY_LIBS})
add_test(NAME dgemm_thread_safety COMMAND ${CMAKE_CURRENT_BINARY_DIR}/dgemm_thread_safety ${CPP_THREAD_SAFETY_DGEMM_ARGS})
add_executable(dgemm_thread_safety_mixed dgemm_thread_safety_mixed.cpp)
target_link_libraries(dgemm_thread_safety_mixed ${CPP_THREAD_SAFETY_LIBS})
add_test(NAME dgemm_thread_safety_mixed COMMAND ${CMAKE_CURRENT_BINARY_DIR}/dgemm_thread_safety_mixed ${CPP_THREAD_SAFETY_DGEMM_MIXED_ARGS})
endif()
if (CPP_THREAD_SAFETY_TEST OR CPP_THREAD_SAFETY_GEMV)
add_executable(dgemv_thread_safety dgemv_thread_safety.cpp)
target_link_libraries(dgemv_thread_safety ${OpenBLAS_LIBNAME})
add_test(dgemv_thread_safety ${CMAKE_CURRENT_BINARY_DIR}/dgemv_thread_safety)
endif()
add_executable(dgemv_thread_safety dgemv_thread_safety.cpp)
target_link_libraries(dgemv_thread_safety ${CPP_THREAD_SAFETY_LIBS})
add_test(NAME dgemv_thread_safety COMMAND ${CMAKE_CURRENT_BINARY_DIR}/dgemv_thread_safety ${CPP_THREAD_SAFETY_DGEMV_ARGS})
endif()
+8 -4
View File
@@ -1,15 +1,19 @@
TOPDIR = ..
include $(TOPDIR)/Makefile.system
all :: dgemv_tester dgemm_tester
all :: dgemv_tester dgemm_tester dgemm_mixed_tester
dgemv_tester :
$(CXX) $(COMMON_OPT) -Wall -Wextra -Wshadow -fopenmp -std=c++11 dgemv_thread_safety.cpp ../$(LIBNAME) $(EXTRALIB) $(FEXTRALIB) -o dgemv_tester
$(CXX) $(COMMON_OPT) -Wall -Wextra -Wshadow -std=c++11 dgemv_thread_safety.cpp ../$(LIBNAME) $(EXTRALIB) $(FEXTRALIB) -o dgemv_tester
./dgemv_tester
dgemm_tester : dgemv_tester
$(CXX) $(COMMON_OPT) -Wall -Wextra -Wshadow -fopenmp -std=c++11 dgemm_thread_safety.cpp ../$(LIBNAME) $(EXTRALIB) $(FEXTRALIB) -o dgemm_tester
$(CXX) $(COMMON_OPT) -Wall -Wextra -Wshadow -std=c++11 dgemm_thread_safety.cpp ../$(LIBNAME) $(EXTRALIB) $(FEXTRALIB) -o dgemm_tester
./dgemm_tester
dgemm_mixed_tester : dgemm_tester
$(CXX) $(COMMON_OPT) -Wall -Wextra -Wshadow -std=c++11 dgemm_thread_safety_mixed.cpp ../$(LIBNAME) $(EXTRALIB) $(FEXTRALIB) -o dgemm_mixed_tester
./dgemm_mixed_tester
clean ::
rm -f dgemv_tester dgemm_tester
rm -f dgemv_tester dgemm_tester dgemm_mixed_tester
@@ -1,3 +1,9 @@
#ifdef CPP_THREAD_SAFETY_USE_OPENMP
#include <omp.h>
#else
#include <thread>
#endif
inline void pauser(){
/// a portable way to pause a program
std::string dummy;
@@ -13,6 +19,29 @@ void FailIfThreadsAreZero(uint32_t numConcurrentThreads) {
}
}
uint32_t GetMaxHwThreads() {
#ifdef CPP_THREAD_SAFETY_USE_OPENMP
return omp_get_max_threads();
#else
const uint32_t maxHwThreads = std::thread::hardware_concurrency();
return maxHwThreads == 0 ? 1 : maxHwThreads;
#endif
}
void SetLauncherThreads(uint32_t numConcurrentThreads) {
#ifdef CPP_THREAD_SAFETY_USE_OPENMP
omp_set_num_threads(numConcurrentThreads);
#endif
}
const char *LauncherName() {
#ifdef CPP_THREAD_SAFETY_USE_OPENMP
return " using OpenMP";
#else
return "";
#endif
}
void FillMatrices(std::vector<std::vector<double>>& matBlock, std::mt19937_64& PRNG, std::uniform_real_distribution<double>& rngdist, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numMat){
for(uint32_t i=0; i<numMat; i++){
for(uint32_t j = 0; j < static_cast<uint32_t>(randomMatSize*randomMatSize); j++){
+9 -4
View File
@@ -2,8 +2,11 @@
#include <vector>
#include <random>
#include <future>
#include <omp.h>
#ifdef OPENBLAS_USE_GENERATED_CBLAS_H
#include "generated/cblas.h"
#else
#include "../cblas.h"
#endif
#include "cpp_thread_safety_common.h"
void launch_cblas_dgemm(double* A, double* B, double* C, const blasint randomMatSize){
@@ -14,7 +17,7 @@ int main(int argc, char* argv[]){
blasint randomMatSize = 1024; //dimension of the random square matrices used
uint32_t numConcurrentThreads = 96; //number of concurrent calls of the functions being tested
uint32_t numTestRounds = 16; //number of testing rounds before success exit
uint32_t maxHwThreads = omp_get_max_threads();
uint32_t maxHwThreads = GetMaxHwThreads();
if (maxHwThreads < 96)
numConcurrentThreads = maxHwThreads;
@@ -65,11 +68,13 @@ int main(int argc, char* argv[]){
//PrintMatrices(matBlock, randomMatSize, numConcurrentThreads, 3);
std::cout<<"done\n";
std::cout<<"Testing CBLAS DGEMM thread safety\n";
omp_set_num_threads(numConcurrentThreads);
SetLauncherThreads(numConcurrentThreads);
for(uint32_t R=0; R<numTestRounds; R++){
std::cout<<"DGEMM round #"<<R<<std::endl;
std::cout<<"Launching "<<numConcurrentThreads<<" threads simultaneously using OpenMP..."<<std::flush;
std::cout<<"Launching "<<numConcurrentThreads<<" threads simultaneously"<<LauncherName()<<"..."<<std::flush;
#ifdef CPP_THREAD_SAFETY_USE_OPENMP
#pragma omp parallel for default(none) shared(futureBlock, matBlock, randomMatSize, numConcurrentThreads)
#endif
for(uint32_t i=0; i<numConcurrentThreads; i++){
futureBlock[i] = std::async(std::launch::async, launch_cblas_dgemm, &matBlock[i*3][0], &matBlock[i*3+1][0], &matBlock[i*3+2][0], randomMatSize);
//launch_cblas_dgemm( &matBlock[i][0], &matBlock[i+1][0], &matBlock[i+2][0]);
@@ -0,0 +1,139 @@
#include <atomic>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <random>
#include <string>
#include <thread>
#include <vector>
#ifdef OPENBLAS_USE_GENERATED_CBLAS_H
#include "generated/cblas.h"
#else
#include "../cblas.h"
#endif
#include "cpp_thread_safety_common.h"
void compute_dgemm_pair(std::vector<double>& transA, std::vector<double>& noTransA, std::vector<double>& B, double* firstOutput, double* secondOutput, const blasint randomMatSize, const bool sameVariant){
cblas_dgemm(CblasRowMajor, CblasTrans, CblasNoTrans, randomMatSize, 2, 2, 1.0, &transA[0], randomMatSize, &B[0], 2, 0.0, firstOutput, 2);
if (sameVariant)
cblas_dgemm(CblasRowMajor, CblasTrans, CblasNoTrans, randomMatSize, 2, 4, 1.0, &transA[0], randomMatSize, &B[0], 2, 0.0, secondOutput, 2);
else
cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, randomMatSize, 2, 4, 1.0, &noTransA[0], 4, &B[0], 2, 0.0, secondOutput, 2);
}
void run_worker(std::vector<double>& transA, std::vector<double>& noTransA, std::vector<double>& B, const std::vector<double>& referenceFirst, const std::vector<double>& referenceSecond, const blasint randomMatSize, const uint32_t numTestRounds, const bool sameVariant, std::atomic<uint32_t>& readyThreads, std::atomic<bool>& startThreads, uint32_t& mismatches){
std::vector<double> firstOutput(static_cast<size_t>(randomMatSize) * 2);
std::vector<double> secondOutput(static_cast<size_t>(randomMatSize) * 2);
const size_t outputBytes = static_cast<size_t>(randomMatSize) * 2 * sizeof(double);
uint32_t localMismatches = 0;
readyThreads.fetch_add(1);
while (!startThreads.load())
std::this_thread::yield();
for(uint32_t i=0; i<numTestRounds; i++){
compute_dgemm_pair(transA, noTransA, B, &firstOutput[0], &secondOutput[0], randomMatSize, sameVariant);
if (std::memcmp(&firstOutput[0], &referenceFirst[0], outputBytes) != 0 ||
std::memcmp(&secondOutput[0], &referenceSecond[0], outputBytes) != 0)
localMismatches++;
}
mismatches = localMismatches;
}
int main(int argc, char* argv[]){
blasint randomMatSize = 262144;
uint32_t numConcurrentThreads = 8;
uint32_t numTestRounds = 200;
uint32_t maxHwThreads = GetMaxHwThreads();
bool sameVariant = false;
if (maxHwThreads < numConcurrentThreads)
numConcurrentThreads = maxHwThreads;
if (argc != 1 && argc != 4 && argc != 5){
std::cout<<"ERROR: expected zero arguments, or: <M> <threads> <rounds> [sameVariant]"<<std::endl;
return 1;
}
if(argc == 4 || argc == 5){
std::vector<std::string> cliArgs;
for (int i = 1; i < argc; i++){
cliArgs.push_back(argv[i]);
std::cout<<argv[i]<<std::endl;
}
randomMatSize = std::stoul(cliArgs[0]);
numConcurrentThreads = std::stoul(cliArgs[1]);
numTestRounds = std::stoul(cliArgs[2]);
if (argc == 5)
sameVariant = std::stoul(cliArgs[3]) != 0;
}
FailIfThreadsAreZero(numConcurrentThreads);
const size_t matrixElements = static_cast<size_t>(randomMatSize) * 4;
const size_t outputElements = static_cast<size_t>(randomMatSize) * 2;
std::vector<double> transA(matrixElements);
std::vector<double> noTransA(matrixElements);
std::vector<double> B(8);
std::vector<double> referenceFirst(outputElements);
std::vector<double> referenceSecond(outputElements);
std::vector<std::thread> threads(numConcurrentThreads);
std::vector<uint32_t> mismatchBlock(numConcurrentThreads);
std::atomic<uint32_t> readyThreads(0);
std::atomic<bool> startThreads(false);
std::cout<<"*----------------------------------*\n";
std::cout<<"| Mixed DGEMM thread safety tester |\n";
std::cout<<"*----------------------------------*\n";
std::cout<<"Tall-skinny DGEMM M dimension: "<<randomMatSize<<'\n';
std::cout<<"Number of concurrent calls into OpenBLAS : "<<numConcurrentThreads<<'\n';
std::cout<<"Number of testing rounds : "<<numTestRounds<<'\n';
std::cout<<"Second DGEMM uses "<<(sameVariant ? "the same transpose variant" : "a different transpose variant")<<'\n';
std::cout<<"OpenBLAS internal threads : "<<openblas_get_num_threads()<<'\n';
std::cout<<"This test will need "<<(static_cast<uint64_t>(matrixElements) * 2 * 8 + static_cast<uint64_t>(outputElements) * (2 + 2 * numConcurrentThreads) * 8)/static_cast<double>(1024*1024)<<" MiB of RAM\n"<<std::endl;
std::cout<<"Filling matrices with deterministic values..."<<std::flush;
for(size_t i=0; i<matrixElements; i++){
transA[i] = static_cast<double>(i % 512);
noTransA[i] = static_cast<double>((i * 7) % 512);
}
std::cout<<"done\n";
std::cout<<"Filling RHS matrix..."<<std::flush;
for(uint32_t i=0; i<8; i++){
B[i] = 0.1 * static_cast<double>(i + 1);
}
std::cout<<"done\n";
std::cout<<"Computing reference results..."<<std::flush;
compute_dgemm_pair(transA, noTransA, B, &referenceFirst[0], &referenceSecond[0], randomMatSize, sameVariant);
std::cout<<"done\n";
std::cout<<"Testing mixed CBLAS DGEMM thread safety\n";
std::cout<<"Launching "<<numConcurrentThreads<<" worker threads..."<<std::flush;
for(uint32_t i=0; i<numConcurrentThreads; i++){
threads[i] = std::thread(run_worker, std::ref(transA), std::ref(noTransA), std::ref(B), std::cref(referenceFirst), std::cref(referenceSecond), randomMatSize, numTestRounds, sameVariant, std::ref(readyThreads), std::ref(startThreads), std::ref(mismatchBlock[i]));
}
while (readyThreads.load() != numConcurrentThreads)
std::this_thread::yield();
startThreads.store(true);
std::cout<<"done\n";
std::cout<<"Waiting for worker threads to finish..."<<std::flush;
uint32_t mismatches = 0;
for(uint32_t i=0; i<numConcurrentThreads; i++){
threads[i].join();
mismatches += mismatchBlock[i];
}
std::cout<<"done\n";
std::cout<<"Mixed DGEMM mismatches: "<<mismatches<<std::endl;
if (mismatches != 0) {
std::cout<<"Mixed CBLAS DGEMM thread safety test FAILED!"<<std::endl;
return 1;
}
std::cout<<"Mixed CBLAS DGEMM thread safety test PASSED!\n"<<std::endl;
return 0;
}
+9 -4
View File
@@ -2,8 +2,11 @@
#include <vector>
#include <random>
#include <future>
#include <omp.h>
#ifdef OPENBLAS_USE_GENERATED_CBLAS_H
#include "generated/cblas.h"
#else
#include "../cblas.h"
#endif
#include "cpp_thread_safety_common.h"
void launch_cblas_dgemv(double* A, double* x, double* y, const blasint randomMatSize)
@@ -17,7 +20,7 @@ int main(int argc, char* argv[])
blasint randomMatSize = 1024; //dimension of the random square matrices and vectors being used
uint32_t numConcurrentThreads = 52; //number of concurrent calls of the functions being tested
uint32_t numTestRounds = 16; //number of testing rounds before success exit
uint32_t maxHwThreads = omp_get_max_threads();
uint32_t maxHwThreads = GetMaxHwThreads();
if (maxHwThreads < 52)
numConcurrentThreads = maxHwThreads;
@@ -84,12 +87,14 @@ int main(int argc, char* argv[])
std::cout<<"done\n";
std::cout<<"Testing CBLAS DGEMV thread safety"<<std::endl;
omp_set_num_threads(numConcurrentThreads);
SetLauncherThreads(numConcurrentThreads);
for(uint32_t R=0; R<numTestRounds; R++)
{
std::cout<<"DGEMV round #"<<R<<std::endl;
std::cout<<"Launching "<<numConcurrentThreads<<" threads simultaneously using OpenMP..."<<std::flush;
std::cout<<"Launching "<<numConcurrentThreads<<" threads simultaneously"<<LauncherName()<<"..."<<std::flush;
#ifdef CPP_THREAD_SAFETY_USE_OPENMP
#pragma omp parallel for default(none) shared(futureBlock, matBlock, vecBlock, randomMatSize, numConcurrentThreads)
#endif
for(uint32_t i=0; i<numConcurrentThreads; i++)
{
futureBlock[i] = std::async(std::launch::async, launch_cblas_dgemv, &matBlock[i][0], &vecBlock[i*2][0], &vecBlock[i*2+1][0], randomMatSize);
+3 -2
View File
@@ -321,9 +321,10 @@ int detect(void)
return CPU_CORTEXX2;
else if (strstr(cpu_part, "0xd4e")) //X3
return CPU_CORTEXX2;
else if (strstr(cpu_part, "0xd4f")) //NVIDIA Grace et al.
else if (strstr(cpu_part, "0xd4f"))
return CPU_NEOVERSEV2;
else if (strstr(cpu_part, "0xd87") || strstr(cpu_part, "0xd85") || strstr(cpu_part, "0xd83")) // X925/A725
else if (strstr(cpu_part, "0xd87") || strstr(cpu_part, "0xd85") // A725,X925
|| strstr(cpu_part, "0xd84") || strstr(cpu_part, "0xd83")) // V3,V3AE
return CPU_NEOVERSEV2;
else if (strstr(cpu_part, "0xd0b"))
return CPU_CORTEXA76;
+2 -2
View File
@@ -395,8 +395,8 @@ void get_cpuconfig(void) {
}
}
if(os_support_lsx) printf("#define HAVE_LSX\n");
if(os_support_lasx) printf("#define HAVE_LASX\n");
if(os_support_lsx()) printf("#define HAVE_LSX\n");
if(os_support_lasx()) printf("#define HAVE_LASX\n");
get_cpucount(&num_cores);
if (num_cores)
+2
View File
@@ -1843,9 +1843,11 @@ int get_cpuname(void)
if (support_avx2()) return CPUTYPE_ZEN;
else return CPUTYPE_DUNNINGTON;
default:
if (support_avx2()) return CPUTYPE_ZEN;
return CPUTYPE_NEHALEM;
}
default:
if (support_avx2()) return CPUTYPE_ZEN;
return CPUTYPE_NEHALEM;
}
}
+1 -1
View File
@@ -182,6 +182,6 @@ ARCH_WASM
OS_WINDOWS
#endif
#if defined(TARGET_OS_IPHONE)
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
OS_IOS
#endif
+99 -99
View File
@@ -67,16 +67,16 @@ ztestl3o_3m = c_zblas3_3m.o c_z3chke_3m.o auxiliary.o c_xerbla.o constant.o
all :: all1 all2 all3
ifeq ($(BUILD_SINGLE),1)
all1targets += xscblat1
all1targets += xscblat1$(EXE)
endif
ifeq ($(BUILD_DOUBLE),1)
all1targets += xdcblat1
all1targets += xdcblat1$(EXE)
endif
ifeq ($(BUILD_COMPLEX),1)
all1targets += xccblat1
all1targets += xccblat1$(EXE)
endif
ifeq ($(BUILD_COMPLEX16),1)
all1targets += xzcblat1
all1targets += xzcblat1$(EXE)
endif
all1: $(all1targets)
@@ -84,44 +84,44 @@ all1: $(all1targets)
ifneq ($(CROSS), 1)
ifeq ($(USE_OPENMP), 1)
ifeq ($(BUILD_SINGLE),1)
OMP_NUM_THREADS=2 ./xscblat1
OMP_NUM_THREADS=2 ./xscblat1$(EXE)
endif
ifeq ($(BUILD_DOUBLE),1)
OMP_NUM_THREADS=2 ./xdcblat1
endif
OMP_NUM_THREADS=2 ./xdcblat1$(EXE)
endif
ifeq ($(BUILD_COMPLEX),1)
OMP_NUM_THREADS=2 ./xccblat1
OMP_NUM_THREADS=2 ./xccblat1$(EXE)
endif
ifeq ($(BUILD_COMPLEX16),1)
OMP_NUM_THREADS=2 ./xzcblat1
OMP_NUM_THREADS=2 ./xzcblat1$(EXE)
endif
else
ifeq ($(BUILD_SINGLE),1)
OPENBLAS_NUM_THREADS=2 ./xscblat1
OPENBLAS_NUM_THREADS=2 ./xscblat1$(EXE)
endif
ifeq ($(BUILD_DOUBLE),1)
OPENBLAS_NUM_THREADS=2 ./xdcblat1
OPENBLAS_NUM_THREADS=2 ./xdcblat1$(EXE)
endif
ifeq ($(BUILD_COMPLEX),1)
OPENBLAS_NUM_THREADS=2 ./xccblat1
OPENBLAS_NUM_THREADS=2 ./xccblat1$(EXE)
endif
ifeq ($(BUILD_COMPLEX16),1)
OPENBLAS_NUM_THREADS=2 ./xzcblat1
OPENBLAS_NUM_THREADS=2 ./xzcblat1$(EXE)
endif
endif
endif
ifeq ($(BUILD_SINGLE),1)
all2targets += xscblat2
all2targets += xscblat2$(EXE)
endif
ifeq ($(BUILD_DOUBLE),1)
all2targets += xdcblat2
all2targets += xdcblat2$(EXE)
endif
ifeq ($(BUILD_COMPLEX),1)
all2targets += xccblat2
all2targets += xccblat2$(EXE)
endif
ifeq ($(BUILD_COMPLEX16),1)
all2targets += xzcblat2
all2targets += xzcblat2$(EXE)
endif
all2: $(all2targets)
@@ -129,50 +129,50 @@ all2: $(all2targets)
ifneq ($(CROSS), 1)
ifeq ($(USE_OPENMP), 1)
ifeq ($(BUILD_SINGLE),1)
OMP_NUM_THREADS=2 ./xscblat2 < sin2
OMP_NUM_THREADS=2 ./xscblat2$(EXE) < sin2
endif
ifeq ($(BUILD_DOUBLE),1)
OMP_NUM_THREADS=2 ./xdcblat2 < din2
OMP_NUM_THREADS=2 ./xdcblat2$(EXE) < din2
endif
ifeq ($(BUILD_COMPLEX),1)
OMP_NUM_THREADS=2 ./xccblat2 < cin2
OMP_NUM_THREADS=2 ./xccblat2$(EXE) < cin2
endif
ifeq ($(BUILD_COMPLEX16),1)
OMP_NUM_THREADS=2 ./xzcblat2 < zin2
OMP_NUM_THREADS=2 ./xzcblat2$(EXE) < zin2
endif
else
ifeq ($(BUILD_SINGLE),1)
OPENBLAS_NUM_THREADS=2 ./xscblat2 < sin2
OPENBLAS_NUM_THREADS=2 ./xscblat2$(EXE) < sin2
endif
ifeq ($(BUILD_DOUBLE),1)
OPENBLAS_NUM_THREADS=2 ./xdcblat2 < din2
OPENBLAS_NUM_THREADS=2 ./xdcblat2$(EXE) < din2
endif
ifeq ($(BUILD_COMPLEX),1)
OPENBLAS_NUM_THREADS=2 ./xccblat2 < cin2
OPENBLAS_NUM_THREADS=2 ./xccblat2$(EXE) < cin2
endif
ifeq ($(BUILD_COMPLEX16),1)
OPENBLAS_NUM_THREADS=2 ./xzcblat2 < zin2
OPENBLAS_NUM_THREADS=2 ./xzcblat2$(EXE) < zin2
endif
endif
endif
ifeq ($(BUILD_SINGLE),1)
all3targets += xscblat3
all3targets += xscblat3$(EXE)
endif
ifeq ($(BUILD_DOUBLE),1)
all3targets += xdcblat3
all3targets += xdcblat3$(EXE)
endif
ifeq ($(BUILD_COMPLEX),1)
all3targets += xccblat3
all3targets += xccblat3$(EXE)
ifeq ($(SUPPORT_GEMM3M),1)
all3targets += xccblat3_3m
all3targets += xccblat3_3m$(EXE)
endif
endif
ifeq ($(BUILD_COMPLEX16),1)
all3targets += xzcblat3
all3targets += xzcblat3$(EXE)
ifeq ($(SUPPORT_GEMM3M),1)
all3targets += xzcblat3_3m
all3targets += xzcblat3_3m$(EXE)
endif
endif
@@ -181,46 +181,46 @@ all3: $(all3targets)
ifneq ($(CROSS), 1)
ifeq ($(USE_OPENMP), 1)
ifeq ($(BUILD_SINGLE),1)
OMP_NUM_THREADS=2 ./xscblat3 < sin3
OMP_NUM_THREADS=2 ./xscblat3$(EXE) < sin3
endif
ifeq ($(BUILD_DOUBLE),1)
OMP_NUM_THREADS=2 ./xdcblat3 < din3
OMP_NUM_THREADS=2 ./xdcblat3$(EXE) < din3
endif
ifeq ($(BUILD_COMPLEX),1)
OMP_NUM_THREADS=2 ./xccblat3 < cin3
OMP_NUM_THREADS=2 ./xccblat3$(EXE) < cin3
endif
ifeq ($(BUILD_COMPLEX16),1)
OMP_NUM_THREADS=2 ./xzcblat3 < zin3
OMP_NUM_THREADS=2 ./xzcblat3$(EXE) < zin3
endif
else
ifeq ($(BUILD_SINGLE),1)
OPENBLAS_NUM_THREADS=2 ./xscblat3 < sin3
OPENBLAS_NUM_THREADS=2 ./xscblat3$(EXE) < sin3
endif
ifeq ($(BUILD_DOUBLE),1)
OPENBLAS_NUM_THREADS=2 ./xdcblat3 < din3
OPENBLAS_NUM_THREADS=2 ./xdcblat3$(EXE) < din3
endif
ifeq ($(BUILD_COMPLEX),1)
OPENBLAS_NUM_THREADS=2 ./xccblat3 < cin3
OPENBLAS_NUM_THREADS=2 ./xccblat3$(EXE) < cin3
endif
ifeq ($(BUILD_COMPLEX16),1)
OPENBLAS_NUM_THREADS=2 ./xzcblat3 < zin3
OPENBLAS_NUM_THREADS=2 ./xzcblat3$(EXE) < zin3
endif
endif
ifeq ($(SUPPORT_GEMM3M),1)
ifeq ($(USE_OPENMP), 1)
ifeq ($(BUILD_COMPLEX),1)
OMP_NUM_THREADS=2 ./xccblat3_3m < cin3_3m
OMP_NUM_THREADS=2 ./xccblat3_3m$(EXE) < cin3_3m
endif
ifeq ($(BUILD_COMPLEX16),1)
OMP_NUM_THREADS=2 ./xzcblat3_3m < zin3_3m
OMP_NUM_THREADS=2 ./xzcblat3_3m$(EXE) < zin3_3m
endif
else
ifeq ($(BUILD_COMPLEX),1)
OPENBLAS_NUM_THREADS=2 ./xccblat3_3m < cin3_3m
OPENBLAS_NUM_THREADS=2 ./xccblat3_3m$(EXE) < cin3_3m
endif
ifeq ($(BUILD_COMPLEX16),1)
OPENBLAS_NUM_THREADS=2 ./xzcblat3_3m < zin3_3m
OPENBLAS_NUM_THREADS=2 ./xzcblat3_3m$(EXE) < zin3_3m
endif
endif
endif
@@ -254,64 +254,64 @@ endif
ifeq ($(BUILD_SINGLE),1)
# Single real
ifeq ($(NOFORTRAN), $(filter 0 2,$(NOFORTRAN)))
xscblat1: $(stestl1o) c_sblat1.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xscblat1 c_sblat1.o $(stestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xscblat2: $(stestl2o) c_sblat2.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xscblat2 c_sblat2.o $(stestl2o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xscblat3: $(stestl3o) c_sblat3.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xscblat3 c_sblat3.o $(stestl3o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xscblat1$(EXE): $(stestl1o) c_sblat1.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_sblat1.o $(stestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xscblat2$(EXE): $(stestl2o) c_sblat2.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_sblat2.o $(stestl2o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xscblat3$(EXE): $(stestl3o) c_sblat3.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_sblat3.o $(stestl3o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
else
xscblat1: $(stestl1o) c_sblat1c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xscblat1 c_sblat1c.o $(stestl1o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xscblat2: $(stestl2o) c_sblat2c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xscblat2 c_sblat2c.o $(stestl2o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xscblat3: $(stestl3o) c_sblat3c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xscblat3 c_sblat3c.o $(stestl3o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xscblat1$(EXE): $(stestl1o) c_sblat1c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_sblat1c.o $(stestl1o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xscblat2$(EXE): $(stestl2o) c_sblat2c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_sblat2c.o $(stestl2o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xscblat3$(EXE): $(stestl3o) c_sblat3c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_sblat3c.o $(stestl3o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
endif
endif
ifeq ($(BUILD_DOUBLE),1)
# Double real
ifeq ($(NOFORTRAN), $(filter 0 2,$(NOFORTRAN)))
xdcblat1: $(dtestl1o) c_dblat1.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xdcblat1 c_dblat1.o $(dtestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xdcblat2: $(dtestl2o) c_dblat2.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xdcblat2 c_dblat2.o $(dtestl2o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xdcblat3: $(dtestl3o) c_dblat3.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xdcblat3 c_dblat3.o $(dtestl3o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xdcblat1$(EXE): $(dtestl1o) c_dblat1.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_dblat1.o $(dtestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xdcblat2$(EXE): $(dtestl2o) c_dblat2.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_dblat2.o $(dtestl2o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xdcblat3$(EXE): $(dtestl3o) c_dblat3.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_dblat3.o $(dtestl3o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
else
xdcblat1: $(dtestl1o) c_dblat1c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xdcblat1 c_dblat1c.o $(dtestl1o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xdcblat2: $(dtestl2o) c_dblat2c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xdcblat2 c_dblat2c.o $(dtestl2o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xdcblat3: $(dtestl3o) c_dblat3c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xdcblat3 c_dblat3c.o $(dtestl3o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xdcblat1$(EXE): $(dtestl1o) c_dblat1c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_dblat1c.o $(dtestl1o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xdcblat2$(EXE): $(dtestl2o) c_dblat2c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_dblat2c.o $(dtestl2o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xdcblat3$(EXE): $(dtestl3o) c_dblat3c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_dblat3c.o $(dtestl3o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
endif
endif
ifeq ($(BUILD_COMPLEX),1)
# Single complex
ifeq ($(NOFORTRAN), $(filter 0 2,$(NOFORTRAN)))
xccblat1: $(ctestl1o) c_cblat1.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xccblat1 c_cblat1.o $(ctestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xccblat2: $(ctestl2o) c_cblat2.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xccblat2 c_cblat2.o $(ctestl2o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xccblat3: $(ctestl3o) c_cblat3.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xccblat3 c_cblat3.o $(ctestl3o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xccblat1$(EXE): $(ctestl1o) c_cblat1.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_cblat1.o $(ctestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xccblat2$(EXE): $(ctestl2o) c_cblat2.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_cblat2.o $(ctestl2o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xccblat3$(EXE): $(ctestl3o) c_cblat3.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_cblat3.o $(ctestl3o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
ifeq ($(SUPPORT_GEMM3M),1)
xccblat3_3m: $(ctestl3o_3m) c_cblat3_3m.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xccblat3_3m c_cblat3_3m.o $(ctestl3o_3m) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xccblat3_3m$(EXE): $(ctestl3o_3m) c_cblat3_3m.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_cblat3_3m.o $(ctestl3o_3m) $(LIB) $(EXTRALIB) $(CEXTRALIB)
endif
else
xccblat1: $(ctestl1o) c_cblat1c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xccblat1 c_cblat1c.o $(ctestl1o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xccblat2: $(ctestl2o) c_cblat2c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xccblat2 c_cblat2c.o $(ctestl2o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xccblat3: $(ctestl3o) c_cblat3c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xccblat3 c_cblat3c.o $(ctestl3o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xccblat1$(EXE): $(ctestl1o) c_cblat1c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_cblat1c.o $(ctestl1o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xccblat2$(EXE): $(ctestl2o) c_cblat2c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_cblat2c.o $(ctestl2o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xccblat3$(EXE): $(ctestl3o) c_cblat3c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_cblat3c.o $(ctestl3o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
ifeq ($(SUPPORT_GEMM3M),1)
xccblat3_3m: $(ctestl3o_3m) c_cblat3c_3m.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xccblat3_3m c_cblat3c_3m.o $(ctestl3o_3m) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xccblat3_3m$(EXE): $(ctestl3o_3m) c_cblat3c_3m.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_cblat3c_3m.o $(ctestl3o_3m) $(LIB) $(EXTRALIB) $(CEXTRALIB)
endif
endif
endif
@@ -320,26 +320,26 @@ endif
ifeq ($(BUILD_COMPLEX16),1)
# Double complex
ifeq ($(NOFORTRAN), $(filter 0 2,$(NOFORTRAN)))
xzcblat1: $(ztestl1o) c_zblat1.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xzcblat1 c_zblat1.o $(ztestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xzcblat2: $(ztestl2o) c_zblat2.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xzcblat2 c_zblat2.o $(ztestl2o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xzcblat3: $(ztestl3o) c_zblat3.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xzcblat3 c_zblat3.o $(ztestl3o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xzcblat1$(EXE): $(ztestl1o) c_zblat1.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_zblat1.o $(ztestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xzcblat2$(EXE): $(ztestl2o) c_zblat2.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_zblat2.o $(ztestl2o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xzcblat3$(EXE): $(ztestl3o) c_zblat3.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_zblat3.o $(ztestl3o) $(LIB) $(EXTRALIB) $(CEXTRALIB)
ifeq ($(SUPPORT_GEMM3M),1)
xzcblat3_3m: $(ztestl3o_3m) c_zblat3_3m.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o xzcblat3_3m c_zblat3_3m.o $(ztestl3o_3m) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xzcblat3_3m$(EXE): $(ztestl3o_3m) c_zblat3_3m.o $(TOPDIR)/$(LIBNAME)
$(FC) $(FLDFLAGS) -o $@ c_zblat3_3m.o $(ztestl3o_3m) $(LIB) $(EXTRALIB) $(CEXTRALIB)
endif
else
xzcblat1: $(ztestl1o) c_zblat1c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xzcblat1 c_zblat1c.o $(ztestl1o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xzcblat2: $(ztestl2o) c_zblat2c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xzcblat2 c_zblat2c.o $(ztestl2o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xzcblat3: $(ztestl3o) c_zblat3c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xzcblat3 c_zblat3c.o $(ztestl3o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xzcblat1$(EXE): $(ztestl1o) c_zblat1c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_zblat1c.o $(ztestl1o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xzcblat2$(EXE): $(ztestl2o) c_zblat2c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_zblat2c.o $(ztestl2o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
xzcblat3$(EXE): $(ztestl3o) c_zblat3c.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_zblat3c.o $(ztestl3o) $(LIB) $(CEXTRALIB) $(filter-out -lgfortran,$(EXTRALIB))
ifeq ($(SUPPORT_GEMM3M),1)
xzcblat3_3m: $(ztestl3o_3m) c_zblat3c_3m.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o xzcblat3_3m c_zblat3c_3m.o $(ztestl3o_3m) $(LIB) $(EXTRALIB) $(CEXTRALIB)
xzcblat3_3m$(EXE): $(ztestl3o_3m) c_zblat3c_3m.o $(TOPDIR)/$(LIBNAME)
$(CC) $(CFLAGS) -o $@ c_zblat3c_3m.o $(ztestl3o_3m) $(LIB) $(EXTRALIB) $(CEXTRALIB)
endif
endif
endif
+1 -1
View File
@@ -98,7 +98,7 @@ though - please read the linked Makefiles if you want to see all variables.
- `BUILD_DOUBLE`: build the double-precision real functions
- `BUILD_COMPLEX`: build the single-precision complex functions
- `BUILD_COMPLEX16`: build the double-precision complex functions
- `BUILD_BFLOAT16`: build the "half precision brainfloat" real functions
- `BUILD_BFLOAT16`: build the `bfloat16` real functions
- `EXPRECISION`: (do not use, this is a work in progress) option to use `long
double` functions
+18 -8
View File
@@ -22,14 +22,24 @@
| x86_64 | " |macOS11|gmake |arm64| XCode 12.4 | - | | + | - | both | Azure | |
| x86_64 | " |macOS11|gmake |arm | XCode 12.4 | - | | + | - | both | Azure | |
| x86_64 | " |Alpine Linux(musl)|gmake| - | gcc | gfortran | pthreads | + | - | both | Azure | |
| arm64 |Apple M1 |OSX |CMAKE/XCode| - | LLVM | - | OpenMP | - | - | static | Cirrus | |
| arm64 |Apple M1 |OSX |CMAKE/Xcode| - | LLVM | - | OpenMP | - | + | static | Cirrus | |
| arm64 |Apple M1 |OSX |CMAKE/XCode|x86_64| LLVM| - | - | + | - | static | Cirrus | |
| arm64 |Neoverse N1|Linux |gmake | - |gcc10.2| -| pthreads| - | - | both | Cirrus | |
| arm64 |Neoverse N1|Linux |gmake | - |gcc10.2| -| pthreads| - | + | both | Cirrus | |
| arm64 |Neoverse N1|Linux |gmake |- |gcc10.2| -| OpenMP | - | - | both |Cirrus | 8 |
| x86_64 | Ryzen| FreeBSD |gmake | - | gcc12.2|gfortran| pthreads| - | - | both | Cirrus | |
| x86_64 | Ryzen| FreeBSD |gmake | | gcc12.2|gfortran| pthreads| - | + | both | Cirrus | |
| arm64 |Apple M1 |macOS14|CMAKE | - | LLVM |gfortran| pthreads | + | - | static | Github | |
| arm64 |Apple M1 |macOS14|CMAKE | - | LLVM |gfortran| pthreads | + | + | static | Github | |
| arm64 |Apple M1 |macOS14|CMAKE | - | LLVM |gfortran| OpenMP | + | - | static | Github | |
| arm64 |Apple M1 |macOS14|CMAKE | - | LLVM |gfortran| OpenMP | + | + | static | Github | |
| arm64 |Apple M1 |macOS14|gmake | - | LLVM |gfortran| pthreads | + | - | both | Github | |
| arm64 |Apple M1 |macOS14|gmake | - | LLVM |gfortran| pthreads | + | + | both | Github | |
| arm64 |Apple M1 |macOS14|gmake | - | LLVM |gfortran| OpenMP | + | - | both | Github | |
| arm64 |Apple M1 |macOS14|gmake | - | LLVM |gfortran| OpenMP | + | + | both | Github | |
| arm64 |Apple M1 |macOS26|gmake |x86_64| XCode| - | | + | - | both | Github | |
| arm64 |Apple M1 |macOS26|gmake |arm64| XCode| - | | + | - | both | Github | |
| arm64 |Apple M1 |macOS26|gmake |arm| AndroidNDK-llvm | - | | - | - | both | Github | |
| arm64 |Neoverse N1|Linux |gmake | - |gcc|gfortran| pthreads| - | - | both | Github | |
| arm64 |Neoverse N1|Linux |gmake | - |gcc|gfortran| pthreads| - | + | both | Github | |
| arm64 |Neoverse N1|Linux |gmake |- |gcc|gfortran| OpenMP | - | - | both | Github | |
| arm64 |Graviton3 |Linux |CMAKE | - |gcc|gfortran| pthreads| + | - | static | Github | |
| arm64 |Graviton3 |Linux |gmake | - |gcc|gfortran| pthreads| + | - | both | Github | |
| x86_64 |generic|FreeBSD |gmake | - | gcc15|gfortran15| pthreads| - | - | both | Github | |
| arm64 |generic|FreeBSD |gmake | - | gcc15|gfortran15| pthreads| - | - | both | Github | |
| x86_64 |GENERIC |QEMU |gmake| mips64 | gcc | gfortran | pthreads | - | - | static | Github | |
| x86_64 |SICORTEX |QEMU |gmake| mips64 | gcc | gfortran | pthreads | - | - | static | Github | |
| x86_64 |I6400 |QEMU |gmake| mips64 | gcc | gfortran | pthreads | - | - | static | Github | |
+2 -2
View File
@@ -80,8 +80,8 @@ According to the above `KERNEL.HASWELL`, OpenBLAS Haswell dgemm kernel file is `
["Anatomy of High-Performance Matrix Multiplication"](http://delivery.acm.org/10.1145/1360000/1356053/a12-goto.pdf?ip=155.68.162.54&id=1356053&acc=ACTIVE%20SERVICE&key=A79D83B43E50B5B8%2EF070BBE7E45C3F17%2E4D4702B0C3E38B35%2E4D4702B0C3E38B35&__acm__=1517932837_edfe766f1e295d9a7830812371e1d173).
ACM Transactions on Mathematical Software 34 (3): Article 12
(The above link is available only to ACM members, but this and many related
papers is also available on [the pages of van de Geijn's FLAME project](http://www.cs.utexas.edu/~flame/web/FLAMEPublications.html))
(The above link is available only to ACM members, but this paper and many
related papers are also available on [the pages of van de Geijn's FLAME project](http://www.cs.utexas.edu/~flame/web/FLAMEPublications.html))
The `driver/level3/level3.c` is the implementation of Goto's algorithm.
Meanwhile, you can look at `kernel/generic/gemmkernel_2x2.c`, which is a naive
+6 -5
View File
@@ -4,13 +4,14 @@
This document contains recommendations only - packagers and other
redistributors are in charge of how OpenBLAS is built and distributed in their
systems, and may have good reasons to deviate from the guidance given on this
page. These recommendations are aimed at general packaging systems, with a user
base that typically is large, open source (or freely available at least), and
doesn't behave uniformly or that the packager is directly connected with.*
page. These recommendations are aimed at general packaging systems that are
open source (or at least freely available) and typically serve a large user
base that does not behave uniformly and is not directly connected with the
packager.
OpenBLAS has a large number of build-time options which can be used to change
how it behaves at runtime, how artifacts or symbols are named, etc. Variation
in build configuration can be necessary to acheive a given end goal within a
in build configuration can be necessary to achieve a given end goal within a
distribution or as an end user. However, such variation can also make it more
difficult to build on top of OpenBLAS and ship code or other packages in a way
that works across many different distros. Here we provide guidance about the
@@ -42,7 +43,7 @@ settings):
while it does make up a significant part of the binary size of the installed
library, that does not outweigh the regression in usability when deviating
from the default here.[^1]
3. Always distribute the pkg-config (`.pc`) and CMake `.cmake`) dependency
3. Always distribute the pkg-config (`.pc`) and CMake (`.cmake`) dependency
detection files. These files are used by build systems when users want to
link against OpenBLAS, and there is no benefit of leaving them out.
4. Provide the LP64 interface by default, and if in addition to that you choose
+2 -4
View File
@@ -13,9 +13,8 @@ This page documents those non-standard APIs.
| ?omatcopy | s,d,c,z | out-of-place transposition/copying |
| ?geadd | s,d,c,z | ATLAS-like matrix add `B = &alpha;*A+&beta;*B` |
| ?gemmt | s,d,c,z | `gemm` but only a triangular part updated |
| cblas_?gemm_batch | s,d,c,z,b | `gemm` with several groups of input data
|
| cblas_?gemm_batch_strided | s,d,c,z,b | `gemm` with groups of data stored at fixed offsets in the input arrays
| cblas_?gemm_batch | s,d,c,z,b | `gemm` with several groups of input data |
| cblas_?gemm_batch_strided | s,d,c,z,b | `gemm` with groups of data stored at fixed offsets in the input arrays |
## bfloat16 functionality
@@ -48,4 +47,3 @@ BLAS-like and conversion functions for `hfloat16` (available when OpenBLAS was c
* `int openblas_set_affinity(int thread_index, size_t cpusetsize, cpu_set_t *cpuset)` sets the CPU affinity mask of the given thread
to the provided cpuset. Only available on Linux, with semantics identical to `pthread_setaffinity_np`.
* `openblas_set_thread_callback_function` overrides the default multithreading backend with the provided argument
+5 -5
View File
@@ -110,7 +110,7 @@ Zaheer has fixed this bug. You can now use the structure instead of C99 complex
### <a name="Linux_SEGFAULT"></a>I get a SEGFAULT with multi-threading on Linux. What's wrong?
This may be related to a bug in the Linux kernel 2.6.32 (?). Try applying the patch segaults.patch to disable mbind using
This may be related to a bug in the Linux kernel 2.6.32 (?). Try applying the patch segfaults.patch to disable mbind using
patch < segfaults.patch
@@ -213,7 +213,7 @@ AVX-512 (SKYLAKEX) support requires devtoolset-8-gcc-gfortran (which exceeds for
### <a name="qemu"></a>Building OpenBLAS in QEMU/KVM/XEN
By default, QEMU reports the CPU as "QEMU Virtual CPU version 2.2.0", which shares CPUID with existing 32bit CPU even in 64bit virtual machine, and OpenBLAS recognizes it as PENTIUM2. Depending on the exact combination of CPU features the hypervisor choses to expose, this may not correspond to any CPU that exists, and OpenBLAS will error when trying to build. To fix this, pass `-cpu host` or `-cpu passthough` to QEMU, or another CPU model.
By default, QEMU reports the CPU as "QEMU Virtual CPU version 2.2.0", which shares CPUID with existing 32bit CPU even in 64bit virtual machine, and OpenBLAS recognizes it as PENTIUM2. Depending on the exact combination of CPU features the hypervisor chooses to expose, this may not correspond to any CPU that exists, and OpenBLAS will error when trying to build. To fix this, pass `-cpu host` to QEMU, or choose another CPU model.
Similarly, the XEN hypervisor may not pass through all features of the host cpu while reporting the cpu type itself correctly, which can
lead to compiler error messages about an "ABI change" when compiling AVX512 code. Again changing the Xen configuration by running e.g.
"xen-cmdline --set-xen cpuid=avx512" should get around this (as would building OpenBLAS for an older cpu lacking that particular feature, e.g. TARGET=HASWELL)
@@ -290,7 +290,7 @@ There have been a few reports of wrong calculation results and build-time test f
### <a name="allocmorebuffers"></a>Program is Terminated. Because you tried to allocate too many memory regions
In OpenBLAS, we mange a pool of memory buffers and allocate the number of buffers as the following.
In OpenBLAS, we manage a pool of memory buffers and set the number of buffers as follows.
```
#define NUM_BUFFERS (MAX_CPU_NUMBER * 2)
```
@@ -301,7 +301,7 @@ In `Makefile.system`, we will set `MAX_CPU_NUMBER=NUM_THREADS`.
### <a name="choose_target_dynamic"></a>How to choose TARGET manually at runtime when compiled with DYNAMIC_ARCH
The environment variable which control the kernel selection is `OPENBLAS_CORETYPE` (see `driver/others/dynamic.c`)
The environment variable that controls the kernel selection is `OPENBLAS_CORETYPE` (see `driver/others/dynamic.c`)
e.g. `export OPENBLAS_CORETYPE=Haswell`. And the function `char* openblas_get_corename()` returns the used target.
### <a name="missgoto"></a>After updating the installed OpenBLAS, a program complains about "undefined symbol gotoblas"
@@ -325,7 +325,7 @@ Specifying the "correct" library location with the `-L` flag (like `-L /opt/Open
### <a name="cudahpl"></a>I want to use OpenBLAS with CUDA in the HPL 2.3 benchmark code but it keeps looking for Intel MKL
You need to edit file src/cuda/cuda_dgemm.c in the NVIDIA version of HPL, change the "handle2" and "handle" dlopen calls to use libopenblas.so instead of libmkl_intel_lp64.so, and add an trailing underscore in the dlsym lines for dgemm_mkl and dtrsm_mkl (like `dgemm_mkl = (void(*)())dlsym(handle, dgemm_);`)
You need to edit file src/cuda/cuda_dgemm.c in the NVIDIA version of HPL, change the "handle2" and "handle" dlopen calls to use libopenblas.so instead of libmkl_intel_lp64.so, and add a trailing underscore in the dlsym lines for dgemm_mkl and dtrsm_mkl (like `dgemm_mkl = (void(*)())dlsym(handle, "dgemm_");`)
### <a name="cpusoffline"></a>Multithreaded OpenBLAS runs no faster or is even slower than singlethreaded on my ARMV7 board
+73 -23
View File
@@ -120,8 +120,8 @@ Distro-specific installation commands:
=== "OpenBLAS releases"
Windows is the only platform for which binaries are made available by the
OpenBLAS project itself. They can be downloaded from the GitHub
Releases](https://github.com/OpenMathLib/OpenBLAS/releases) page. These
OpenBLAS project itself. They can be downloaded from the
[GitHub Releases](https://github.com/OpenMathLib/OpenBLAS/releases) page. These
binaries are built with MinGW, using the following build options:
```
NUM_THREADS=64 TARGET=GENERIC DYNAMIC_ARCH=1 DYNAMIC_OLDER=1 CONSISTENT_FPCSR=1 INTERFACE=0
@@ -215,7 +215,7 @@ in this section, since the process for each is quite different.
#### Visual Studio & native Windows ABI
For Visual Studio, you can use CMake to generate Visual Studio solution files;
note that you will need at least CMake 3.11 for linking to work correctly).
note that you will need at least CMake 3.11 for linking to work correctly.
Note that you need a Fortran compiler if you plan to build and use the latest version
of the LAPACK functions included with OpenBLAS. (If you do not have a Fortran compiler
@@ -229,7 +229,7 @@ the C parts, as the ABI imposed by `ifort` is incompatible with MSVC
A fully-optimized OpenBLAS that can be statically or dynamically linked to your
application can currently be built for the 64-bit architecture with the LLVM
compiler infrastructure. We're going to use [Miniforge3] the pre-configured
compiler infrastructure. We're going to use [Miniforge3](https://github.com/conda-forge/miniforge), the pre-configured
and more versatile alternative to [Miniconda](https://docs.anaconda.com/miniconda/)
to grab all of the tools we need, since some of them are in an experimental
status. Before you begin, you'll need to have Microsoft Visual Studio 2015 or
@@ -393,7 +393,7 @@ OpenBLAS can be built targeting [Universal Windows Platform](https://en.wikipedi
To build OpenBLAS on Windows with MinGW:
1. Install the MinGW (GCC) compiler suite, either the 32-bit
[MinGW]((http://www.mingw.org/) or the 64-bit
[MinGW](http://www.mingw.org/) or the 64-bit
[MinGW-w64](http://mingw-w64.sourceforge.net/) toolchain. Be sure to install
its `gfortran` package as well (unless you really want to build the BLAS part
of OpenBLAS only) and check that `gcc` and `gfortran` are the same version.
@@ -453,7 +453,7 @@ the LLVM toolchain enables native compilation of the Fortran sources of LAPACK a
1. Clone OpenBLAS to your local machine and checkout to latest release of
OpenBLAS (unless you want to build the latest development snapshot - here we
are using the 0.3.28 release as the example, of course this exact version
are using the 0.3.28 release as the example, of course this exact version
may be outdated by the time you read this)
```cmd
@@ -569,7 +569,7 @@ The next two sections below describe how to build with Clang for ARMV7 and
ARMV8 targets, respectively. The same basic principles as described below for
ARMV8 should also apply to building an x86 or x86-64 version (substitute
something like `NEHALEM` for the target instead of `ARMV8`, and replace all the
`aarch64` in the toolchain paths with `x86` or `x96_64` as appropriate).
`aarch64` in the toolchain paths with `x86` or `x86_64` as appropriate).
!!! info "Historic note"
@@ -644,14 +644,16 @@ If you prefer building with CMake, running
cmake -DANDROID_ABI=arm64-v8a -DTARGET=ARMV8 -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk-r27/build/cmake/android.toolchain.cmake -DNOFORTRAN=1 -DANDROID_PLATFORM=android-23 ..
cmake --build .
```
in your build directory should work (be sure to adjust the toolchain_file argument according to where you installed the NDK, and the ANDROID_PLATFORM
according to the minimum version of Android you want to support. (If you leave out the ANDROID_PLATFORM parameter, the build will fail with an error
message about a missing declaration or missing header file complex.h)
in your build directory should work. Be sure to adjust the toolchain file
argument according to where you installed the NDK, and `ANDROID_PLATFORM`
according to the minimum version of Android you want to support. If you leave
out the `ANDROID_PLATFORM` parameter, the build will fail with an error message
about a missing declaration or missing header file `complex.h`.
??? note "Alternative build script for 3 architectures"
??? note "Alternative build script for 4 Android ABIs"
This script will build OpenBLAS for 3 architecture (`ARMV7`, `ARMV8`,
`X86`) and install them to `/opt/OpenBLAS/lib`. Of course you can also copy
This script will build OpenBLAS for 4 Android ABIs (`armeabi-v7a`, `arm64-v8a`,
`x86`, `x86_64`) and install them to `/opt/OpenBLAS/lib`. Of course you can also copy
only the section that is of interest to you - also notice that the `AR=`
line may need adapting to the name of the ar tool provided in your
`$TOOLCHAIN/bin` - for example `llvm-ar` in some recent NDK versions.
@@ -710,20 +712,19 @@ message about a missing declaration or missing header file complex.h)
### iPhone/iOS
As none of the current developers uses iOS, the following instructions are what
As few of the current developers use iOS, the following instructions are what
was found to work in our Azure CI setup, but as far as we know this builds a
fully working OpenBLAS for this platform.
Go to the directory where you unpacked OpenBLAS,and enter the following commands:
```bash
CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
CC="$(xcrun --sdk iphoneos --find clang)"
SDKROOT="$(xcrun --sdk iphoneos --show-sdk-path)"
CFLAGS="-O2 -Wno-macro-redefined -isysroot $SDKROOT -arch arm64 -miphoneos-version-min=10.0"
make TARGET=ARMV8 DYNAMIC_ARCH=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1
make TARGET=ARMV8 DYNAMIC_ARCH=1 NUM_THREADS=32 HOSTCC=clang NOFORTRAN=1 \
CC="${CC}" CFLAGS="-O2 -Wno-macro-redefined -isysroot ${SDKROOT} -arch arm64 -miphoneos-version-min=10.0"
```
Adjust `MIN_IOS_VERSION` as necessary for your installation. E.g., change the version number
Adjust `-miphoneos-version-min` as necessary for your installation. E.g., change the version number
to the minimum iOS version you want to target and execute this file to build the library.
### HarmonyOS
@@ -734,14 +735,14 @@ toolchain has been tested so far, but the following instructions may apply
similarly to Windows:
Download [this HarmonyOS 4.1.1 SDK](https://repo.huaweicloud.com/harmonyos/os/4.1.1-Release/ohos-sdk-windows_linux-public.tar.gz),
or whatever newer version may be available in the future). Use `tar -xvf
ohos-sdk-windows_linux_public.tar.gz` to unpack it somewhere on your system.
or whatever newer version may be available in the future. Use `tar -xvf
ohos-sdk-windows_linux-public.tar.gz` to unpack it somewhere on your system.
This will create a folder named "ohos-sdk" with subfolders "linux" and
"windows". In the linux one you will find a ZIP archive named
`native-linux-x64-4.1.7.8-Release.zip` - you need to unzip this where you want
to install the cross-compiler, for example in `/opt/ohos-sdk`.
In the directory where you unpacked OpenBLAS, create a build directory for cmake, and change into it :
In the directory where you unpacked OpenBLAS, create a build directory for cmake, and change into it:
```bash
mkdir build
cd build
@@ -755,7 +756,7 @@ contains no Fortran compiler):
-DCMAKE_TOOLCHAIN_FILE=/opt/ohos-sdk/linux/native/build/cmake/ohos.toolchain.cmake \
-DOHOS_ARCH="arm64-v8a" -DTARGET=ARMV8 -DNOFORTRAN=1 ..
```
Additional other OpenBLAS build options like `USE_OPENMP=1` or `DYNAMIC_ARCH=1`
Additional OpenBLAS build options like `USE_OPENMP=1` or `DYNAMIC_ARCH=1`
will probably work too. Finally do the build:
```bash
/opt/ohos-sdk/linux/native/build-tools/cmake/bin/cmake --build .
@@ -797,6 +798,55 @@ make BINARY=32 BINARY32=1 CC=$MTI_TOOLCHAIN-gcc AR=$MTI_TOOLCHAIN-ar FC="$MTI_TO
```
### RISC-V
OpenBLAS supports several RISC-V targets. Target selection determines whether
the resulting build is vectorized.
#### Target selection
| Target | Vectorization | Use when |
| ------------------- | ------------------------------ | ------------------------------------------------------- |
| `RISCV64_GENERIC` | None — scalar reference path | Non-vector cores, or as a baseline reference build |
| `RISCV64_ZVL128B` | RVV 1.0, VLEN >= 128 bits | Generic RVV-1.0 hardware with 128-bit vector registers |
| `RISCV64_ZVL256B` | RVV 1.0, VLEN >= 256 bits | Generic RVV-1.0 hardware with 256-bit vector registers |
| `C910V` | RVV 0.7.1 (legacy) | T-Head C910 (Allwinner D1, etc.) |
| `x280` | RVV 1.0, SiFive-tuned | SiFive x280 cores |
As with the `GENERIC` and `ARCH_GENERIC` targets on other architectures,
`RISCV64_GENERIC` maps all BLAS operations to the non-vectorized plain-C
reference path. On RISC-V specifically, `Makefile.riscv64` also appends a
scalar `-march` override for this target that takes precedence over any
user-supplied `-march=rv64gcv` flag, so passing the V extension on the
command line will not produce a vectorized build under this target.
For RVV 1.0 vectorized builds, use `RISCV64_ZVL128B` or `RISCV64_ZVL256B`.
These targets route all three BLAS levels including DGEMM to the
`_rvv.c` kernel set introduced in 2022; see
[issue #3808](https://github.com/OpenMathLib/OpenBLAS/issues/3808) for the
design rationale and the `_vector.c` (legacy RVV 0.7) / `_rvv.c` (RVV 1.0)
codebase separation.
#### Compiler requirements for ZVL targets
GCC 14 or later is required on current OpenBLAS releases when building the
`RISCV64_ZVL128B` or `RISCV64_ZVL256B` targets. GCC 13 does not implement
the segmented load/store intrinsics (`__riscv_vsseg*`) used by the
`_rvv.c` kernels; under GCC 13 the build still completes and produces a
library, but the affected routines fall back to scalar code paths.
Functional tests will pass on the resulting library; only
disassembly-level verification detects the regression.
For a correct `RISCV64_ZVL128B` build on OpenBLAS 0.3.33,
```bash
riscv64-linux-gnu-objdump -d libopenblas*.a | \
grep -c 'vle64\|vfmacc\|vsetvli\|vlse64\|vfmul\|vfadd\|vfredosum'
```
returns approximately 12,000-14,000 (GCC 14: ~12,691; GCC 15: ~14,355).
### FreeBSD
You will need to install the following tools from the FreeBSD ports tree:
+2 -2
View File
@@ -107,9 +107,9 @@ OpenBLAS can be used as a shared or a static library.
### Link a shared library
The shared library is normally called `libopenblas.so`, but not that the name
The shared library is normally called `libopenblas.so`, but note that the name
may be different as a result of build flags used or naming choices by a distro
packager (see [distributing.md] for details). To link a shared library named
packager (see [distributing.md](distributing.md) for details). To link a shared library named
`libopenblas.so`, the flag `-lopenblas` is needed. To find the OpenBLAS headers,
a `-I/path/to/includedir` is needed. And unless the library is installed in a
directory that the linker searches by default, also `-L` and `-Wl,-rpath` flags
+1 -1
View File
@@ -67,7 +67,7 @@ GenerateCombinationObjects("syr2k_kernel.c" "LOWER" "U" "" 2)
if (USE_THREAD)
# N.B. these do NOT have a float type (e.g. DOUBLE) defined!
GenerateNamedObjects("gemm_thread_m.c;gemm_thread_n.c;gemm_thread_mn.c;gemm_thread_variable.c;syrk_thread.c" "" "" 0 "" "" 1)
GenerateNamedObjects("gemm_thread_m.c;gemm_thread_n.c;gemm_thread_mn.c;gemm_thread_variable.c;syrk_thread.c;level3_thread_lock.c" "" "" 0 "" "" 1)
if (NOT USE_SIMPLE_THREADED_LEVEL3)
GenerateCombinationObjects("syrk_k.c" "LOWER;TRANS" "U;N" "THREADED_LEVEL3" 2 "syrk_thread")
+7 -1
View File
@@ -237,7 +237,7 @@ XBLASOBJS += \
endif
ifdef SMP
COMMONOBJS += gemm_thread_m.$(SUFFIX) gemm_thread_n.$(SUFFIX) gemm_thread_mn.$(SUFFIX) gemm_thread_variable.$(SUFFIX)
COMMONOBJS += gemm_thread_m.$(SUFFIX) gemm_thread_n.$(SUFFIX) gemm_thread_mn.$(SUFFIX) gemm_thread_variable.$(SUFFIX) level3_thread_lock.$(SUFFIX)
COMMONOBJS += syrk_thread.$(SUFFIX)
ifneq ($(USE_SIMPLE_THREADED_LEVEL3), 1)
@@ -609,6 +609,9 @@ gemm_thread_mn.$(SUFFIX) : gemm_thread_mn.c ../../common.h
gemm_thread_variable.$(SUFFIX) : gemm_thread_variable.c ../../common.h
$(CC) -c $(CFLAGS) $< -o $(@F)
level3_thread_lock.$(SUFFIX) : level3_thread_lock.c ../../common.h
$(CC) -c $(CFLAGS) $< -o $(@F)
beta_thread.$(SUFFIX) : beta_thread.c ../../common.h
$(CC) -c $(CFLAGS) $< -o $(@F)
@@ -3037,6 +3040,9 @@ gemm_thread_mn.$(PSUFFIX) : gemm_thread_mn.c ../../common.h
gemm_thread_variable.$(PSUFFIX) : gemm_thread_variable.c ../../common.h
$(CC) -c $(PFLAGS) $< -o $(@F)
level3_thread_lock.$(PSUFFIX) : level3_thread_lock.c ../../common.h
$(CC) -c $(PFLAGS) $< -o $(@F)
beta_thread.$(PSUFFIX) : beta_thread.c ../../common.h
$(CC) -c $(PFLAGS) $< -o $(@F)
+2 -23
View File
@@ -844,15 +844,6 @@ static int inner_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
static int gemm_driver(blas_arg_t *args, BLASLONG *range_m, BLASLONG
*range_n, FLOAT *sa, FLOAT *sb, BLASLONG mypos){
#ifndef USE_OPENMP
#ifndef OS_WINDOWS
static pthread_mutex_t level3_lock = PTHREAD_MUTEX_INITIALIZER;
#else
CRITICAL_SECTION level3_lock;
InitializeCriticalSection((PCRITICAL_SECTION)&level3_lock);
#endif
#endif
blas_arg_t newarg;
blas_queue_t queue[MAX_CPU_NUMBER];
@@ -882,13 +873,7 @@ InitializeCriticalSection((PCRITICAL_SECTION)&level3_lock);
mode = BLAS_SINGLE | BLAS_REAL | BLAS_NODE;
#endif
#ifndef USE_OPENMP
#ifndef OS_WINDOWS
pthread_mutex_lock(&level3_lock);
#else
EnterCriticalSection((PCRITICAL_SECTION)&level3_lock);
#endif
#endif
blas_level3_thread_enter();
newarg.m = args -> m;
newarg.n = args -> n;
@@ -994,13 +979,7 @@ EnterCriticalSection((PCRITICAL_SECTION)&level3_lock);
free(job);
#endif
#ifndef USE_OPENMP
#ifndef OS_WINDOWS
pthread_mutex_unlock(&level3_lock);
#else
LeaveCriticalSection((PCRITICAL_SECTION)&level3_lock);
#endif
#endif
blas_level3_thread_leave();
return 0;
}
+2 -69
View File
@@ -506,33 +506,6 @@ static int inner_thread(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n,
int CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, FLOAT *sb, BLASLONG mypos){
#ifdef USE_OPENMP
static omp_lock_t level3_lock, critical_section_lock;
static volatile BLASULONG init_lock = 0, omp_lock_initialized = 0,
parallel_section_left = MAX_PARALLEL_NUMBER;
// Lock initialization; Todo : Maybe this part can be moved to blas_init() in blas_server_omp.c
while(omp_lock_initialized == 0)
{
blas_lock(&init_lock);
{
if(omp_lock_initialized == 0)
{
omp_init_lock(&level3_lock);
omp_init_lock(&critical_section_lock);
omp_lock_initialized = 1;
WMB;
}
blas_unlock(&init_lock);
}
}
#elif defined(OS_WINDOWS)
CRITICAL_SECTION level3_lock;
InitializeCriticalSection((PCRITICAL_SECTION)&level3_lock);
#else
static pthread_mutex_t level3_lock = PTHREAD_MUTEX_INITIALIZER;
#endif
blas_arg_t newarg;
#ifndef USE_ALLOC_HEAP
@@ -589,29 +562,7 @@ int CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, FLO
#endif
#endif
#ifdef USE_OPENMP
omp_set_lock(&level3_lock);
omp_set_lock(&critical_section_lock);
parallel_section_left--;
/*
How OpenMP locks works with NUM_PARALLEL
1) parallel_section_left = Number of available concurrent executions of OpenBLAS - Number of currently executing OpenBLAS executions
2) level3_lock is acting like a master lock or barrier which stops OpenBLAS calls when all the parallel_section are currently busy executing other OpenBLAS calls
3) critical_section_lock is used for updating variables shared between threads executing OpenBLAS calls concurrently and for unlocking of master lock whenever required
4) Unlock master lock only when we have not already exhausted all the parallel_sections and allow another thread with a OpenBLAS call to enter
*/
if(parallel_section_left != 0)
omp_unset_lock(&level3_lock);
omp_unset_lock(&critical_section_lock);
#elif defined(OS_WINDOWS)
EnterCriticalSection((PCRITICAL_SECTION)&level3_lock);
#else
pthread_mutex_lock(&level3_lock);
#endif
blas_level3_thread_enter();
newarg.m = args -> m;
newarg.n = args -> n;
@@ -759,25 +710,7 @@ int CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, FLO
free(job);
#endif
#ifdef USE_OPENMP
omp_set_lock(&critical_section_lock);
parallel_section_left++;
/*
Unlock master lock only when all the parallel_sections are already exhausted and one of the thread has completed its OpenBLAS call
otherwise just increment the parallel_section_left
The master lock is only locked when we have exhausted all the parallel_sections, So only unlock it then and otherwise just increment the count
*/
if(parallel_section_left == 1)
omp_unset_lock(&level3_lock);
omp_unset_lock(&critical_section_lock);
#elif defined(OS_WINDOWS)
LeaveCriticalSection((PCRITICAL_SECTION)&level3_lock);
#else
pthread_mutex_unlock(&level3_lock);
#endif
blas_level3_thread_leave();
return 0;
}
+7 -69
View File
@@ -48,6 +48,7 @@
#endif
#ifdef DYNAMIC_ARCH
#undef GEMM_PREFERRED_SIZE
#define GEMM_PREFERRED_SIZE gotoblas->preferred_size
#endif
#ifndef GEMM_PREFERRED_SIZE
@@ -97,7 +98,11 @@
#endif
typedef struct {
#ifdef HAVE_C11
_Atomic
#else
volatile
#endif
BLASLONG working[MAX_CPU_NUMBER][CACHE_LINE_SIZE * DIVIDE_RATE_MAX];
} job_t;
@@ -568,33 +573,6 @@ static int gemm_driver(blas_arg_t *args, BLASLONG *range_m, BLASLONG
*range_n, IFLOAT *sa, IFLOAT *sb,
BLASLONG nthreads_m, BLASLONG nthreads_n) {
#ifdef USE_OPENMP
static omp_lock_t level3_lock, critical_section_lock;
static volatile BLASULONG init_lock = 0, omp_lock_initialized = 0,
parallel_section_left = MAX_PARALLEL_NUMBER;
// Lock initialization; Todo : Maybe this part can be moved to blas_init() in blas_server_omp.c
while(omp_lock_initialized == 0)
{
blas_lock(&init_lock);
{
if(omp_lock_initialized == 0)
{
omp_init_lock(&level3_lock);
omp_init_lock(&critical_section_lock);
omp_lock_initialized = 1;
WMB;
}
blas_unlock(&init_lock);
}
}
#elif defined(OS_WINDOWS)
CRITICAL_SECTION level3_lock;
InitializeCriticalSection((PCRITICAL_SECTION)&level3_lock);
#else
static pthread_mutex_t level3_lock = PTHREAD_MUTEX_INITIALIZER;
#endif
blas_arg_t newarg;
#ifndef USE_ALLOC_HEAP
@@ -640,29 +618,7 @@ static int gemm_driver(blas_arg_t *args, BLASLONG *range_m, BLASLONG
#endif
#endif
#ifdef USE_OPENMP
omp_set_lock(&level3_lock);
omp_set_lock(&critical_section_lock);
parallel_section_left--;
/*
How OpenMP locks works with NUM_PARALLEL
1) parallel_section_left = Number of available concurrent executions of OpenBLAS - Number of currently executing OpenBLAS executions
2) level3_lock is acting like a master lock or barrier which stops OpenBLAS calls when all the parallel_section are currently busy executing other OpenBLAS calls
3) critical_section_lock is used for updating variables shared between threads executing OpenBLAS calls concurrently and for unlocking of master lock whenever required
4) Unlock master lock only when we have not already exhausted all the parallel_sections and allow another thread with a OpenBLAS call to enter
*/
if(parallel_section_left != 0)
omp_unset_lock(&level3_lock);
omp_unset_lock(&critical_section_lock);
#elif defined(OS_WINDOWS)
EnterCriticalSection((PCRITICAL_SECTION)&level3_lock);
#else
pthread_mutex_lock(&level3_lock);
#endif
blas_level3_thread_enter();
#ifdef USE_ALLOC_HEAP
/* Dynamically allocate workspace */
@@ -796,25 +752,7 @@ static int gemm_driver(blas_arg_t *args, BLASLONG *range_m, BLASLONG
free(job);
#endif
#ifdef USE_OPENMP
omp_set_lock(&critical_section_lock);
parallel_section_left++;
/*
Unlock master lock only when all the parallel_sections are already exhausted and one of the thread has completed its OpenBLAS call
otherwise just increment the parallel_section_left
The master lock is only locked when we have exhausted all the parallel_sections, So only unlock it then and otherwise just increment the count
*/
if(parallel_section_left == 1)
omp_unset_lock(&level3_lock);
omp_unset_lock(&critical_section_lock);
#elif defined(OS_WINDOWS)
LeaveCriticalSection((PCRITICAL_SECTION)&level3_lock);
#else
pthread_mutex_unlock(&level3_lock);
#endif
blas_level3_thread_leave();
return 0;
}
+124
View File
@@ -0,0 +1,124 @@
/*********************************************************************/
/* Copyright 2026 The OpenBLAS Project. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
/* without modification, are permitted provided that the following */
/* conditions are met: */
/* */
/* 1. Redistributions of source code must retain the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer. */
/* */
/* 2. Redistributions in binary form must reproduce the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer in the documentation and/or other materials */
/* provided with the distribution. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE OPENBLAS PROJECT ``AS IS'' */
/* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND */
/* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT */
/* SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY */
/* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR */
/* CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF */
/* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH */
/* DAMAGE. */
/* */
/*********************************************************************/
#include "common.h"
#ifdef USE_OPENMP
static omp_lock_t level3_lock, critical_section_lock;
static volatile BLASULONG init_lock = 0;
static _Atomic BLASULONG omp_lock_initialized = 0;
static volatile BLASULONG parallel_section_left = MAX_PARALLEL_NUMBER;
static void blas_level3_thread_lock_init(void)
{
while (omp_lock_initialized == 0) {
blas_lock(&init_lock);
if (omp_lock_initialized == 0) {
omp_init_lock(&level3_lock);
omp_init_lock(&critical_section_lock);
WMB;
omp_lock_initialized = 1;
}
blas_unlock(&init_lock);
}
}
void blas_level3_thread_enter(void)
{
blas_level3_thread_lock_init();
omp_set_lock(&level3_lock);
omp_set_lock(&critical_section_lock);
parallel_section_left--;
if (parallel_section_left != 0)
omp_unset_lock(&level3_lock);
omp_unset_lock(&critical_section_lock);
}
void blas_level3_thread_leave(void)
{
omp_set_lock(&critical_section_lock);
parallel_section_left++;
if (parallel_section_left == 1)
omp_unset_lock(&level3_lock);
omp_unset_lock(&critical_section_lock);
}
#elif defined(OS_WINDOWS)
static CRITICAL_SECTION level3_lock;
static volatile BLASULONG init_lock = 0;
static volatile BLASULONG level3_lock_initialized = 0;
static void blas_level3_thread_lock_init(void)
{
while (level3_lock_initialized == 0) {
blas_lock(&init_lock);
if (level3_lock_initialized == 0) {
InitializeCriticalSection((PCRITICAL_SECTION)&level3_lock);
WMB;
level3_lock_initialized = 1;
}
blas_unlock(&init_lock);
}
}
void blas_level3_thread_enter(void)
{
blas_level3_thread_lock_init();
EnterCriticalSection((PCRITICAL_SECTION)&level3_lock);
}
void blas_level3_thread_leave(void)
{
LeaveCriticalSection((PCRITICAL_SECTION)&level3_lock);
}
#else
static pthread_mutex_t level3_lock = PTHREAD_MUTEX_INITIALIZER;
void blas_level3_thread_enter(void)
{
pthread_mutex_lock(&level3_lock);
}
void blas_level3_thread_leave(void)
{
pthread_mutex_unlock(&level3_lock);
}
#endif
+2 -2
View File
@@ -127,10 +127,10 @@ endif
xerbla.$(SUFFIX) : xerbla.c
$(CC) $(CFLAGS) -c $< -o $(@F)
dynamic.$(SUFFIX) : dynamic.c
dynamic%$(SUFFIX) : dynamic%c
$(CC) $(CFLAGS) -c $< -o $(@F)
dynamic.$(PSUFFIX) : dynamic.c
dynamic%$(PSUFFIX) : dynamic%c
$(CC) $(PFLAGS) -c $< -o $(@F)
parameter.$(SUFFIX) : parameter.c ../../param.h
+8 -2
View File
@@ -631,7 +631,13 @@ int blas_thread_init(void){
exec_blas ... returns after jobs are finished.
*/
#if defined(USE_PTHREAD_LOCK)
static pthread_mutex_t exec_queue_lock = PTHREAD_MUTEX_INITIALIZER;
#elif defined(USE_PTHREAD_SPINLOCK)
static pthread_spinlock_t exec_queue_lock = 0;
#else
static BLASULONG exec_queue_lock = 0;
#endif
int exec_blas_async(BLASLONG pos, blas_queue_t *queue){
@@ -652,7 +658,7 @@ int exec_blas_async(BLASLONG pos, blas_queue_t *queue){
fprintf(STDERR, "Exec_blas_async is called. Position = %d\n", pos);
#endif
blas_lock(&exec_queue_lock);
LOCK_COMMAND(&exec_queue_lock);
while (queue) {
queue -> position = pos;
@@ -717,7 +723,7 @@ int exec_blas_async(BLASLONG pos, blas_queue_t *queue){
}
blas_unlock(&exec_queue_lock);
UNLOCK_COMMAND(&exec_queue_lock);
#ifdef SMP_DEBUG
fprintf(STDERR, "Done(Number of threads = %2ld).\n", exec_count);
+2 -6
View File
@@ -73,12 +73,8 @@ int blas_omp_threads_local = 1;
extern int openblas_omp_adaptive_env(void);
static void * blas_thread_buffer[MAX_PARALLEL_NUMBER][MAX_CPU_NUMBER];
#ifdef HAVE_C11
static atomic_bool blas_buffer_inuse[MAX_PARALLEL_NUMBER];
#else
static _Bool blas_buffer_inuse[MAX_PARALLEL_NUMBER];
#endif
static _Atomic(void *) blas_thread_buffer[MAX_PARALLEL_NUMBER][MAX_CPU_NUMBER];
static _Atomic _Bool blas_buffer_inuse[MAX_PARALLEL_NUMBER];
static void adjust_thread_buffers(void) {
+17 -1
View File
@@ -829,7 +829,17 @@ static gotoblas_t *get_coretype(void){
}
if (family == 0xf){
if ((exfamily == 0) || (exfamily == 2)) {
if (ecx & (1 << 0)) return &gotoblas_OPTERON_SSE3;
if (exmodel == 6 && model == 11) { /*QEMU virtual cpu*/
if (support_avx512_bf16())
return &gotoblas_COOPERLAKE;
if (support_avx512())
return &gotoblas_SKYLAKEX;
if (support_avx2())
return &gotoblas_ZEN;
else
return &gotoblas_BARCELONA;
}
if (ecx & (1 << 0)) return &gotoblas_OPTERON_SSE3;
else return &gotoblas_OPTERON;
} else if (exfamily == 5 || exfamily == 7) {
return &gotoblas_BOBCAT;
@@ -951,9 +961,15 @@ static gotoblas_t *get_coretype(void){
else
return &gotoblas_DUNNINGTON;
default:
if (support_avx2())
return &gotoblas_ZEN;
else
return &gotoblas_NEHALEM;
}
default:
if (support_avx2())
return &gotoblas_ZEN;
else
return &gotoblas_NEHALEM;
}
}
+38 -6
View File
@@ -1,6 +1,6 @@
/*********************************************************************/
/* Copyright 2009, 2010 The University of Texas at Austin. */
/* Copyright 2023-2024 The OpenBLAS Project */
/* Copyright 2023-2024, 2026 The OpenBLAS Project */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
@@ -38,7 +38,13 @@
/*********************************************************************/
#include "common.h"
#ifndef _MSC_VER
#include <strings.h>
#else
#define strncasecmp _strnicmp
#endif
#if (defined OS_LINUX || defined OS_ANDROID)
#include <asm/hwcap.h>
#include <sys/auxv.h>
@@ -151,19 +157,39 @@ extern gotoblas_t gotoblas_A64FX;
#else
#define gotoblas_A64FX gotoblas_ARMV8
#endif
#else //not a user-specified dynamic_list
#ifdef OS_DARWIN
#define gotoblas_CORTEXA53 gotoblas_ARMV8
#else
extern gotoblas_t gotoblas_CORTEXA53;
#endif
#define gotoblas_CORTEXA55 gotoblas_CORTEXA53
#ifdef OS_DARWIN
#define gotoblas_CORTEXA57 gotoblas_ARMV8
#else
extern gotoblas_t gotoblas_CORTEXA57;
#endif
#define gotoblas_CORTEXA72 gotoblas_CORTEXA57
#define gotoblas_CORTEXA73 gotoblas_CORTEXA57
#define gotoblas_FALKOR gotoblas_CORTEXA57
#ifdef OS_DARWIN
#define gotoblas_THUNDERX gotoblas_ARMV8
#define gotoblas_THUNDERX2T99 gotoblas_ARMV8
#define gotoblas_THUNDERX3T110 gotoblas_ARMV8
#define gotoblas_TSV110 gotoblas_ARMV8
#define gotoblas_EMAG8180 gotoblas_ARMV8
#else
extern gotoblas_t gotoblas_THUNDERX;
extern gotoblas_t gotoblas_THUNDERX2T99;
extern gotoblas_t gotoblas_THUNDERX3T110;
extern gotoblas_t gotoblas_TSV110;
extern gotoblas_t gotoblas_EMAG8180;
#endif
extern gotoblas_t gotoblas_NEOVERSEN1;
#define gotoblas_VORTEX gotoblas_NEOVERSEN1
#ifndef OS_DARWIN
#ifndef NO_SVE
extern gotoblas_t gotoblas_NEOVERSEV1;
extern gotoblas_t gotoblas_NEOVERSEN2;
@@ -175,6 +201,12 @@ extern gotoblas_t gotoblas_A64FX;
#define gotoblas_ARMV8SVE gotoblas_ARMV8
#define gotoblas_A64FX gotoblas_ARMV8
#endif
#else
#define gotoblas_NEOVERSEV1 gotoblas_ARMV8
#define gotoblas_NEOVERSEN2 gotoblas_ARMV8
#define gotoblas_ARMV8SVE gotoblas_ARMV8
#define gotoblas_A64FX gotoblas_ARMV8
#endif
#ifndef NO_SME
extern gotoblas_t gotoblas_ARMV9SME;
#if defined (__clang__) && defined(OS_DARWIN)
@@ -191,7 +223,6 @@ extern gotoblas_t gotoblas_VORTEXM4;
#define gotoblas_VORTEXM4 gotoblas_NEOVERSEN1
#endif
extern gotoblas_t gotoblas_THUNDERX3T110;
#endif
#define gotoblas_NEOVERSEV2 gotoblas_NEOVERSEN2
@@ -425,10 +456,11 @@ static gotoblas_t *get_coretype(void) {
return &gotoblas_NEOVERSEN1;
}else
return &gotoblas_NEOVERSEV1;
case 0xd4f:
case 0xd83:
case 0xd85:
case 0xd87:
case 0xd4f: // Neoverse V2
case 0xd83: // Neoverse V3AE
case 0xd84: // Neoverse V3
case 0xd85: // Cortex X925
case 0xd87: // Cortex A725
if (!(getauxval(AT_HWCAP) & HWCAP_SVE)) {
openblas_warning(FALLBACK_VERBOSE, NEOVERSEN1_FALLBACK);
return &gotoblas_NEOVERSEN1;
+1
View File
@@ -152,6 +152,7 @@ char* gotoblas_corename(void) {
static gotoblas_t* get_coretype(void) {
uint64_t vector_mask;
unsigned vlenb = 0;
char coremsg[128];
#if !defined(OS_LINUX)
return NULL;
+6
View File
@@ -72,6 +72,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "common.h"
#if (MAX_CPU_NUMBER > 256)
#ifndef BIGNUMA
#define BIGNUMA
#endif
#endif
#if defined(OS_LINUX) && defined(SMP)
#define _GNU_SOURCE
+89 -89
View File
@@ -416,7 +416,7 @@ void set_stack_limit(int limitMB){
OpenBLAS uses the numbers of CPU cores in multithreading.
It can be set by openblas_set_num_threads(int num_threads);
*/
int blas_cpu_number = 0;
_Atomic int blas_cpu_number = 0;
/*
The numbers of threads in the thread pool.
This value is equal or large than blas_cpu_number. This means some threads are sleep.
@@ -1320,11 +1320,11 @@ UNLOCK_COMMAND(&alloc_lock);
#ifdef USE_OPENMP
printf("with a larger NUM_THREADS value or set the environment variable OMP_NUM_THREADS to\n");
#else
printf("with a larger NUM_THREADS value or set the environment variable OPENBLAS_NUM_THREADS to\n");
printf("with a larger NUM_THREADS value or set the environment variable OPENBLAS_NUM_THREADS to\n");
#endif
printf("a sufficiently small number. This error typically occurs when the software that relies on\n");
printf("OpenBLAS calls BLAS functions from many threads in parallel, or when your computer has more\n");
printf("cpu cores than what OpenBLAS was configured to handle.\n");
printf("cpu cores than what OpenBLAS was configured to handle.\n");
return NULL;
}
@@ -1811,7 +1811,7 @@ int get_num_procs(void) {
static int nums = 0;
int ret;
#if defined(__GLIBC_PREREQ)
cpu_set_t cpuset,*cpusetp;
size_t size;
@@ -1841,7 +1841,7 @@ int get_num_procs(void) {
#if !defined(OS_LINUX)
return (nums > 0 ? nums :2);
#endif
#if !defined(__GLIBC_PREREQ)
return (nums > 0 ? nums :2);
#else
@@ -1993,7 +1993,7 @@ void set_stack_limit(int limitMB){
OpenBLAS uses the numbers of CPU cores in multithreading.
It can be set by openblas_set_num_threads(int num_threads);
*/
int blas_cpu_number = 0;
_Atomic int blas_cpu_number = 0;
/*
The numbers of threads in the thread pool.
This value is equal or large than blas_cpu_number. This means some threads are sleep.
@@ -2103,7 +2103,7 @@ int hugetlb_allocated = 0;
static struct release_t release_info[NUM_BUFFERS];
static struct release_t *new_release_info;
static int release_pos = 0;
static _Atomic int release_pos = 0;
#if defined(OS_LINUX) && !defined(NO_WARMUP)
static int hot_alloc = 0;
@@ -2153,14 +2153,14 @@ static void *alloc_mmap(void *address){
#if (defined(SMP) || defined(USE_LOCKING)) && !defined(USE_OPENMP)
LOCK_COMMAND(&alloc_lock);
#endif
if (likely(release_pos < NUM_BUFFERS)) {
release_info[release_pos].address = map_address;
release_info[release_pos].func = alloc_mmap_free;
int rpos = release_pos++;
if (likely(rpos < NUM_BUFFERS)) {
release_info[rpos].address = map_address;
release_info[rpos].func = alloc_mmap_free;
} else {
new_release_info[release_pos-NUM_BUFFERS].address = map_address;
new_release_info[release_pos-NUM_BUFFERS].func = alloc_mmap_free;
new_release_info[rpos-NUM_BUFFERS].address = map_address;
new_release_info[rpos-NUM_BUFFERS].func = alloc_mmap_free;
}
release_pos ++;
#if (defined(SMP) || defined(USE_LOCKING)) && !defined(USE_OPENMP)
UNLOCK_COMMAND(&alloc_lock);
#endif
@@ -2264,7 +2264,7 @@ static void *alloc_mmap(void *address){
#endif
#endif
#ifdef BUILD_DOUBLE
#ifdef BUILD_DOUBLE
allocsize = DGEMM_P * DGEMM_Q * sizeof(double);
#elif defined(BUILD_COMPLEX16)
allocsize = ZGEMM_P * ZGEMM_Q * sizeof(double);
@@ -2322,14 +2322,14 @@ static void *alloc_mmap(void *address){
#if (defined(SMP) || defined(USE_LOCKING)) && !defined(USE_OPENMP)
LOCK_COMMAND(&alloc_lock);
#endif
if (likely(release_pos < NUM_BUFFERS)) {
release_info[release_pos].address = map_address;
release_info[release_pos].func = alloc_mmap_free;
int rpos = release_pos++;
if (likely(rpos < NUM_BUFFERS)) {
release_info[rpos].address = map_address;
release_info[rpos].func = alloc_mmap_free;
} else {
new_release_info[release_pos-NUM_BUFFERS].address = map_address;
new_release_info[release_pos-NUM_BUFFERS].func = alloc_mmap_free;
new_release_info[rpos-NUM_BUFFERS].address = map_address;
new_release_info[rpos-NUM_BUFFERS].func = alloc_mmap_free;
}
release_pos ++;
#if (defined(SMP) || defined(USE_LOCKING)) && !defined(USE_OPENMP)
UNLOCK_COMMAND(&alloc_lock);
#endif
@@ -2360,14 +2360,14 @@ static void *alloc_malloc(void *address){
if (map_address == (void *)NULL) map_address = (void *)-1;
if (map_address != (void *)-1) {
if (likely(release_pos < NUM_BUFFERS)) {
release_info[release_pos].address = map_address;
release_info[release_pos].func = alloc_malloc_free;
int rpos = release_pos++;
if (likely(rpos < NUM_BUFFERS)) {
release_info[rpos].address = map_address;
release_info[rpos].func = alloc_malloc_free;
} else {
new_release_info[release_pos-NUM_BUFFERS].address = map_address;
new_release_info[release_pos-NUM_BUFFERS].func = alloc_malloc_free;
new_release_info[rpos-NUM_BUFFERS].address = map_address;
new_release_info[rpos-NUM_BUFFERS].func = alloc_malloc_free;
}
release_pos ++;
}
return map_address;
@@ -2399,14 +2399,14 @@ static void *alloc_qalloc(void *address){
if (map_address == (void *)NULL) map_address = (void *)-1;
if (map_address != (void *)-1) {
if (likely(release_pos < NUM_BUFFERS)) {
release_info[release_pos].address = map_address;
release_info[release_pos].func = alloc_qalloc_free;
int rpos = release_pos++;
if (likely(rpos < NUM_BUFFERS)) {
release_info[rpos].address = map_address;
release_info[rpos].func = alloc_qalloc_free;
} else {
new_release_info[release_pos-NUM_BUFFERS].address = map_address;
new_release_info[release_pos-NUM_BUFFERS].func = alloc_qalloc_free;
new_release_info[rpos-NUM_BUFFERS].address = map_address;
new_release_info[rpos-NUM_BUFFERS].func = alloc_qalloc_free;
}
release_pos ++;
}
return (void *)(((BLASULONG)map_address + FIXED_PAGESIZE - 1) & ~(FIXED_PAGESIZE - 1));
@@ -2433,14 +2433,14 @@ static void *alloc_windows(void *address){
if (map_address == (void *)NULL) map_address = (void *)-1;
if (map_address != (void *)-1) {
if (likely(release_pos < NUM_BUFFERS)) {
release_info[release_pos].address = map_address;
release_info[release_pos].func = alloc_windows_free;
int rpos = release_pos++;
if (likely(rpos < NUM_BUFFERS)) {
release_info[rpos].address = map_address;
release_info[rpos].func = alloc_windows_free;
} else {
new_release_info[release_pos-NUM_BUFFERS].address = map_address;
new_release_info[release_pos-NUM_BUFFERS].func = alloc_windows_free;
new_release_info[rpos-NUM_BUFFERS].address = map_address;
new_release_info[rpos-NUM_BUFFERS].func = alloc_windows_free;
}
release_pos ++;
}
return map_address;
@@ -2482,16 +2482,16 @@ static void *alloc_devicedirver(void *address){
fd, 0);
if (map_address != (void *)-1) {
if (likely(release_pos < NUM_BUFFERS)) {
release_info[release_pos].address = map_address;
release_info[release_pos].attr = fd;
release_info[release_pos].func = alloc_devicedirver_free;
int rpos = release_pos++;
if (likely(rpos < NUM_BUFFERS)) {
release_info[rpos].address = map_address;
release_info[rpos].attr = fd;
release_info[rpos].func = alloc_devicedirver_free;
} else {
new_release_info[release_pos-NUM_BUFFERS].address = map_address;
new_release_info[release_pos-NUM_BUFFERS].attr = fd;
new_release_info[release_pos-NUM_BUFFERS].func = alloc_devicedirver_free;
new_release_info[rpos-NUM_BUFFERS].address = map_address;
new_release_info[rpos-NUM_BUFFERS].attr = fd;
new_release_info[rpos-NUM_BUFFERS].func = alloc_devicedirver_free;
}
release_pos ++;
}
return map_address;
@@ -2526,16 +2526,16 @@ static void *alloc_shm(void *address){
shmctl(shmid, IPC_RMID, 0);
if (likely(release_pos < NUM_BUFFERS)) {
release_info[release_pos].address = map_address;
release_info[release_pos].attr = shmid;
release_info[release_pos].func = alloc_shm_free;
int rpos = release_pos++;
if (likely(rpos < NUM_BUFFERS)) {
release_info[rpos].address = map_address;
release_info[rpos].attr = shmid;
release_info[rpos].func = alloc_shm_free;
} else {
new_release_info[release_pos-NUM_BUFFERS].address = map_address;
new_release_info[release_pos-NUM_BUFFERS].attr = shmid;
new_release_info[release_pos-NUM_BUFFERS].func = alloc_shm_free;
new_release_info[rpos-NUM_BUFFERS].address = map_address;
new_release_info[rpos-NUM_BUFFERS].attr = shmid;
new_release_info[rpos-NUM_BUFFERS].func = alloc_shm_free;
}
release_pos ++;
}
return map_address;
@@ -2643,14 +2643,14 @@ fprintf(stderr,"alloc_hugetlb got called\n");
#endif
if (map_address != (void *)-1){
if (likely(release_pos < NUM_BUFFERS)) {
release_info[release_pos].address = map_address;
release_info[release_pos].func = alloc_hugetlb_free;
int rpos = release_pos++;
if (likely(rpos < NUM_BUFFERS)) {
release_info[rpos].address = map_address;
release_info[rpos].func = alloc_hugetlb_free;
} else {
new_release_info[release_pos-NUM_BUFFERS].address = map_address;
new_release_info[release_pos-NUM_BUFFERS].func = alloc_hugetlb_free;
new_release_info[rpos-NUM_BUFFERS].address = map_address;
new_release_info[rpos-NUM_BUFFERS].func = alloc_hugetlb_free;
}
release_pos ++;
}
return map_address;
@@ -2695,16 +2695,16 @@ static void *alloc_hugetlbfile(void *address){
fd, 0);
if (map_address != (void *)-1) {
if (likely(release_pos < NUM_BUFFERS)) {
release_info[release_pos].address = map_address;
release_info[release_pos].attr = fd;
release_info[release_pos].func = alloc_hugetlbfile_free;
int rpos = release_pos++;
if (likely(rpos < NUM_BUFFERS)) {
release_info[rpos].address = map_address;
release_info[rpos].attr = fd;
release_info[rpos].func = alloc_hugetlbfile_free;
} else {
new_release_info[release_pos-NUM_BUFFERS].address = map_address;
new_release_info[release_pos-NUM_BUFFERS].attr = fd;
new_release_info[release_pos-NUM_BUFFERS].func = alloc_hugetlbfile_free;
new_release_info[rpos-NUM_BUFFERS].address = map_address;
new_release_info[rpos-NUM_BUFFERS].attr = fd;
new_release_info[rpos-NUM_BUFFERS].func = alloc_hugetlbfile_free;
}
release_pos ++;
}
return map_address;
@@ -2719,12 +2719,12 @@ static BLASULONG base_address = BASE_ADDRESS;
#endif
static volatile struct {
BLASULONG lock;
void *addr;
_Atomic BLASULONG lock;
void * _Atomic addr;
#if defined(WHEREAMI) && !defined(USE_OPENMP)
int pos;
#endif
int used;
_Atomic int used;
#ifndef __64BIT__
char dummy[48];
#else
@@ -2733,14 +2733,14 @@ static volatile struct {
} memory[NUM_BUFFERS];
struct newmemstruct
struct newmemstruct
{
BLASULONG lock;
void *addr;
_Atomic BLASULONG lock;
void * _Atomic addr;
#if defined(WHEREAMI) && !defined(USE_OPENMP)
int pos;
#endif
int used;
_Atomic int used;
#ifndef __64BIT__
char dummy[48];
#else
@@ -2761,7 +2761,7 @@ static int memory_overflowed = 0;
void *blas_memory_alloc(int procpos){
int i;
int position;
#if defined(WHEREAMI) && !defined(USE_OPENMP)
int mypos = 0;
@@ -2852,13 +2852,13 @@ void *blas_memory_alloc(int procpos){
#if defined(SMP) && !defined(USE_OPENMP)
LOCK_COMMAND(&alloc_lock);
#else
blas_lock(&memory[position].lock);
blas_lock((BLASULONG *)&memory[position].lock);
#endif
if (!memory[position].used) goto allocation;
#if defined(SMP) && !defined(USE_OPENMP)
UNLOCK_COMMAND(&alloc_lock);
#else
blas_unlock(&memory[position].lock);
blas_unlock((BLASULONG *)&memory[position].lock);
#endif
}
@@ -2878,12 +2878,12 @@ void *blas_memory_alloc(int procpos){
RMB;
#if defined(USE_OPENMP)
if (!memory[position].used) {
blas_lock(&memory[position].lock);
blas_lock((BLASULONG *)&memory[position].lock);
#endif
if (!memory[position].used) goto allocation;
#if defined(USE_OPENMP)
blas_unlock(&memory[position].lock);
blas_unlock((BLASULONG *)&memory[position].lock);
}
#endif
position ++;
@@ -2896,12 +2896,12 @@ void *blas_memory_alloc(int procpos){
RMB;
#if defined(USE_OPENMP)
if (!newmemory[position-NUM_BUFFERS].used) {
blas_lock(&newmemory[position-NUM_BUFFERS].lock);
blas_lock((BLASULONG *)&newmemory[position-NUM_BUFFERS].lock);
#endif
if (!newmemory[position-NUM_BUFFERS].used) goto allocation2;
#if defined(USE_OPENMP)
blas_unlock(&newmemory[position-NUM_BUFFERS].lock);
blas_unlock((BLASULONG *)&newmemory[position-NUM_BUFFERS].lock);
}
#endif
position ++;
@@ -2923,7 +2923,7 @@ void *blas_memory_alloc(int procpos){
#if (defined(SMP) || defined(USE_LOCKING)) && !defined(USE_OPENMP)
UNLOCK_COMMAND(&alloc_lock);
#else
blas_unlock(&memory[position].lock);
blas_unlock((BLASULONG *)&memory[position].lock);
#endif
if (!memory[position].addr) {
int failcount = 0;
@@ -3043,7 +3043,7 @@ void *blas_memory_alloc(int procpos){
#endif
if (memory_overflowed) goto terminate;
fprintf(stderr,"OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.\n");
fprintf(stderr,"Note that your application may still crash, if it is calling OpenBLAS from multiple threads in parallel\n");
fprintf(stderr,"Note that your application may still crash, if it is calling OpenBLAS from multiple threads in parallel\n");
fprintf(stderr,"To avoid this warning, please rebuild your copy of OpenBLAS with a larger NUM_THREADS setting\n");
#ifdef USE_OPENMP
fprintf(stderr,"or set the environment variable OMP_NUM_THREADS to %d or lower\n", MAX_CPU_NUMBER);
@@ -3062,13 +3062,13 @@ void *blas_memory_alloc(int procpos){
newmemory[i].used = 0;
newmemory[i].lock = 0;
}
allocation2:
newmemory[position-NUM_BUFFERS].used = 1;
#if (defined(SMP) || defined(USE_LOCKING)) && !defined(USE_OPENMP)
UNLOCK_COMMAND(&alloc_lock);
#else
blas_unlock(&newmemory[position-NUM_BUFFERS].lock);
blas_unlock((BLASULONG *)&newmemory[position-NUM_BUFFERS].lock);
#endif
do {
#ifdef DEBUG
@@ -3154,11 +3154,11 @@ terminate:
#ifdef USE_OPENMP
printf("with a larger NUM_THREADS value or set the environment variable OMP_NUM_THREADS to\n");
#else
printf("with a larger NUM_THREADS value or set the environment variable OPENBLAS_NUM_THREADS to\n");
printf("with a larger NUM_THREADS value or set the environment variable OPENBLAS_NUM_THREADS to\n");
#endif
printf("a sufficiently small number. This error typically occurs when the software that relies on\n");
printf("OpenBLAS calls BLAS functions from many threads in parallel, or when your computer has more\n");
printf("cpu cores than what OpenBLAS was configured to handle.\n");
printf("cpu cores than what OpenBLAS was configured to handle.\n");
return NULL;
}
@@ -3278,7 +3278,7 @@ void blas_shutdown(void){
}
free((void*)newmemory);
newmemory = NULL;
memory_overflowed = 0;
memory_overflowed = 0;
}
UNLOCK_COMMAND(&alloc_lock);
+1 -1
View File
@@ -277,7 +277,7 @@ void set_stack_limit(int limitMB){
OpenBLAS uses the numbers of CPU cores in multithreading.
It can be set by openblas_set_num_threads(int num_threads);
*/
int blas_cpu_number = 0;
_Atomic int blas_cpu_number = 0;
/*
The numbers of threads in the thread pool.
This value is equal or large than blas_cpu_number. This means some threads are sleep.
+2 -2
View File
@@ -80,9 +80,9 @@ int openblas_get_parallel(void);
char* CNAME(void) {
char tmpstr[20];
strcpy(tmp_config_str, openblas_config_str);
strncpy(tmp_config_str, openblas_config_str, 255-40);
#ifdef DYNAMIC_ARCH
strcat(tmp_config_str, gotoblas_corename());
strncat(tmp_config_str, gotoblas_corename(),20);
#endif
if (openblas_get_parallel() == 0)
sprintf(tmpstr, " SINGLE_THREADED");
+23
View File
@@ -790,6 +790,17 @@ int get_L3_size() {
return ((ret & 0xffff) + 1) * pow(2, ((ret >> 16) & 0xff)) * pow(2, ((ret >> 24) & 0x7f)) / 1024 / 1024; // MB
}
int get_cpu_prid() {
int ret = 0, id = 0x0;
__asm__ volatile (
"cpucfg %[ret], %[id]"
: [ret]"=r"(ret)
: [id]"r"(id)
: "memory"
);
return ret;
}
void blas_set_parameter(void){
#if defined(LA464)
int L3_size = get_L3_size();
@@ -868,6 +879,18 @@ void blas_set_parameter(void){
}
}
#endif
#elif defined(LA264)
int prid = get_cpu_prid();
if (prid == 0x0014b020) { //2k3000
zgemm_p = 128;
zgemm_q = 176;
zgemm_r = 360;
} else {
zgemm_p = 64;
zgemm_q = 120;
zgemm_r = 4096;
}
#endif
}
#endif
+2 -2
View File
@@ -562,12 +562,12 @@ if (strcmp(gotoblas_corename(), "armv9sme") == 0
)
// if (support_sme1())
#endif
if (order == CblasRowMajor && m==lda && n ==ldb && k==ldc && beta == 0 && alpha == 1.0 && TransA == CblasNoTrans && TransB == CblasNoTrans&& SGEMM_DIRECT_PERFORMANT(m,n,k)) {
if (order == CblasRowMajor && k==lda && n==ldb && n==ldc && beta == 0 && alpha == 1.0 && TransA == CblasNoTrans && TransB == CblasNoTrans && SGEMM_DIRECT_PERFORMANT(m,n,k)) {
SGEMM_DIRECT(m, n, k, a, lda, b, ldb, c, ldc);
return;
}
else
if (order == CblasRowMajor && m==lda && n==ldb && k==ldc && TransA == CblasNoTrans && TransB == CblasNoTrans&& SGEMM_DIRECT_PERFORMANT(m,n,k)) {
if (order == CblasRowMajor && k==lda && n==ldb && n==ldc && TransA == CblasNoTrans && TransB == CblasNoTrans && SGEMM_DIRECT_PERFORMANT(m,n,k)) {
SGEMM_DIRECT_ALPHA_BETA(m, n, k, alpha, a, lda, b, ldb, beta, c, ldc);
return;
}
+5 -1
View File
@@ -126,7 +126,11 @@ int NAME(char *TRANS, blasint *N, blasint *NRHS, FLOAT *a, blasint *ldA,
#ifdef SMP
args.common = NULL;
args.nthreads = num_cpu_avail(4);
if (args.m < 64) {
args.nthreads = 1;
} else {
args.nthreads = num_cpu_avail(4);
}
if (args.nthreads == 1) {
#endif
+2 -1
View File
@@ -72,7 +72,8 @@ int NAME(blasint *k, blasint *n, blasint *n1, FLOAT *d,
if (kval == 0) return 0;
#ifdef SMP
int nthreads = num_cpu_avail(4);
int nthreads = 1;
if (n >= 64) nthreads = num_cpu_avail(4);
if (nthreads == 1) {
#endif
+5 -1
View File
@@ -77,7 +77,11 @@ int NAME(blasint *N, FLOAT *a, blasint *LDA, blasint *K1, blasint *K2, blasint *
flag = (incx < 0);
#ifdef SMP
nthreads = num_cpu_avail(1);
if (n < 64) {
nthreads = 1;
} else {
nthreads = num_cpu_avail(1);
}
if (nthreads == 1) {
#endif
+5 -1
View File
@@ -112,7 +112,11 @@ int NAME(char *UPLO, blasint *N, FLOAT *a, blasint *ldA, blasint *Info){
#ifdef SMP
args.common = NULL;
args.nthreads = num_cpu_avail(4);
if (args.n < 64) {
args.nthreads = 1;
} else {
args.nthreads = num_cpu_avail(4);
}
if (args.nthreads == 1) {
#endif
+5 -1
View File
@@ -147,7 +147,11 @@ int NAME(char *UPLO, char* TRANS, char* DIAG, blasint *N, blasint *NRHS, FLOAT *
#ifdef SMP
args.common = NULL;
args.nthreads = num_cpu_avail(4);
if (args.m < 64) {
args.nthreads = 1;
} else {
args.nthreads = num_cpu_avail(4);
}
if (args.nthreads == 1) {
#endif
+5 -1
View File
@@ -125,7 +125,11 @@ int NAME(char *TRANS, blasint *N, blasint *NRHS, FLOAT *a, blasint *ldA,
#endif
#ifdef SMP
args.nthreads = num_cpu_avail(4);
if (args.m < 64) {
args.nthreads = 1;
} else {
args.nthreads = num_cpu_avail(4);
}
if (args.nthreads == 1) {
#endif
+5 -1
View File
@@ -78,7 +78,11 @@ int NAME(blasint *N, FLOAT *a, blasint *LDA, blasint *K1, blasint *K2, blasint *
flag = (incx < 0);
#ifdef SMP
nthreads = num_cpu_avail(2);
if (n < 64) {
nthreads = 1;
} else {
nthreads = num_cpu_avail(2);
}
if (nthreads == 1) {
#endif
+5 -1
View File
@@ -112,7 +112,11 @@ int NAME(char *UPLO, blasint *N, FLOAT *a, blasint *ldA, blasint *Info){
#ifdef SMP
args.common = NULL;
args.nthreads = num_cpu_avail(4);
if (args.n < 64) {
args.nthreads = 1;
} else {
args.nthreads = num_cpu_avail(4);
}
if (args.nthreads == 1) {
#endif
+5 -1
View File
@@ -125,7 +125,11 @@ int NAME(char *UPLO, char *DIAG, blasint *N, FLOAT *a, blasint *ldA, blasint *In
#ifdef SMP
args.common = NULL;
args.nthreads = num_cpu_avail(4);
if (args.n < 64) {
args.nthreads = 1;
} else {
args.nthreads = num_cpu_avail(4);
}
if (args.nthreads == 1) {
#endif
+5 -1
View File
@@ -147,7 +147,11 @@ int NAME(char *UPLO, char* TRANS, char* DIAG, blasint *N, blasint *NRHS, FLOAT *
#ifdef SMP
args.common = NULL;
args.nthreads = num_cpu_avail(4);
if (args.m < 64) {
args.nthreads = 1;
} else {
args.nthreads = num_cpu_avail(4);
}
if (args.nthreads == 1) {
#endif
+3
View File
@@ -194,6 +194,9 @@ void CNAME(enum CBLAS_ORDER order,
#ifdef SMP
nthreads = num_cpu_avail(2);
if (n < 50) nthreads = 1;
if (nthreads > 2 && n < 500) nthreads = 2;
if (nthreads == 1) {
#endif
+3
View File
@@ -198,6 +198,9 @@ void CNAME(enum CBLAS_ORDER order,
#ifdef SMP
nthreads = num_cpu_avail(2);
if (n < 50) nthreads = 1;
if (nthreads > 2 && n < 500) nthreads = 2;
if (nthreads == 1) {
#endif
+1 -3
View File
@@ -374,6 +374,7 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo,
return;
}
if (args.m == 0 || args.n == 0) return;
#if !defined(COMPLEX) && !defined(DOUBLE) && !defined(BFLOAT16) && !defined(HFLOAT16)
#if defined(ARCH_ARM64) && (defined(USE_SSYMM_KERNEL_DIRECT)||defined(DYNAMIC_ARCH))
#if defined(DYNAMIC_ARCH)
@@ -383,7 +384,6 @@ if (strcmp(gotoblas_corename(), "armv9sme") == 0
#endif
)
#endif
if (args.m == 0 || args.n == 0) return;
if (order == CblasRowMajor && m == lda && n == ldb && n == ldc)
{
if (Side == CblasLeft && Uplo == CblasUpper) {
@@ -398,8 +398,6 @@ if (strcmp(gotoblas_corename(), "armv9sme") == 0
#endif
if (args.m == 0 || args.n == 0) return;
IDEBUG_START;
FUNCTION_PROFILE_START();
+3
View File
@@ -197,6 +197,9 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint n, FLOAT alpha,
#ifdef SMP
nthreads = num_cpu_avail(2);
if (n < 50) nthreads = 1;
if (nthreads > 2 && n < 500) nthreads = 2;
if (nthreads == 1) {
#endif
+3
View File
@@ -199,6 +199,9 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint n, FLOAT alpha,
#ifdef SMP
nthreads = num_cpu_avail(2);
if (n < 50) nthreads = 1;
if (nthreads > 2 && n < 500) nthreads = 2;
if (nthreads == 1) {
#endif
+3
View File
@@ -225,6 +225,9 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo,
#ifdef SMP
nthreads = num_cpu_avail(2);
if (n < 50) nthreads = 1;
if (nthreads > 2 && n < 500) nthreads = 2;
if (nthreads == 1) {
#endif

Some files were not shown because too many files have changed in this diff Show More