Skip to content

Commit 7b885c2

Browse files
authored
[cc] Add deprecation notice for cc backend (#7651)
Issue: #7629 ### Brief Summary Adding notice to v1.5 release first to collect user feedback.
1 parent 9fa455c commit 7b885c2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

python/taichi/lang/misc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,11 @@ def init(arch=None,
369369
raise KeyError(
370370
"'default_up' is always the unsigned type of 'default_ip'. Please set 'default_ip' instead."
371371
)
372+
373+
if arch == cc:
374+
warnings.warn(
375+
'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.',
376+
DeprecationWarning)
372377
# Make a deepcopy in case these args reference to items from ti.cfg, which are
373378
# actually references. If no copy is made and the args are indeed references,
374379
# ti.reset() could override the args to their default values.

tests/python/test_deprecation.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,10 @@ def run():
280280
r"fill\(\) on ti.Struct is deprecated, and it will be removed in Taichi v1.6.0."
281281
):
282282
run()
283+
284+
285+
@test_utils.test(arch=ti.cc)
286+
def test_cc_deprecation():
287+
ti.reset()
288+
with pytest.warns(DeprecationWarning, match=r"ti.cc will be deprecated"):
289+
ti.init(arch=ti.cc)

0 commit comments

Comments
 (0)