typo error in test demo code

8 views
Skip to first unread message

Jianbin Fang

unread,
May 15, 2012, 6:11:02 PM5/15/12
to asfermi
Hi guys,

I am still trying the code in /svn/test/....

When reading the code in '1' (there are 4 test demo code in the test
directory), I find that there is possibly an typo error on line 27:

--
27 IMAD R10, R5, 0x14, R10;
--

I guess it should be like this:

--
27 IMAD R10, R5, 0x4, R10;
--

It is correct? Or I misunderstood the code?


Another question about how to measure the number of cycle one
instruction takes for execution? In my option, it should be like this
(using the special register SR_ClockLo):
....
S2R R0, SR_ClockLo
ST.E [Rx], Ry // Rx, and Ry are specified registers
S2R R1, SR_ClockLo
...

When outputing the R0, R1, we can obtain the number of cycles (the
store instruction takes) by subtracting R0 from R1.

Is it correct?


Thanks,

Jianbin

Hou Yunqing

unread,
May 15, 2012, 11:01:50 PM5/15/12
to asf...@googlegroups.com
Hi Jianbin,

Yes you probably misunderstood that test. And it's not meant to be understood anyway. I used that folder as file storage for a while before switching to an independent repository for file storage purposes. In that test it's meant to be 0x14, because the first thread in each warp writes 20 bytes to global memory, so it calculates its output address = base address (R10) + WarpID(R5)*20.

As for instruction latencies, well some people here have some data but to my knowledge no one has published something that's relatively complete. You can take a look here first. Look towards the second half of that discussion.

Best Regards,
Yunqing
Reply all
Reply to author
Forward
0 new messages