test/common/cpu_info.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 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 | |||
| 9 | namespace kai::test { | ||
| 10 | |||
| 11 | /// Returns a value indicating whether the current CPU supports FEAT_AdvSIMD. | ||
| 12 | bool cpu_has_advsimd(); | ||
| 13 | |||
| 14 | /// Returns a value indicating whether the current CPU supports FEAT_DotProd. | ||
| 15 | bool cpu_has_dotprod(); | ||
| 16 | |||
| 17 | /// Returns a value indicating whether the current CPU supports FEAT_DotProd and FEAT_FP16. | ||
| 18 | bool cpu_has_dotprod_and_fp16(); | ||
| 19 | |||
| 20 | /// Returns a value indicating whether the current CPU supports FEAT_I8MM. | ||
| 21 | bool cpu_has_i8mm(); | ||
| 22 | |||
| 23 | /// Returns a value indicating whether the current CPU supports FEAT_I8MM and FEAT_FP16. | ||
| 24 | bool cpu_has_i8mm_and_fp16(); | ||
| 25 | |||
| 26 | /// Returns a value indicating whether the current CPU supports FEAT_FP16. | ||
| 27 | bool cpu_has_fp16(); | ||
| 28 | |||
| 29 | /// Returns a value indicating whether the current CPU supports FEAT_BF16. | ||
| 30 | bool cpu_has_bf16(); | ||
| 31 | |||
| 32 | /// Returns a value indicating whether the current CPU supports FEAT_SVE. | ||
| 33 | bool cpu_has_sve(); | ||
| 34 | |||
| 35 | /// Returns a value indicating whether the current CPU supports FEAT_SVE with 256-bit vector lengths. | ||
| 36 | bool cpu_has_sve_vl256(); | ||
| 37 | |||
| 38 | /// Returns a value indicating whether the current CPU supports FEAT_SVE2. | ||
| 39 | bool cpu_has_sve2(); | ||
| 40 | |||
| 41 | /// Returns a value indicating whether the current CPU supports FEAT_SME. | ||
| 42 | bool cpu_has_sme(); | ||
| 43 | |||
| 44 | /// Returns a value indicating whether the current CPU supports FEAT_SME2. | ||
| 45 | bool cpu_has_sme2(); | ||
| 46 | |||
| 47 | /// Returns a value indicating whether the current CPU supports FEAT_BF16 and FEAT_DotProd | ||
| 48 | bool cpu_has_dotprod_and_bf16(); | ||
| 49 | |||
| 50 | /// Returns a value indicating whether the current CPU supports FEAT_BF16 and FEAT_I8MM | ||
| 51 | bool cpu_has_i8mm_and_bf16(); | ||
| 52 | |||
| 53 | /// Returns a value indicating whether the current CPU supports a set of features | ||
| 54 | template <bool (*... Pred)()> | ||
| 55 | 2502 | bool cpu_check() { | |
| 56 |
4/4✓ Branch 0 taken 1112 times.
✓ Branch 1 taken 556 times.
✓ Branch 2 taken 556 times.
✓ Branch 3 taken 278 times.
|
2502 | return (Pred() && ...); |
| 57 | } | ||
| 58 | |||
| 59 | } // namespace kai::test | ||
| 60 |