Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Vulkan] Add device capabilities to Target, use in codegen (#8127)
* [Vulkan] Enable instance/device extensions - Vulkan requires that extensions be explicitly enabled if used. Explicitly list out which extensions are required (currently none) and which are optional. * [Vulkan] Extract device information from vulkan API. - Based on vkGetPhysicalDeviceProperties and vkGetPhysicalDeviceFeatures, determine which Vulkan capabilities are supported, pack into a Target. * [Vulkan] Query instance-supported apiVersion before creating instance - Previously, vkCreateInstance was called to initialize Vulkan 1.0. * [Vulkan] Moved options for dedicated allocation and push descriptors to environment variables - Query support for dedicated allocation and push descriptors along with the rest of the device support. Move the options to disable their use from compile-time variables to environment variables `TVM_VULKAN_DISABLE_PUSH_DESCRIPTOR` and `TVM_VULKAN_DISABLE_DEDICATED_ALLOCATION`. * [Vulkan] Move option for vulkan validation layers to environment variable - Moved to enable faster use as a debug tool. If `TVM_VULKAN_ENABLE_VALIDATION_LAYERS` is a non-empty string, validation layers will be enabled. * [Vulkan] Explicitly enable vulkan features in device creation - Vulkan requires that features be explicitly enabled before use. For each feature that the device supports and a shader might use, declare it in the call to `vkCreateDevice`. * [Vulkan] Avoid repeated queries for device attributes. - Implement `VulkanDeviceAPI::GetAttr` based on the per-device values stored in the Target. This pulls all logic for querying device parameters is in a single location. * [Vulkan] Implement "from_device" flag for the vulkan target. - With the number of device capabilities that may or may not be supported by a vulkan driver, it can be tedious to input them. Specifying "-from_device=0" now indicate that any unspecified values should be read from the device. * [Vulkan][Codegen] Read vulkan device capabilities/limits from Target - Previously, the codegen assumed that all device features were present. Now, the codegen reads device capabilities from the Target, and throws an error if codegen would require use of an unsupported feature. Co-authored-by: Eric Lunderberg <[email protected]>
- Loading branch information