Vulkan requires GPU processor ID/count builtin variables to be
32-bit scalar or vector for all the cases. Similarly there
are special requirements for OpenCL. We need to make sure those
rules are respected when converting using 64bit for index.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp | ||
---|---|---|
169–170 | Could we run this unconditionally, either via a helper function or something like dim = createOrFold<UConvertOp>(loc, converter.getBuiltinIndexVector(), dim);? |
mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp | ||
---|---|---|
169–170 | This is gated on two conditions to be true. I'm not sure how much it helps to introduce UConvert folder to only handle builtinType != indexType? |
mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp | ||
---|---|---|
169–170 | But it seems like the type converter should know about both of these conditions, so I'd expect it to pick the right type and decide if any conversions are necessary. Either directly within TypeConverter or as a helper that takes it as a parameter. Anyway, this seems like a detail, so feel free to leave this as-is if you like the current implementation. |
mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp | ||
---|---|---|
169–170 | Yeah, the type converter is right now only concerning types. What you expect is actually op-dependent type conversion, where you dynamically adjust converted-to type according to the current op. This is not supported yet. So we cannot have it done in the type converter right now.. |
Could we run this unconditionally, either via a helper function or something like dim = createOrFold<UConvertOp>(loc, converter.getBuiltinIndexVector(), dim);?