cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ryta1203
Journeyman III

amuasm/amudisasm and calclAssembleObject/calclDisassembleObject.

The documentation implies that the amuasm is the same as calclAssembleObject and that the amudisasm is the same as calcldDisassembleObject...

Given that, amuasm seems to assemble an image just fine WITHOUT any headers OR footers AND when spat back using amudisasm the output has the headers and footers put in.

Is this the same for calclAssembleObject and calclDisassembleObject?

0 Likes
22 Replies
ryta1203
Journeyman III

Anyone?

0 Likes

We used to ship the source for amuasm/amudisasm back in 1.0 or 1.1 but here is the basics of the application. Error checking has been removed for brevity.

amuasm:

 LoadTextFile(argv[1], &pText)

 CALresult result = CAL_RESULT_OK;

 CALobject obj;

 result = calclAssembleObject(&obj, 

CAL_PROGRAM_TYPE_PS, 

  (const CALchar*)pText, 

  (CALtarget)atoi( argv[ 3 ]) );

 CALimage image;

 calclLink(&image, &obj, 1);

 CALuint size;

 calclImageGetSize(&size, image);

 void* outbuffer = malloc(size);

 calclImageWrite(outbuffer, size, image);

 DumpToFile(argv[2], size, outbuffer);

amudism:
LoadImageFile(argv[1], img);
calclDisassembleImage(img, logFunction);
As you can see, these are simple tools with not much to them.


0 Likes

Micah,

  Thanks. So it can be assumed that the code generated by calclDisassembleObject can NOT be used as a kernel? Of course, I am refering to the process that I have described above of using the SKA to go from Brook+ to ISA and then Assemble and then Disassemble (or amuasm and amudisasm).

Is that an accurate statement?

0 Likes

code used from calclDisassembleObject should be able to be passed into calclAssembleObject, same with code from amudisasm should be able to passed into amuasm. If this is not the case then it is a bug and needs to be filed accordingly. Intermixing them is not something that has ever been tested as Images can contain multiple Objects and the disassembly from an Image might be different than that of an Object in the extra parameters. In theory they should be interchangable, but it is not guaranteed.

Now for using Brook+ and KSA to generate ISA to assemble/disassemble, this probably should not work. The reason is that KSA and CAL/Brook+ use different versions of the underlying compiler/assembler.

As I mentioned before, going the ISA route is not recommended because it is not tested or documented in a manner that will allow you write a full program without hitting major time sinks with hardware & software issues/constraints. It is mainly there for informational purposes and as feedback to tweak your higher level program. I've personally only used it on HD38XX in pixel shader mode over a year ago and that was just to do simple copy/alu kernels to test peak GPU performance.

0 Likes

Micah,

  Thanks again. I guess I am looking at the best/easiest way to code some VERY simple programs in ISA.

My bottom line question is this: Is there a way to do this (particularly get the header/footer added) without manually writing it?

Secondly, can we PLEASE get just ONE sample of using the ISA!?

0 Likes

I might be able to put a sample together next week, but that depends solely on whether I can get other work done first.

0 Likes

Originally posted by: MicahVillmow I might be able to put a sample together next week, but that depends solely on whether I can get other work done first.

This would be great!!

0 Likes

Ryta,

 There is a bug in the assembler for HD4XXX series of cards that causes the assembler to not work. The chances of this getting fixed anytime soon is very low as the assembler is not a high priority item.

0 Likes

We used to ship the source for amuasm/amudisasm back in 1.0 or 1.1 but here is the basics of the application. Error checking has been removed for brevity.

Edit: Removed advertising from post 

0 Likes

Originally posted by: MicahVillmow Ryta,

 There is a bug in the assembler for HD4XXX series of cards that causes the assembler to not work. The chances of this getting fixed anytime soon is very low as the assembler is not a high priority item.

Micah,

  Thanks for the quick feedback. So does this mean I am SOL? I won't be able to code in ISA at all? If the assembler doesn't work, how does IL code work?

0 Likes

These are different code paths.

0 Likes

Micah,

 So this exists only for HD4xxx cards.... meaning if I code for the R600 (2900xt for example) I should be fine, the assembler should work just fine?

  Sadly, if I go this route AMD has decided (by not allowing ISA coded kernels for HD4xxx cards) to make my 4870 and my 4850s obsolete. Where can I get a refund? LOL.

0 Likes

I'll try to test on a 3870 today,  but that is the card I used to program in ISA using the assembler.

0 Likes

Ryta, 

 It seems it is broken on the 3870 to now. I've filled a report on it, but as I mentioned earlier it is low priority.

0 Likes

Originally posted by: MicahVillmow Ryta, 

 It seems it is broken on the 3870 to now. I've filled a report on it, but as I mentioned earlier it is low priority.

This helps actually thanks, this probably means that it is not a hardware specific problem but that it's broke across the board.

It's too bad this is a low priority though, considering one of CALs selling points is being able to program in ISA... and since apparently you can't really do that it's no longer a selling point.

This wouldn't really be a problem but since you can't turn off optimizations in IL either....

0 Likes

Micah,

  Is there any way around this? For example, is there some other tool I can use to get the image file or something?

0 Likes

You can write a little program that saves the image files as binary elf files using the cal API.

0 Likes

Micah,

  I should probably know the answer to this but just to get things clear:

How do I get from ISA to the image files without using the broken assembler? Remember, I am trying to bypass the IL and it's optimizations. Also, is the amuasm broken also since it uses the same assembler? Meaning it would be impossible to use the amuasm->amudisasm to get working headers and footers (or at least a template since I'm just trying to right simply code)?

Essentially, just a little clearer explanation would be very helpful, thank you for your time.

0 Likes

Outside of writing your own assembler there is no way to get around it.

0 Likes

Originally posted by: MicahVillmow Outside of writing your own assembler there is no way to get around it.

LOL, yeah, I don't think I'm going to be doing that anytime soon.

0 Likes

Micah,

   now I am definitely confused.  I have read the following two threads.  First thread 93729 amuasm/amudisasm/r600asm, and this thread.  From the previous thread you stated you had used CalcAssemble object worked.  From
this thread it seems you are saying it doesn't work (?).  Or doesn't works for X cards.

  So does CalcAssemble object work at all ?

  If it does for which cards ?, and which release of the sdk?

  also the first thread mentioned r600asm ? where is this in the linux release ?

  Also I have been trying to find source of amuasm, and amudisasm. Are you sure it was released in 1.1 or 1.0.
 Download the sdk and grep through the files, did not install and didn't seem to find them.

                                 Thanks,

                                     Allen

 

0 Likes

micah, or anyone ?

bump

0 Likes