Skip to content

discover VK_KHR_vulkan_memory_model#6121

Merged
nihui merged 1 commit into
Tencent:masterfrom
nihui:VK_KHR_vulkan_memory_model
Jun 12, 2025
Merged

discover VK_KHR_vulkan_memory_model#6121
nihui merged 1 commit into
Tencent:masterfrom
nihui:VK_KHR_vulkan_memory_model

Conversation

@nihui

@nihui nihui commented Jun 12, 2025

Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions Bot added the core label Jun 12, 2025
@nihui
nihui requested a review from Copilot June 12, 2025 02:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for the VK_KHR_vulkan_memory_model extension by defining its structures and macros, integrating detection in GpuInfo, enabling it during device creation, and appending its features in SPIR-V compilation.

  • Introduce extension definitions in vulkan_header_fix.h
  • Expose support/query methods in GpuInfo (gpu.h/gpu.cpp)
  • Enable the extension in VulkanDevice and SPIR-V feature appending in gpu.cpp

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/vulkan_header_fix.h Added VK_KHR_vulkan_memory_model macro and feature struct
src/gpu.h Declared support/query methods for the new extension
src/gpu.cpp Initialized flags, chained feature queries, enabled extension, and appended SPIR-V features
Comments suppressed due to low confidence (3)

src/vulkan_header_fix.h:1640

  • Consider adding the standard VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION and VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME macros to fully match the official Vulkan extension headers.
#define VK_KHR_vulkan_memory_model                                         1

src/gpu.h:342

  • [nitpick] You may want to add a brief Doxygen or comment describing what this method checks and what its return value represents to keep the API docs consistent.
    int support_VK_KHR_vulkan_memory_model() const;

src/gpu.cpp:1859

  • There aren't any unit tests covering this new support flag. Consider adding tests that simulate devices with and without VK_KHR_vulkan_memory_model to validate the flag and query methods.
int GpuInfo::support_VK_KHR_vulkan_memory_model() const

@codecov-commenter

codecov-commenter commented Jun 12, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.79%. Comparing base (6e3052a) to head (c2c23c2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6121      +/-   ##
==========================================
+ Coverage   95.70%   95.79%   +0.09%     
==========================================
  Files         829      829              
  Lines      270340   270769     +429     
==========================================
+ Hits       258724   259392     +668     
+ Misses      11616    11377     -239     

☔ 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.

@nihui
nihui merged commit cc40332 into Tencent:master Jun 12, 2025
100 of 104 checks passed
@github-actions

Copy link
Copy Markdown

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 16488168 16488320 +152 ⚠️
armhf 7368772 7368864 +92 ⚠️
aarch64 10779040 10779000 -40 😘

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants