.version 6.5
.target sm_30
.address_size 64

.visible .entry tid(
	.param .u64 output
)
{
	.reg .u64 	     out_addr;
    .reg .u32        thread_id;
    .reg .u64        thread_id_u64;

    .reg .u8        thread_id_u8;

    mov.u32          thread_id, %tid.x;
    cvt.u64.u32      thread_id_u64, thread_id;
    cvt.u8.u32       thread_id_u8, thread_id;

    ld.param.u64 	 out_addr, [output];

    add.u64          out_addr, out_addr, thread_id_u64;
    st.u8            [out_addr], thread_id_u8;

	ret;
}
