Elffuss BraidHub

kikocis/kleidiai public

main · 1.9 KiBRawPermalink
1//
2// SPDX-FileCopyrightText: Copyright 2024-2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
3//
4// SPDX-License-Identifier: Apache-2.0
5//
6
7#pragma once
8
9namespace kai::test {
10
11/// Returns a value indicating whether the current CPU supports FEAT_AdvSIMD.
12bool cpu_has_advsimd();
13
14/// Returns a value indicating whether the current CPU supports FEAT_DotProd.
15bool cpu_has_dotprod();
16
17/// Returns a value indicating whether the current CPU supports FEAT_DotProd and FEAT_FP16.
18bool cpu_has_dotprod_and_fp16();
19
20/// Returns a value indicating whether the current CPU supports FEAT_I8MM.
21bool cpu_has_i8mm();
22
23/// Returns a value indicating whether the current CPU supports FEAT_I8MM and FEAT_FP16.
24bool cpu_has_i8mm_and_fp16();
25
26/// Returns a value indicating whether the current CPU supports FEAT_FP16.
27bool cpu_has_fp16();
28
29/// Returns a value indicating whether the current CPU supports FEAT_BF16.
30bool cpu_has_bf16();
31
32/// Returns a value indicating whether the current CPU supports FEAT_SVE.
33bool cpu_has_sve();
34
35/// Returns a value indicating whether the current CPU supports FEAT_SVE with 256-bit vector lengths.
36bool cpu_has_sve_vl256();
37
38/// Returns a value indicating whether the current CPU supports FEAT_SVE2.
39bool cpu_has_sve2();
40
41/// Returns a value indicating whether the current CPU supports FEAT_SVE2.1.
42bool cpu_has_sve2p1();
43
44/// Returns a value indicating whether the current CPU supports FEAT_SME.
45bool cpu_has_sme();
46
47/// Returns a value indicating whether the current CPU supports FEAT_SME2.
48bool cpu_has_sme2();
49
50/// Returns a value indicating whether the current CPU supports FEAT_BF16 and FEAT_DotProd
51bool cpu_has_dotprod_and_bf16();
52
53/// Returns a value indicating whether the current CPU supports FEAT_BF16 and FEAT_I8MM
54bool cpu_has_i8mm_and_bf16();
55
56/// Returns a value indicating whether the current CPU supports a set of features
57template <bool (*... Pred)()>
58bool cpu_check() {
59 return (Pred() && ...);
60}
61
62} // namespace kai::test