Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli] ti test --arch argument not work, fix it #764

Merged
merged 1 commit into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions python/taichi/lang/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,8 @@ def benchmark(func, repeat=100, args=()):
return elapsed / repeat


wanted_archs = None


def set_wanted_archs(archs):
global wanted_archs
wanted_archs = archs
os.environ['TI_WANTED_ARCHS'] = ','.join(archs)


def supported_archs():
Expand All @@ -254,7 +250,8 @@ def supported_archs():
archs.append(metal)
if ti.core.with_opengl():
archs.append(opengl)
if wanted_archs is not None:
wanted_archs = os.environ.get('TI_WANTED_ARCHS', '').split(',')
if len(wanted_archs):
archs, old_archs = [], archs
for arch in old_archs:
if ti.core.arch_name(arch) in wanted_archs:
Expand Down
1 change: 1 addition & 0 deletions python/taichi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def main(debug=False):
print()
import taichi as ti
if args.arch is not None:
print(f'Running on Arch={args.arch}')
ti.set_wanted_archs(args.arch.split(','))

if mode == 'help':
Expand Down