Coverage for src / cufile_patcher / plugins / base.py: 100%
5 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-11 15:06 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-11 15:06 +0000
1from __future__ import annotations
3import ctypes
4from abc import ABC, abstractmethod
6from ..cufile_types import CUfileHandle_t
9class CuFileBackend(ABC):
10 """Interface for pluggable cuFile backend implementations."""
12 @abstractmethod
13 def driver_open(self) -> None:
14 ...
16 @abstractmethod
17 def driver_close(self) -> None:
18 ...
20 @abstractmethod
21 def handle_register(self, fd: int) -> CUfileHandle_t:
22 ...
24 @abstractmethod
25 def handle_deregister(self, handle: CUfileHandle_t) -> None:
26 ...
28 @abstractmethod
29 def read(
30 self,
31 handle: CUfileHandle_t,
32 buf: ctypes.c_void_p,
33 size: int,
34 file_offset: int,
35 dev_offset: int,
36 ) -> int:
37 ...
39 @abstractmethod
40 def write(
41 self,
42 handle: CUfileHandle_t,
43 buf: ctypes.c_void_p,
44 size: int,
45 file_offset: int,
46 dev_offset: int,
47 ) -> int:
48 ...