Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ directx_headers;https://github.com/microsoft/DirectX-Headers/archive/refs/tags/v
cudnn_frontend;https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v1.27.0.zip;1e4c9a464d3437e388ab0163f3be068dba783c08
dawn;https://github.com/google/dawn/archive/refs/tags/v20260828.013844.zip;83f269a6b0c2a5a085c96a4e360d337950740018
dawn_agility_sdk;https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12/1.721.3-preview;fa5f5fc8d0c8c209cfbb530be634960d20595841
kleidiai;https://github.com/ARM-software/kleidiai/archive/refs/tags/v1.20.0.tar.gz;6895e72b3d5cf1173358164cb3d64c9d7d33cc84
kleidiai;https://github.com/ARM-software/kleidiai/archive/refs/tags/v1.30.0.tar.gz;36aebdd5bd28c40b1943eb93498ae42e703510e5
# kleidiai-qmx is pinned to a specific commit as there are no tagged releases. When an appropriate tagged release becomes available,
# this entry will be updated to use refs/tags/<version> instead of the raw commit hash.
kleidiai-qmx;https://github.com/qualcomm/kleidiai/archive/2f10c9a8d32f81ffeeb6d4885a29cc35d2b0da87.zip;5e855730a2d69057a569f43dd7532db3b2d2a05c
Expand Down
17 changes: 17 additions & 0 deletions onnxruntime/core/common/cpuid_info.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-FileCopyrightText: Copyright 2026 Arm Limited and/or its affiliates <open-source-office@arm.com>
// Licensed under the MIT License.
#include "core/common/cpuid_info.h"

Expand Down Expand Up @@ -41,6 +42,10 @@
#define HWCAP2_SVEI8MM (1 << 9)
#endif

#ifndef HWCAP2_SVE2P1
#define HWCAP2_SVE2P1 (UINT64_C(1) << 36)
#endif

#ifndef HWCAP2_BF16
#define HWCAP2_BF16 (1 << 14)
#endif
Expand All @@ -67,6 +72,12 @@
#define PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE 43
#endif

// Support querying SVE2.1 when building with Windows SDKs older than 26100.
// IsProcessorFeaturePresent returns false when the running HAL cannot detect it.
#ifndef PF_ARM_SVE2_1_INSTRUCTIONS_AVAILABLE
#define PF_ARM_SVE2_1_INSTRUCTIONS_AVAILABLE 48
#endif

#endif // _WIN32

#if defined(__APPLE__)
Expand Down Expand Up @@ -190,6 +201,8 @@ void CPUIDInfo::X86Init() {
#if defined(__linux__)

void CPUIDInfo::ArmLinuxInit() {
has_arm_sve2p1_ = ((getauxval(AT_HWCAP2) & HWCAP2_SVE2P1) != 0);

// Assuming no hyper-threading, no NUMA groups
#if defined(CPUINFO_SUPPORTED)
if (pytorch_cpuinfo_init_) {
Expand Down Expand Up @@ -240,6 +253,8 @@ void CPUIDInfo::ArmLinuxInit() {

has_arm_neon_bf16_ = ((getauxval(AT_HWCAP2) & HWCAP2_BF16) != 0);
}

has_arm_sve_ = has_arm_sve_ || has_arm_sve2p1_;
}

#elif defined(_WIN32) // ^ defined(__linux__)
Expand Down Expand Up @@ -328,6 +343,8 @@ void CPUIDInfo::ArmWindowsInit() {
IsProcessorFeaturePresent(PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE) != 0;
#endif
#endif
has_arm_sve2p1_ = IsProcessorFeaturePresent(PF_ARM_SVE2_1_INSTRUCTIONS_AVAILABLE) != 0;
has_arm_sve_ = has_arm_sve_ || has_arm_sve2p1_;
}

#elif defined(__APPLE__) // ^ defined(_WIN32)
Expand Down
3 changes: 3 additions & 0 deletions onnxruntime/core/common/cpuid_info.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-FileCopyrightText: Copyright 2026 Arm Limited and/or its affiliates <open-source-office@arm.com>
// Licensed under the MIT License.

#pragma once
Expand Down Expand Up @@ -39,6 +40,7 @@ class CPUIDInfo {
bool HasArmNeonDot() const { return has_arm_neon_dot_; }
bool HasArmNeon_I8MM() const { return has_arm_neon_i8mm_; }
bool HasArmSve() const { return has_arm_sve_; }
bool HasArmSVE2p1() const { return has_arm_sve2p1_; }
bool HasArmSVE_I8MM() const { return has_arm_sve_i8mm_; }
bool HasArmNeon_BF16() const { return has_arm_neon_bf16_; }
bool HasArm_SME() const { return has_arm_sme_; }
Expand Down Expand Up @@ -169,6 +171,7 @@ class CPUIDInfo {
bool has_fp16_{false};
bool has_arm_neon_i8mm_{false};
bool has_arm_sve_{false};
bool has_arm_sve2p1_{false};
bool has_arm_sve_i8mm_{false};
bool has_arm_neon_bf16_{false};
bool has_arm_sme_{false};
Expand Down
Loading
Loading