On which SM is my thread block running?

How can I find out on which SM is some thread block executed?

Alternatively, is there a way to set “affinity” to force some thread block to be scheduled on a given SM?

Check out this thread: any way to know on which SM a thread is running?.

I don’t think there is any way to set an affinity.

thanks so much for the pointer!