I have implemented a wrapper around calclCompile primarly for getting AMD IL code as is gets generated by the OpenCL AMD GPU backend.
It prints these AMD IL code onto the stderr stream as well as AMD device assembly (using calclLink and calclDisassembleImage).
This is a temporary measure to get the AMD IL generated by OpenCL AMD GPU backend as of now is not possible to use in AMD OpenCL backend the facilities for getting
built device binaries offered by OpenCL. Also at the moment is not possible to use this device binaries to skip compiling the kernels on AMD backend, but this limitation could possibly be removed by using this wrapper jointly by with a similar and special made OpenCL wrapper. I will code one is some people send requests in my blog.
Note that assuming in future using AMD OpenCL backend you can get AMD IL code, then you can get assembly code running AMD SKA, assuming SKA gets updated or using caclLink in your code, but if AMD OpenCL binaries return assembly code there will not be an easy way of obtainig AMD IL code without my tool or another CAL wrapper.
The wrapper is named calclwrapper.dll or calclwrapper.so and you have to insert into the executable you want to get the AMD IL code from.
This wrapper should work with CAL executables and OpenCL executables using an OpenCL AMD GPU device.
You have a different method for every platform for loading the wrapper library:
* On Windows use the executable withdll.exe from Microsoft Detours library to force "insert a .dll" into the process.
* On Linux you can use the LD_PRELOAD env variable to force the load of a library by an executable.
I provide the source code for Windows & Linux as well as the wrapper library an example scripts to use it.
Currenlty it supports only Windows 32 bits. Also Linux library is tested on 32 bit platforms altough building it should be ok on Linux 64 bits.
Note it's currently impossible to use in the AMD GPU backend of Snow Leopard as this it isn't currently using (and possibly never?) CAL independent libraries/frameworks.
I have tested on Windows 7 x64 and Ubuntu 9.04 x32 on ATI 5850 using ATI 9.11 beta drivers.
Get it!
Wednesday, 21 October 2009
A CAL wrapper for getting AMD IL from OpenCL AMD GPU backend!
Posted on 18:09 by Unknown
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment