Steps:
- I use Pytorch’s DEBUG build
- I debug this python program in clion IDE, and breakpoint at ‘b = torch.rand([10,20])’
import torch
if __name__ == "__main__":
a = torch.rand([10,20])
b = torch.rand([10,20])
c = a + b
print(c)
- I attach GDB to this program
- in gdb,
b at::native::Add
- continue gdb debugger
- continue python debugger
but at::native::Add cannot be hit, I want to know why and how to solve it (letting me debug the actual cpu kernel)
only at::Add can be hit, but after hitting it, it will dispatch the op, and I cannot step into some op impl like at::native::Add