MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / get_context

Method get_context

bitsandbytes/functional.py:65–71  ·  view source on GitHub ↗
(self, device)

Source from the content-addressed store, hash-verified

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
74FIRST_CUDA_DEVICE = torch.device("cuda", index=0)

Callers 3

igemmFunction · 0.80
batched_igemmFunction · 0.80
_int8_linear_matmul_implFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected