Look-up table access in PTX Unclear Nvidia documentation

Hi everyone,

This is my first post on this fine forum.

Could anybody help with details on how to access a look-up table in PTX? The Nvidia documentation (PTX ISA 2.1) is definitely lacking in this area.

I am using the API driver mode.

The declaration and initialization works fine. I declare the table as follows:

.extern .const[1] .f32 Table[];

For accessing the elements I tried the following but it does not compile. Register %r1 holds the index of the desired element.

ld.const[1].f32  %Value, [Table+%r1];

The JIT compiler gives the following error: “Parsing error near ‘%r1’: syntax error”. I am surprised because I expected Table to be a constant address, most likely 0, so it should be treated by the PTX compiler as a constant offset.

A constant offset will work though.

ld.const[1].f32  %Value, [Table+4];

Any help is much appreciated.

Thank you!