[GCU] Support gcu platform (#2702)

baseline: e7fa57ebae

Co-authored-by: yongqiangma <xing.wo@163.com>
This commit is contained in:
EnflameGCU
2025-07-08 13:00:52 +08:00
committed by GitHub
parent 26d5d737dd
commit d0f4d6ba3a
33 changed files with 2988 additions and 85 deletions

View File

@@ -16,14 +16,24 @@
all backends methods
"""
from .xpu import *
from .npu import *
from fastdeploy.platforms import current_platform
__all__ = []
from . import npu
if hasattr(npu, '__all__'):
__all__.extend(npu.__all__)
from . import xpu
if hasattr(xpu, '__all__'):
__all__.extend(xpu.__all__)
if current_platform.is_xpu():
from . import xpu
from .xpu import *
if hasattr(xpu, '__all__'):
__all__.extend(xpu.__all__)
if current_platform.is_npu():
from . import npu
from .npu import *
if hasattr(npu, '__all__'):
__all__.extend(npu.__all__)
if current_platform.is_gcu():
from . import gcu
from .gcu import *
if hasattr(gcu, '__all__'):
__all__.extend(gcu.__all__)