SPIR-V can be directly consumed by APIs like Vulkan and OpenCL,
where we can use the capability list to diffferentiate. It can
also be used as a compilation target to transcompile to shading
languages like WGSL to target WebGPU. We have no way to tell
that with just the capability list, so we cannot perform certain
transformations only applicable to those targets thus far. So
this commit add a field in the target environment to indicate
the client API for such purposes.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td | ||
---|---|---|
299 | What happens when we need to move a new API in the future? Will it become case 5 while Unknown remains case 4? Instead, would it make sense to define Unknown as case 0 or -1? |
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td | ||
---|---|---|
299 | s/move a new/add a new/ |
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td | ||
---|---|---|
299 | Good questions. These are meant to be "StrEnumAttr" actually, where the exact number is not fixed and there is no guarantee it won't change in the future. Only the symbol is meaningful here. But we don't have StrEnumAttr anymore. Using -1 for unknown makes sense. Changed. |
What happens when we need to move a new API in the future? Will it become case 5 while Unknown remains case 4? Instead, would it make sense to define Unknown as case 0 or -1?