cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

byly
Journeyman III

creating opencl binary kernel with CAL

Hi!

Can I create OpenCL binary kernel (listed as preview feature in 2.1 SDK release) somehow using CAL and ISA or IL assembly language?

My problem is OpenCL compiler preventing me from optimizing code enough while manual optimization path looks quite straightforward. My code snippets work with performance near to theoretical while being assembled together program runs 3x slower than expected.

0 Likes
6 Replies
zeland
Journeyman III

Originally posted by: byly Hi!

 

Can I create OpenCL binary kernel (listed as preview feature in 2.1 SDK release) somehow using CAL and ISA or IL assembly language? My problem is OpenCL compiler preventing me from optimizing code enough while manual optimization path looks quite straightforward. My code snippets work with performance near to theoretical while being assembled together program runs 3x slower than expected.

 

UP.

I'm interesting in it too.

0 Likes

Originally posted by: zeland
Originally posted by: byly Hi!

 

 Can I create OpenCL binary kernel (listed as preview feature in 2.1 SDK release) somehow using CAL and ISA or IL assembly language? My problem is OpenCL compiler preventing me from optimizing code enough while manual optimization path looks quite straightforward. My code snippets work with performance near to theoretical while being assembled together program runs 3x slower than expected.

 

 



 

UP.

 

I'm interesting in it too.

 

There is no way to do this. I don't think this will be available in future as OpenCL compiler able to optimize code in future.

0 Likes

from "CAL Programming Guide":

2.2.3 High Level Kernel Languages
<...>
For example, developers can use OpenCL to develop their kernels, then generate the
equivalent ATI IL using offline tools provided by ATI
. The generated ATI IL kernel
then can be passed to the CAL compiler, with any required modifications, for
generating the binary image.

<...>

 

I want to use CAL++ for generating the binary image and loading it to OpenCL program.

 

mr. Hazeman, where are you, bro?

0 Likes

Originally posted by: zeland from "CAL Programming Guide":

2.2.3 High Level Kernel Languages <...> For example, developers can use OpenCL to develop their kernels, then generate the equivalent ATI IL using offline tools provided by ATI. The generated ATI IL kernel then can be passed to the CAL compiler, with any required modifications, for generating the binary image. <...>

 

This seems to be a little diff than what the OP asked. The above doesn't explicitly state that you can reuse that image with OpenCL.

To me, the above means that you can generate the IL with OpenCL for "ease of use" and then tweak that IL and run it in CAL.

The OP is asking if he can create a kernel in CAL and then run it in OpenCL.

Though I could be misinterpreting things.

Though I do  have a question, will those OpenCL "optimizations" not be available in the CAL compiler?

Does this mean that non-hand tuned OpenCL should beat non-hand tuned CAL?

This seems backwards, IMO.



 

0 Likes

Thank you for your replies!

I was missing for some time, being upset after not seeing any replies for a long Since than I implemented CAL/IL version of my code, and yes, it runs almost *4* times faster!

After getting some experience w/ IL I used some (quite weird, BTW, for the ordinary logics) optimization techniques to OpenCL (backported so to say but it's still very far behind IL (approx. 2 times slower).

I still see no problems with feeding IL code to OpenCL as a binary, except for unspecified OpenCL kernel calling ABI which isn't too complex to simulate, IMHO. Anyway, I see no reason to disable OpenCL developers to use IL fragments one way or another, although support for this is obviously absent from OpenCL spec.

P.S. And yes, ryta1203 is right: originally I wanted to use IL code with the more user-friendly OpenCL host API, not vice versa.

0 Likes

Has anybody actually gotten this to work with clCreateProgramWithBinary?

0 Likes