[cfe-dev] [LLVMdev] SPIR provisional specification is now available in the Khronos website

Pekka Jääskeläinen pekka.jaaskelainen at tut.fi
Thu Sep 13 02:19:29 PDT 2012

On 09/12/2012 10:30 PM, Villmow, Micah wrote:
>> case there are better ways to do that (metadata)
> [Villmow, Micah] I disagree, the 'kernel' keyword specifies a different
> calling convention from functions that don't have it. So we need a calling
> convention that maps to that. The ABI for a kernel is different than the
> ABI for a non-kernel function. The regular function itself also is
> different than the default calling convention because it has restrictions
> on it(one being it can only be called from a kernel function or another
> device function) that the normal calling convention does not. A way to
> think about this is that this is more similar to the PTX_[Kernel|Device]
> calling conventions than the default, fast or stdcall conventions. I don't
> think metadata is the right approach here since we are specifying unique
> ways for how these functions can be called.

For what it's worth, this issue manifests itself in an unsolved pocl
bug: https://bugs.launchpad.net/pocl/+bug/987905

It would be simpler to implement a portable implementation for calling the
kernel from the host if we could assume the kernel calling convention mapped
each OpenCL setArg arg to a single kernel function arg (and preferably all
arg data in memory). For the non-kernel functions it should not matter and
could be target-specific.


More information about the cfe-dev mailing list