|
| 1 | +from typing import Optional, Tuple, Union |
| 2 | +import ctypes |
| 3 | +from .. import device as _device |
| 4 | + |
| 5 | +def is_available() -> bool: ... |
| 6 | +def init() -> None: ... |
| 7 | + |
| 8 | +class cudaStatus: |
| 9 | + SUCCESS: int |
| 10 | + ERROR_NOT_READY: int |
| 11 | + |
| 12 | +class CudaError: |
| 13 | + def __init__(self, code: int) -> None: ... |
| 14 | + |
| 15 | +class _CudaDeviceProperties: |
| 16 | + name: str |
| 17 | + major: int |
| 18 | + minor: int |
| 19 | + multi_processor_count: int |
| 20 | + total_memory: int |
| 21 | + is_integrated: int |
| 22 | + is_multi_gpu_board: int |
| 23 | + |
| 24 | +_device_t = Union[_device, int] |
| 25 | + |
| 26 | +def check_error(res: int) -> None: ... |
| 27 | +def device_count() -> int: ... |
| 28 | +def empty_cache() -> None: ... |
| 29 | +def synchronize(device: _device_t) -> None: ... |
| 30 | +def set_device(device: _device_t) -> None: ... |
| 31 | +def get_device_capability(device: Optional[_device_t]=...) -> Tuple[int, int]: ... |
| 32 | +def get_device_name(device: Optional[_device_t]=...) -> str: ... |
| 33 | +def get_device_properties(device: _device_t) -> _CudaDeviceProperties: ... |
| 34 | +def current_device() -> int: ... |
| 35 | +def memory_allocated(device: Optional[_device_t]=...) -> int: ... |
| 36 | +def max_memory_allocated(device: Optional[_device_t]=...) -> int: ... |
| 37 | +def reset_max_memory_allocated(device: Optional[_device_t]=...) -> None: ... |
| 38 | +def memory_cached(device: Optional[_device_t]=...) -> int: ... |
| 39 | +def max_memory_cached(device: Optional[_device_t]=...) -> int: ... |
| 40 | +def reset_max_memory_cached(device: Optional[_device_t]=...) -> None: ... |
| 41 | +def cudart() -> ctypes.CDLL: ... |
| 42 | +def find_cuda_windows_lib() -> Optional[ctypes.CDLL]: ... |
| 43 | +def set_rng_state(new_state): ... |
| 44 | +def get_rng_state(): ... |
| 45 | + |
| 46 | +def manual_seed(seed: int): ... |
| 47 | +def manual_seed_all(seed: int): ... |
0 commit comments