[Mesa-dev] EXTERNAL: Re: OpenCL Clang/Clover Offline Compilation issue

Francisco Jerez currojerez at riseup.net
Wed Jan 15 07:34:41 PST 2014


"Dorrington, Albert" <albert.dorrington at lmco.com> writes:

> Hi Francisco,
>
> I implemented the patch on my system and rebuilt my two programs. 
>
> Reran my "online compile with save" program to generate a new 'compiled kernel' and then reran the "load compiled kernel" program; and it worked without errors, executing the kernel properly.
> So, it looks like the Mesa implementation of clCreateProgramWithBinary() now functions, for the LLVM IR generated code, which is great!
>

That's awesome, I'll merge it to master shortly.

> I have re-read the Khronos OpenCL spec for clGetProgramInfo() and clCreateProgramWithBinary() to clarify my understanding.
> It looks like clGetProgramInfo() can return either IR, a device specific binary, or both; while clCreateProgramWithBinary() can accept IR and/or a device specific binary.
>

Yeah, well, it's up to the implementation how device-specific the
binaries are.  On r600 they're roughly half-way through the compilation
process.  If that's not satisfactory to you, you could try to get clang
to generate binaries directly in the clover format (or even better, get
clover to understand ELF object files instead of the non-standard format
we use now for serializing module objects) and get rid of the two-stage
compilation process.  That way clover will have access to the actual GPU
binaries.

> For our purposes, we were expecting the device specific binary, not the IR, so that we would not need to compile, or run LLVM on our target environment.
>
Is it that much overhead?  AFAIK a compliant OpenCL implementation has
to include a compiler anyway, unless you're trying to do embedded
profile.  Is that what you have in mind?

> Looks like I need to spend some more time understanding the code and architecture :)

Thanks.
>
> -Al
>
> -----Original Message-----
> From: Francisco Jerez [mailto:currojerez at riseup.net] 
> Sent: Tuesday, January 14, 2014 4:18 PM
>
> Hi Albert, can you give the attached patch a try?  It fixes a couple of issues I've found in the clCreateProgramWithBinary path.  Let me know if it helps.
>
> Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140115/2e1463d1/attachment.pgp>


More information about the mesa-dev mailing list