Skip to content

Commit

Permalink
[cc] Add deprecation notice for cc backend (#7651)
Browse files Browse the repository at this point in the history
Issue: #7629 

### Brief Summary
Adding notice to v1.5 release first to collect user feedback.
  • Loading branch information
ailzhang authored Mar 25, 2023
1 parent 9fa455c commit 7b885c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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)

0 comments on commit 7b885c2

Please sign in to comment.