I’m not sure it still matters after almost a year, but for the record (and anyone getting here via a search for the error message):
The correct syntax for the asm statement is
asm("mov.u32 %0, %%smid;" : "=r"(ret) );
The double “%%” turns into a single % during parameter substitution, which then forms the correct %smid special register name. nvcc is more forgiving, leaving unknown escape sequences untouched, but clang complains about them.