[llvm-dev] [OpenCL][AMDGPU] Using AMDGPU generated kernel code for OpenCL

Philipp Schaad via llvm-dev llvm-dev at lists.llvm.org
Mon May 8 02:43:15 PDT 2017


Hello everyone

I was wondering, what the correct way of using an AMDGPU generated kernel
code for OpenCL was. I am trying to provide Polly's GPGPU Code generation
with the ability to run on different GPU devices, such as AMD GPUs.

For NVIDIA, I simply retrieve a pre-compiled PTX string from the NVPTX
backend and pass that to OpenCL's 'clCreateProgramWithBinary' function.
However, when doing the same with the AMDGPU backend and its returned
kernel string, OpenCL complains about an invalid binary.
This has been tried with a number of different target triples (eg.
'amdgcn--', 'amdgcn-amd-amdhsa' etc), and my assumption so far is, that I
am not trying the correct Triple.
Or am I missing something entirely, and there have to be additional steps,
to get the correct ELF binary?

Thank you in advance for any help and pointers!

Best,
Philipp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170508/b9910505/attachment.html>


More information about the llvm-dev mailing list