ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

Add VK_EXT_pageable_device_local_memory support

Open whyb opened this issue 2 years ago • 2 comments

Add VK_EXT_pageable_device_local_memory support

Why do this change?

If the VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT::pageableDeviceLocalMemory feature is enabled, memory allocations made from a heap that includes VK_MEMORY_HEAP_DEVICE_LOCAL_BIT in VkMemoryHeap::flags may be transparently moved to host-local memory allowing multiple applications to share device-local memory. If there is no space left in device-local memory when this new allocation is made, other allocations may be moved out transparently to make room. The operating system will determine which allocations to move to device-local memory or host-local memory based on platform-specific criteria. To help the operating system make good choices, the application should set the appropriate memory priority with VkMemoryPriorityAllocateInfoEXT and adjust it as necessary with vkSetDeviceMemoryPriorityEXT. Higher priority allocations will moved to device-local memory first.

If the VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT structure is included in the pNext chain of the VkPhysicalDeviceFeatures2 structure passed to vkGetPhysicalDeviceFeatures2, it is filled in to indicate whether each corresponding feature is supported. VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT can also be used in the pNext chain of VkDeviceCreateInfo to selectively enable these features.

How to use it?

  • update create_gpu_instance()
  • append some codes, like this... 圖片

whyb avatar Dec 25 '23 05:12 whyb

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.

:white_check_mark: nihui
:x: whyb
You have signed the CLA already but the status is still pending? Let us recheck it.

tencent-adm avatar Dec 25 '23 05:12 tencent-adm

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.53%. Comparing base (7cc8910) to head (70c6f49). Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5246       +/-   ##
===========================================
- Coverage   94.63%   89.53%    -5.10%     
===========================================
  Files         778      318      -460     
  Lines      243361    96127   -147234     
===========================================
- Hits       230302    86072   -144230     
+ Misses      13059    10055     -3004     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Dec 25 '23 06:12 codecov-commenter