Skip to content

Commit

Permalink
add metal to list of choices (apache#8282)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewZhaoLuo authored and ylc committed Jan 13, 2022
1 parent 3482232 commit f5aac35
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/tvm/driver/tvmc/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"""
import json
import logging
from typing import Optional, Dict, List, Union
from typing import Dict, List, Optional, Union

import numpy as np
import tvm
Expand All @@ -30,12 +30,11 @@
from tvm.relay.param_dict import load_param_dict

from . import common
from .model import TVMCPackage, TVMCResult
from .common import TVMCException
from .main import register_parser
from .model import TVMCPackage, TVMCResult
from .result_utils import get_top_results


# pylint: disable=invalid-name
logger = logging.getLogger("TVMC")

Expand All @@ -51,7 +50,7 @@ def add_run_parser(subparsers):
# like 'webgpu', etc (@leandron)
parser.add_argument(
"--device",
choices=["cpu", "cuda", "cl"],
choices=["cpu", "cuda", "cl", "metal"],
default="cpu",
help="target device to run the compiled module. Defaults to 'cpu'",
)
Expand Down Expand Up @@ -391,6 +390,8 @@ def run_module(
dev = session.cuda()
elif device == "cl":
dev = session.cl()
elif device == "metal":
dev = session.metal()
else:
assert device == "cpu"
dev = session.cpu()
Expand Down

0 comments on commit f5aac35

Please sign in to comment.