File size: 1,108 Bytes
d1ceb73 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# mypy: allow-untyped-defs
from abc import ABC, abstractmethod
class _StreamBase(ABC):
r"""Base stream class abstraction for multi backends Stream to herit from"""
@abstractmethod
def wait_event(self, event) -> None:
raise NotImplementedError
@abstractmethod
def wait_stream(self, stream) -> None:
raise NotImplementedError
@abstractmethod
def record_event(self, event=None) -> None:
raise NotImplementedError
@abstractmethod
def query(self) -> bool:
raise NotImplementedError
@abstractmethod
def synchronize(self) -> None:
raise NotImplementedError
@abstractmethod
def __eq__(self, stream) -> bool:
raise NotImplementedError
class _EventBase(ABC):
r"""Base Event class abstraction for multi backends Event to herit from"""
@abstractmethod
def wait(self, stream=None) -> None:
raise NotImplementedError
@abstractmethod
def query(self) -> bool:
raise NotImplementedError
@abstractmethod
def synchronize(self) -> None:
raise NotImplementedError
|