[mlir][spirv] Make SPIRVTypeConverter target environment aware
Non-32-bit scalar types requires special hardware support that may not exist on all Vulkan-capable GPUs. This is reflected as non-32-bit scalar types require special capabilities or extensions to be used. This commit makes SPIRVTypeConverter target environment aware so that it can properly convert standard types to what is accepted on the target environment. Right now if a scalar type bitwidth is not supported in the target environment, we use 32-bit unconditionally. This requires Vulkan runtime to also feed in data with a matched bitwidth and layout, especially for interface types. The Vulkan runtime can do that by inspecting the SPIR-V module. Longer term, we might want to introduce a way to control how such case are handled and explicitly fail if wanted. Differential Revision: https://reviews.llvm.org/D76244
Loading
Please sign in to comment