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] Add TI_ADVANCED_OPTIMIZATION config env var #1212

Merged
merged 1 commit into from
Jun 12, 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
2 changes: 1 addition & 1 deletion docs/global_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Backends
Compilation
***********

- Disable advanced optimization to save compile time & possible erros: ``ti.core.toggle_advanced_optimization(False)``.
- Disable advanced optimization to save compile time & possible erros: ``ti.core.toggle_advanced_optimization(False)`` or ``export TI_ADVANCED_OPTIMIZATION=0``.
- To print intermediate IR generated: ``export TI_PRINT_IR=1`` or ``ti.init(print_ir=True)``.
- To print preprocessed Python code: ``export TI_PRINT_PREPROCESSED=1`` or ``ti.init(print_preprocessed=True)``..

Expand Down
4 changes: 4 additions & 0 deletions python/taichi/lang/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ def environ_config(key, cast=bool_int):
if len(gdb_trigger):
ti.set_gdb_trigger(bool(int(gdb_trigger)))

advanced_optimization = os.environ.get('TI_ADVANCED_OPTIMIZATION', '')
if len(advanced_optimization):
ti.core.toggle_advanced_optimization(bool(int(advanced_optimization)))

# Q: Why not environ_config("arch", ti.core.arch_from_name)?
# A: We need adaptive_arch_select for all.
env_arch = os.environ.get("TI_ARCH")
Expand Down