tags:

views:

83

answers:

1

I would like to be able to use a feature in PTX 1.3 which is not yet implemented it the C interface. Is there a way to write my own function in PTX and inject into an existing binary?

The feature I'm looking for is getting the value of %smid

+2  A: 

The answer:

__noinline__ __device__ uint get_smid(void)
{
    uint ret;
    asm("mov.u32 %0, %smid;" : "=r"(ret) );
    return ret;
}
shoosh