mirror of
https://github.com/sgjzfzzf/triton-tvm-ffi.git
synced 2026-07-01 08:51:56 +08:00
@@ -0,0 +1,3 @@
|
||||
from . import utils
|
||||
|
||||
__all__ = ["utils"]
|
||||
@@ -0,0 +1,7 @@
|
||||
from triton.backends.nvidia.compiler import CUDABackend
|
||||
|
||||
|
||||
class TVMFFIBackend(CUDABackend): ...
|
||||
|
||||
|
||||
del CUDABackend
|
||||
@@ -0,0 +1,20 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type
|
||||
from triton.backends.nvidia.driver import CudaDriver
|
||||
|
||||
|
||||
class TVMFFIUtils(object):
|
||||
def __new__(cls: Type[TVMFFIUtils]) -> TVMFFIUtils:
|
||||
if not hasattr(cls, "instance"):
|
||||
cls.instance = super().__new__(cls)
|
||||
return cls.instance
|
||||
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
|
||||
class TVMFFIDriver(CudaDriver): ...
|
||||
|
||||
|
||||
del CudaDriver
|
||||
@@ -0,0 +1,11 @@
|
||||
# tvm-ffi-stubgen(begin): export/_ffi_api
|
||||
# fmt: off
|
||||
# isort: off
|
||||
from ._ffi_api import * # noqa: F403
|
||||
from ._ffi_api import __all__ as _ffi_api__all__
|
||||
if "__all__" not in globals():
|
||||
__all__ = []
|
||||
__all__.extend(_ffi_api__all__)
|
||||
# isort: on
|
||||
# fmt: on
|
||||
# tvm-ffi-stubgen(end)
|
||||
@@ -0,0 +1,26 @@
|
||||
# tvm-ffi-stubgen(begin): import-section
|
||||
# fmt: off
|
||||
# isort: off
|
||||
from __future__ import annotations
|
||||
from tvm_ffi import init_ffi_api as _FFI_INIT_FUNC
|
||||
from tvm_ffi.libinfo import load_lib_module as _FFI_LOAD_LIB
|
||||
from typing import TYPE_CHECKING
|
||||
# isort: on
|
||||
# fmt: on
|
||||
# tvm-ffi-stubgen(end)
|
||||
# tvm-ffi-stubgen(import-object): tvm_ffi.libinfo.load_lib_module;False;_FFI_LOAD_LIB
|
||||
LIB = _FFI_LOAD_LIB("triton_tvm_ffi", "utils")
|
||||
# tvm-ffi-stubgen(begin): global/triton_tvm_ffi.utils
|
||||
# fmt: off
|
||||
_FFI_INIT_FUNC("triton_tvm_ffi.utils", __name__)
|
||||
if TYPE_CHECKING:
|
||||
def hello() -> None: ...
|
||||
# fmt: on
|
||||
# tvm-ffi-stubgen(end)
|
||||
|
||||
__all__ = [
|
||||
# tvm-ffi-stubgen(begin): __all__
|
||||
"LIB",
|
||||
"hello",
|
||||
# tvm-ffi-stubgen(end)
|
||||
]
|
||||
Reference in New Issue
Block a user