# SPDX-License-Identifier: Apache-2.0

class gds_device_buffer:
    def __init__(self, devPtr_base: int, length: int, use_cuda: bool) -> None: ...
    def cufile_register(self, offset: int, length: int) -> int: ...
    def cufile_deregister(self, offset: int) -> int: ...
    def memmove(
        self, dst_off: int, src_off: int, tmp: "gds_device_buffer", length: int
    ) -> int: ...
    def get_base_address(self) -> int: ...
    def get_length(self) -> int: ...

class nogds_file_reader:
    def __init__(
        self,
        use_mmap: bool,
        bbuf_size_kb: int,
        max_threads: int,
        use_cuda: bool,
        device_id: int,
    ) -> None: ...
    def submit_read(
        self, fd: int, dst: gds_device_buffer, offset: int, length: int, ptr_off: int
    ) -> int: ...
    def wait_read(self, thread_id: int) -> int: ...

class gds_file_handle:
    def __init__(self, filename: str, o_direct: bool, use_cuda: bool) -> None: ...

class gds_file_reader:
    def __init__(self, max_threads: int, use_cuda: bool, device_id: int) -> None: ...
    def submit_read(
        self,
        fh: gds_file_handle,
        dst: gds_device_buffer,
        offset: int,
        length: int,
        ptr_off: int,
        file_length: int,
    ) -> int: ...
    def wait_read(self, id: int) -> int: ...

class cpp_metrics:
    bounce_buffer_bytes: int

    def __init__(self) -> None: ...

def is_cuda_found() -> bool: ...
def is_cufile_found() -> bool: ...
def cufile_version() -> int: ...
def get_alignment_size() -> int: ...
def set_debug_log(debug_log: bool) -> None: ...
def is_gds_supported(deviceId: int) -> int: ...
def init_gds() -> int: ...
def close_gds() -> int: ...
def get_device_pci_bus(deviceId: int) -> str: ...
def set_numa_node(numa_node: int) -> int: ...
def read_buffer(dst: int, length: int) -> bytes: ...
def cpu_malloc(length: int) -> int: ...
def cpu_free(addr: int) -> None: ...
def gpu_malloc(length: int) -> int: ...
def gpu_free(addr: int) -> None: ...
def load_library_functions() -> None: ...
def get_cpp_metrics() -> cpp_metrics: ...
def set_gil_release(gil_release: bool) -> None: ...
def get_gil_release() -> bool: ...
