Repository navigation
Conversation
|
\o/ I guess then the next step is to relax |
The SPIR-V "UniformConstant" storage class is effectively the same as the OpenCL "constant" address space, so this is essentially saying that "the string you are printing cannot change or be generated dynamically". In other words, this is intended to be the SPIR-V equivalent of the OpenCL C restriction that "The argument shall be a literal string" (see link). An extension could certainly relax this, if desired. See, for example, here, although this extension is currently relaxing both the address space (AKA storage class) for both the format string and other string operands. |
|
Thanks a lot! Everything make sensen ow If that help adoption, we can potentially have a "weaker" version of the PR where just the string operands is relaxed. |
Since we accept
%sas a printf format specifier, we should describe the required operand for it in the SPIR-V environment spec, similar to the other printf format specifiers.I did some experiments looking at the SPIR-V modules coming out of the SPIR-V LLVM translator and the SPIR-V LLVM backend and I believe this is correct, but it is possible that I am missing some additional cases that should also be accepted.
We should probably document what the printf format string should look like also, though I would prefer to do this in a separate PR.