121 Commits
Author SHA1 Message Date
Martin Kroeker 8766886cfc Merge pull request #5577 from mattip/attrib-hidden
add visibility=default to exported functions, visibility=hidden to most assembler
2026-07-24 00:16:00 +02:00
Martin Kroeker a543bd5d07 Export openblas_cancel and openblas_xerbla_handler 2026-07-23 10:33:28 +02:00
Martin Kroeker 52f0572564 Guard use of C11 atomics against C++ compilation 2026-07-23 00:08:50 +02:00
Martin Kroeker 63ad298a67 Merge branch 'develop' into attrib-hidden 2026-07-21 20:00:16 +02:00
Keno FischerandClaude Fable 5 7a07c8e1f4 Add an asynchronous cancellation API for in-flight operations
Long-running BLAS calls (a large gemm can run for minutes) cannot
currently be interrupted: callers embedding OpenBLAS (e.g. the Julia
runtime responding to a user's ^C) can only wait for completion or kill
the process. Add a minimal cooperative cancellation protocol:

Every thread owns a pointer-sized generation slot in thread-local
storage, whose stable address is returned by openblas_cancel_token().
Instrumented compute drivers advance the slot to a fresh even
generation at operation entry on the issuing thread (forwarding the
slot and generation to worker threads through blas_arg_t) and poll it
at block granularity. openblas_cancel(token, loaded_token) - callable
from any thread - sets the cancel bit (bit 0) iff the slot still holds
loaded_token, so a canceller that loaded the value while an operation
was in flight stops exactly that operation, while stale or racing
requests either miss or dirty an already-dead generation, both
harmless. There is no object lifecycle: nothing to allocate, bind,
reset, or free.

A cancelled operation returns quickly, leaving its output buffer in an
unspecified partially-updated state that the caller must discard; every
synchronization point in the threaded driver is still executed, so
sibling threads never stall and the library remains consistent for
subsequent calls. Coverage: the level-3 gemm/symm/hemm drivers
(level3.c and level3_thread.c).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012nCkyKUguncLLJrH9K5o7m
2026-07-19 04:20:28 +00:00
moluopro 6a04925804 xerbla: add a portable handler API 2026-07-10 14:55:52 +08:00
Kumar Aditya a2261f9e52 fix thread safety of openmp backend 2026-07-02 15:39:09 +05:30
Martin Kroeker 62944c9db0 Turn WebAssembly/Emscripten support into a dedicated architecture 2026-03-15 19:37:09 +01:00
mattip d0c4d08637 fix position of OPENBLAS_EXPORT, decorate server_win32 function 2026-02-05 06:31:18 +11:00
mattip da494a58da windows needs declaration to match definition 2026-02-05 06:31:17 +11:00
mattip 73f34751fd move defines to separate file for kernels/generic/lsame.c 2026-02-05 06:31:17 +11:00
mattip be7da1f111 add visibility=default to exported functions, visibility=hidden to most assembler 2026-02-05 06:31:17 +11:00
Martin Kroeker 0ff51a40f1 Merge pull request #5579 from vtjnash/jn/YIELDING
fix define for YIELDING
2025-12-25 09:51:44 +01:00
Jameson Nash 0b2b583223 POSIX.1-2008 2025-12-24 21:47:03 -05:00
Jameson Nash fed16d638c Update common.h 2025-12-24 17:47:48 -05:00
Jameson Nash 371663f0c2 fix define for YIELDING
The intent is to define this as nop, but previously it was then
immediately overriding it for various architectures, causing a compiler
warning on Windows.
2025-12-23 13:59:29 -05:00
Martin Kroeker 5b0884d8e7 Use getenv for readenv_atoi in CYGWIN or MINGW builds 2025-12-22 16:31:33 +01:00
mayeut c5e1967ddb fix(warning): taking the absolute value of 'bfloat16' has no effect
The compinv function is invalid when building for BFLOAT16 and leads to the following warning:
`taking the absolute value of unsigned type 'bfloat16' (aka 'unsigned short') has no effect`.
Update pre-processor conditions to remove its definition when building for BFLOAT16.
2025-11-23 09:40:04 +01:00
Chris SidebottomandYe Tao f95e7b0e32 Add infrastructure for BGEMM
Setting up all the infrastructure for BGEMM support in OpenBLAS, hopefully I found all the right places.

Derived mostly from the previous work done in https://github.com/OpenMathLib/OpenBLAS/pull/5287

Co-authored-by: Ye Tao <ye.tao@arm.com>
2025-07-08 16:22:41 +01:00
gkdddd 670ec6f757 Added shgemm_kernel_8x8 for RISCV64_ZVL128B and shgemm_kernel_16x8 for RISCV64_ZVL256B
Added HFLOAT16 support for RISCV64
Added shgemm_kernel_8x8 for RISCV64_ZVL128B and shgemm_kernel_16x8 for RISCV64_ZVL256B based on HFLOAT16
The instruction sets used are ZVFH and ZFH, which need to be supported by RVV1.0

Related to issue #5279
Co-authored-by Linjin Li <linjin_li@163.com>
2025-06-03 20:14:30 +08:00
Srangrang 0a967797a1 Add FP16 support for RISCV 2025-05-27 14:34:57 +08:00
Srangrang 2996c25c94 add shgemm for RISCV_ZVL128B 2025-05-24 23:55:49 +08:00
Vaisakh K V f66ca05b31 Merge branch 'develop' into topic/sgemm_direct_sme1 2025-02-13 14:54:37 +05:30
Vaisakh K V d23eb3b93e Support for SME1 based sgemm_direct kernel for cblas_sgemm level 3 API
* Added ARMV9SME target
* Added SGEMM_DIRECT kernel based on SME1
2025-02-13 14:51:21 +05:30
daichengrong 0b3db03d4b added optimizations for RISC-V YIELDING 2024-11-22 11:13:24 +08:00
Martin Kroeker 07b1c0bc10 Stop using sched_yield on non-Windows x86_64 2024-03-11 08:01:49 +01:00
Dirreke ec89466e14 Add CSKY support 2024-01-16 23:45:06 +08:00
Martin Kroeker f9b2d7f225 Merge pull request #3253 from wi24rd/patch-1
Fix typo in common.h
2024-01-13 19:55:01 +01:00
TGY b5ba95a6c0 Modernize obsolete inline order 2023-08-16 00:48:40 +02:00
Martin Kroeker 9773a9d6b3 undefine YIELDING for the Emscripten js converter 2022-09-14 17:04:11 +02:00
Pablo Romero 84a5f0e2eb Fixes #3743. 2022-08-26 11:44:11 +02:00
Martin Kroeker bc93f468ef Add Elbrus E2000 architecture as generic x86_64 compatible 2022-01-22 18:53:38 +01:00
gxw af0a69f355 Add support for LOONGARCH64 2021-07-27 15:29:12 +08:00
王滋涵 Zephyr Wang a62cfc3ccf Fix typo in common.h 2021-05-29 18:10:00 +08:00
H.J. Lu 53ee0b76bb x86: Enable Intel CET
When Intel CET is enabled, we need to include <cet.h> in assembly codes
to mark Intel CET support and place _CET_ENDBR at the function entry.
2021-04-30 19:45:39 -07:00
xoviat b60de4447a add cortex-m platform 2021-01-19 08:57:44 -06:00
Zhang Xianyi d7ba7679b6 Merge branch 'develop' into risc-v 2020-10-16 23:27:38 +08:00
Martin Kroeker 84949754a0 Fix bfloat16 conditional 2020-10-13 09:11:36 +02:00
Martin Kroeker ca31c32693 Rename "HALF" and "sh" to "BFLOAT16" and "sb" 2020-10-11 23:49:22 +02:00
Martin Kroeker dc8e4e1959 Reduce the BLAS3 heap allocation threshold to 32 and mark it as configurable 2020-10-04 22:59:24 +02:00
User User-User d2333e7842 aarch64 fix std=c18 compilation 2020-10-03 18:00:34 +03:00
Chen, Guobing deaeb6c5b8 Add bfloat16 based dot and conversion with single/double
1. Added bfloat16 based dot as new API: shdot
2. Implemented generic kernel and cooperlake-specific (AVX512-BF16) kernel for shdot
3. Added 4 conversion APIs for bfloat16 data type <=> single/double: shstobf16 shdtobf16 sbf16tos dbf16tod
     shstobf16 -- convert single float array to bfloat16 array
     shdtobf16 -- convert double float array to bfloat16 array
     sbf16tos  -- convert bfloat16 array to single float array
     dbf16tod  -- convert bfloat16 array to double float array
4. Implemented generic kernels for all 4 conversion APIs, and cooperlake-specific kernel for shstobf16 and shdtobf16
5. Update level1 thread facilitate functions and macros to support multi-threading for these new APIs
6. Fix Cooperlake platform detection/specify issue when under dynamic-arch building
7. Change the typedef of bfloat16 from unsigned short to more strict uint16_t

Signed-off-by: Chen, Guobing <guobing.chen@intel.com>
2020-09-04 02:31:25 +08:00
Martin Kroeker a36eb19ae0 Update conditional for C11 atomics to use HAVE_C11 2020-07-18 17:13:24 +00:00
Rajalakshmi Srinivasaraghavan 9fe930f205 powerpc: Add support for future processor
This is the initial patch to support build infrastructure
for POWER10 architecture.
2020-06-11 15:47:20 -05:00
Rajalakshmi Srinivasaraghavan 67cc4b9e16 Fix warnings in clang and export symbol 2020-04-15 19:15:23 -05:00
Rajalakshmi Srinivasaraghavan 7eb55504b1 RFC : Add half precision gemm for bfloat16 in OpenBLAS
This patch adds support for bfloat16 data type matrix multiplication kernel.
For architectures that don't support bfloat16, it is defined as unsigned short
(2 bytes).  Default unroll sizes can be changed as per architecture as done for
SGEMM and for now 8 and 4 are used for M and N.  Size of ncopy/tcopy can be
changed as per architecture requirement and for now, size 2 is used.

Added shgemm in kernel/power/KERNEL.POWER9 and tested in powerpc64le and
powerpc64.  For reference, added a small test compare_sgemm_shgemm.c to compare
sgemm and shgemm output.

This patch does not cover OpenBLAS test, benchmark and lapack tests for shgemm.
Complex type implementation can be discussed and added once this is approved.
2020-04-14 14:55:08 -05:00
Martin Kroeker 79fd006c58 Expose the support_avx512 function provided in dynamic.c 2020-03-26 21:25:39 +01:00
Xianyi Zhang 4aa2d89217 Merge branch 'develop' into risc-v 2020-02-27 13:53:49 +08:00
Martin Kroeker d2cb610272 Add option USE_LOCKING for single-threaded build with locking support
for calling from concurrent threads
2019-05-15 23:18:43 +02:00
Jeff Baylor 40e53e52d6 snprintf define consolidated to common.h 2019-04-22 17:01:34 -07:00