cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

corry
Adept III

Am I stupid with IL macros or what?

Obviously, standard IL/Open CL statements apply....

I'm seriously questioning the integrity of the installed software base on this machine now. 

Here's a simple example, no need for attached code...

il_cs_2_0
mdef(0)_out(1)_in(1)
iand out0, r1, r2
mend
mcall(0) (r5), (r8)
ret
end

This results in the error message "Unknown Error Compiler Shader"

WTF?  Try putting in endmain, just for fun, same result. 

Get rid out out0 and just replace it with r0, everything is happy!, try adding a line then, mov out0, r0, "Unknown Error Compiler Shader" again....ok, so it's like the  output params don't work, fine, lets try the inputs, change the above line from iand r0, in0, r2 and you guessed it "Unknown Error Compiler Shader". 

Just to make sure, I uninstalled anything that said AMD or ATi, rebooted, reinstalled, rebooted, and tried again.  Exact same results.  Originally I started with a byteswap macro, so I can look later and see if I can come up with a clever combination of logical and "multimedia" instructions to do the same for me later, then I started cutting stuff down, till I emptied it, and everything was happy again...then got to what I posted...

Am I missing something really obvious?  It sure feels like I am...

Just for the sake of reference, I did decide to check if I had the latest IL doc, I didn't, so I'm now using the v2.3 from July 2011, tried the example code (with some minor fixes so it wouldn't spit out text interpretation errors....switch to lower case, and remove an erreonous comma...), and I get the same error...

0 Likes
4 Replies

All macros must be defined before il_cs_2_0.

il_cs_2_0 is basically the mainfunc instruction and thus you cannot define a macro inside of a function.
0 Likes

Funny, the first several hundred times through the document, I saw "All definitions must be preceded by the IL-language token" not what is actually there which is "All definitions must precede the IL-language token"....amazing how your mind sees what it wants to...

(edited to paste as plain text...trying again...)

0 Likes

corry,
Your best bet to learn what is wrong is to see the output the OpenCL compiler via the Shader Kernel Analyzer tool. It can compile from CL to IL and then you can see how things are used.
0 Likes

Thats actually what I have been doing 🙂  I knew it was a detail I somehow missed, I just couldn't figure out which one.  Like I said though, I read that section wrong I don't know how many times.  When I saw a macro at the top of the file, it translated in my head to near the top of  the file, "since of course, the language declaration has to be at the very top...", or so was my thinking...

I started with that though, because there are sections of this I'm not too keen on writing from scratch in IL.  A grand total of about 0.00001% of the time will be spent in the algorithm setup and teardown functions, so why worry about how optimized it is....10% faster there will net me a 0.000001% performance increase...I'm not too concerened about that little piece 🙂

0 Likes