diff --git a/python/taichi/lang/misc.py b/python/taichi/lang/misc.py index 7b43609fc2900..96818840be690 100644 --- a/python/taichi/lang/misc.py +++ b/python/taichi/lang/misc.py @@ -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. diff --git a/tests/python/test_deprecation.py b/tests/python/test_deprecation.py index 9e529668c579b..426e7aa105cb6 100644 --- a/tests/python/test_deprecation.py +++ b/tests/python/test_deprecation.py @@ -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)