Skip to content

Feature/cpu 64core support #6190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Hansersdog
Copy link

概述

本次提交对 ncnn 项目中的 CpuSet 类进行了重要改进,主要针对Windows平台增加了对64核以上CPU的多处理器组(Processor Groups)支持,解决了在高核心数系统上的CPU识别,管理问题。LInux & android平台原生支持最大1024核,未改变。MacOs的也未进行改动。

设计思路

把原来的64位ULONG_PTR掩码设计成组,分组进行管理,每组内仍使用ULONG_PTR作为掩码

新增功能:

  • MAX_CPU_GROUPS :定义最大支持的处理器组数量(20个)
  • masks[MAX_CPU_GROUPS] :用于存储每个处理器组的CPU掩码
  • max_cpus 和 active_groups :记录最大CPU数量和活跃组数
  • get_max_cpus() :获取最大CPU数量
    本代码未使用,但认为可能会在其他模块需要这样的api
  • get_group_mask(int group) :获取指定组的CPU掩码
  • get_active_group_count() :获取活跃处理器组数量

@tencent-adm
Copy link
Member

tencent-adm commented Jul 14, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Jul 14, 2025

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 15643128 15657392 +14264 ⚠️
armhf 6648220 6653768 +5548 ⚠️
aarch64 9986896 9989696 +2800 ⚠️

@codecov-commenter
Copy link

codecov-commenter commented Jul 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.98%. Comparing base (075d07e) to head (41a1c17).
Report is 22 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6190      +/-   ##
==========================================
+ Coverage   95.82%   95.98%   +0.15%     
==========================================
  Files         834      835       +1     
  Lines      265366   265247     -119     
==========================================
+ Hits       254280   254586     +306     
+ Misses      11086    10661     -425     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@nihui nihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unrelated changes (build.sh and build-android.cmd)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants