(self, device)
| 63 | return cls._instance |
| 64 | |
| 65 | def get_context(self, device): |
| 66 | if device.index not in self.context: |
| 67 | prev_device = torch.cuda.current_device() |
| 68 | torch.cuda.set_device(device) |
| 69 | self.context[device.index] = ct.c_void_p(lib.get_context()) |
| 70 | torch.cuda.set_device(prev_device) |
| 71 | return self.context[device.index] |
| 72 | |
| 73 | |
| 74 | FIRST_CUDA_DEVICE = torch.device("cuda", index=0) |
no outgoing calls
no test coverage detected