<div dir="ltr">Hi Michael<div><br></div><div>Thank you for those two links.</div><div>So if I understand that correctly, this means that the ISA generated by the AMDGPU backend is only a part of the expected elf-linked binary file, and would have to be correctly wrapped/packed up in order for OpenCL to accept it?</div><div><br></div><div>Best,</div><div>Philipp</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, 9 May 2017 at 15:49 Michael Kruse <<a href="mailto:llvmdev@meinersbur.de">llvmdev@meinersbur.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The binary format expected by AMD OpenCL drivers are elf-linked binaries. See<br>
<br>
<a href="http://openwall.info/wiki/john/development/AMD-IL" rel="noreferrer" target="_blank">http://openwall.info/wiki/john/development/AMD-IL</a><br>
<a href="https://community.amd.com/thread/166955" rel="noreferrer" target="_blank">https://community.amd.com/thread/166955</a><br>
<br>
Michael<br>
<br>
<br>
2017-05-08 11:43 GMT+02:00 Philipp Schaad via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>:<br>
> Hello everyone<br>
><br>
> I was wondering, what the correct way of using an AMDGPU generated kernel<br>
> code for OpenCL was. I am trying to provide Polly's GPGPU Code generation<br>
> with the ability to run on different GPU devices, such as AMD GPUs.<br>
><br>
> For NVIDIA, I simply retrieve a pre-compiled PTX string from the NVPTX<br>
> backend and pass that to OpenCL's 'clCreateProgramWithBinary' function.<br>
> However, when doing the same with the AMDGPU backend and its returned kernel<br>
> string, OpenCL complains about an invalid binary.<br>
> This has been tried with a number of different target triples (eg.<br>
> 'amdgcn--', 'amdgcn-amd-amdhsa' etc), and my assumption so far is, that I am<br>
> not trying the correct Triple.<br>
> Or am I missing something entirely, and there have to be additional steps,<br>
> to get the correct ELF binary?<br>
><br>
> Thank you in advance for any help and pointers!<br>
><br>
> Best,<br>
> Philipp<br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
><br>
</blockquote></div>