[PATCH] D39255: [AMDGPU] Emit metadata for hidden arguments for kernel enqueue

Tony Tye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 09:13:30 PDT 2017


t-tye added a comment.

In https://reviews.llvm.org/D39255#906591, @yaxunl wrote:

> In https://reviews.llvm.org/D39255#905873, @t-tye wrote:
>
> > In https://reviews.llvm.org/D39255#905658, @yaxunl wrote:
> >
> > > In https://reviews.llvm.org/D39255#905627, @t-tye wrote:
> > >
> > > > If the kernel does not use the hidden arguments should they be listed in the metadata since the runtime is not required to pass them in? If not needed, the we still want to have a kernarg location at the known location, it will just not be initialized by the runtime.
> > >
> > >
> > > In that case we just need runtime to fill in 0 values for the missing argument so that each hidden argument is in the fixed position. e.g. if runtime does not find printf metadata, it will still insert a nullptr as the PrintfBuffer argument. I think only library code uses these hidden arguments. Then library code can assume fixed position for each hidden argument.
> >
> >
> > So will the metadata only be generated for the hidden arguments that actually need to be initialized by the runtime? I believe the metadata format contains the position of the argument so it is possible to set up non-contiguous arguments (namely, can skip the ones that will not be used).
>
>
> I have updated the patch so that the metadata are generated only when they are needed. The metadata format does not contain the position of the argument. The runtime needs to always emit the Printf hidden kernel argument so that library code does not need to know if it is emitted or not.


I think the metadata has a HIDDENNONE kind which needs to be used for kernel arguments that need no set up.


https://reviews.llvm.org/D39255





More information about the llvm-commits mailing list