Unverified Commit 9d76391f authored by Yang Yong (雍洋)'s avatar Yang Yong (雍洋) Committed by GitHub
Browse files

Add lightx2v_platform test case (#542)

parent b50498fa
import os
"""
PYTHONPATH=/path-to-LightX2V PLATFORM=cuda python test_device.py
PYTHONPATH=/path-to-LightX2V PLATFORM=mlu python test_device.py
PYTHONPATH=/path-to-LightX2V PLATFORM=metax python test_device.py
"""
from lightx2v_platform import *
# This import will initialize the AI device
import lightx2v_platform.set_ai_device # noqa: F401
from lightx2v_platform.base.global_var import AI_DEVICE
init_ai_device(os.getenv("AI_DEVICE", "cuda"))
from lightx2v_platform.base.global_var import AI_DEVICE # noqa E402
if __name__ == "__main__":
print(f"AI_DEVICE : {AI_DEVICE}")
is_available = check_ai_device(AI_DEVICE)
print(f"Device available: {is_available}")
print(f"AI_DEVICE: {AI_DEVICE}")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment