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

[cc] Add deprecation notice for cc backend #7651

Merged
merged 2 commits into from
Mar 25, 2023
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
5 changes: 5 additions & 0 deletions python/taichi/lang/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,11 @@ def init(arch=None,
raise KeyError(
"'default_up' is always the unsigned type of 'default_ip'. Please set 'default_ip' instead."
)

if arch == cc:
warnings.warn(
'ti.cc will be deprecated in favor of TiRT and its C API, if you still need it please let us know at https://github.com/taichi-dev/taichi/issues/7629.',
DeprecationWarning)
# Make a deepcopy in case these args reference to items from ti.cfg, which are
# actually references. If no copy is made and the args are indeed references,
# ti.reset() could override the args to their default values.
Expand Down
7 changes: 7 additions & 0 deletions tests/python/test_deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,10 @@ def run():
r"fill\(\) on ti.Struct is deprecated, and it will be removed in Taichi v1.6.0."
):
run()


@test_utils.test(arch=ti.cc)
def test_cc_deprecation():
ti.reset()
with pytest.warns(DeprecationWarning, match=r"ti.cc will be deprecated"):
ti.init(arch=ti.cc)