Skip to content

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
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Hansersdog
❌ nihui
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
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 15124728 15124728 0 😘
armhf 6155744 6155744 0 😘
aarch64 9453192 9453192 0 😘

@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.89%. Comparing base (a514cf5) to head (3500940).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6190   +/-   ##
=======================================
  Coverage   95.89%   95.89%           
=======================================
  Files         837      837           
  Lines      264994   264994           
=======================================
  Hits       254105   254105           
  Misses      10889    10889           

☔ 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