visibility what thread contains to what SM


to finish our project we need to know on what SM each thread is running.
do annyone know how we could solve this problem?


Search the forums for “smid”.

static __device__ __inline__ uint32_t __smid()
    uint32_t smid;
    asm volatile("mov.u32 %0, %%smid;" : "=r"(smid));
    return smid;

when i stand the ptx-dukumentation right the smid could change at running time.
is there any other possibility to have a look at all threads, (not change any id’s)?



As of CUDA 5.5 a thread block may change SMs if the kernel is using CUDA Dynamic Parallelism or if the application is using the Nsight Visual Studio Edition CUDA debugger in pre-emption mode. Future versions of CUDA may change location on other events.

What is the use case that requires knowing which SM a particular thread is running on?