Skip to content

Commit

Permalink
[Lang] Remove the deprecated dynamic_index switch (#7195)
Browse files Browse the repository at this point in the history
Issue: #2590

### Brief Summary

The `dynamic_index` switch of `ti.init()` should be removed according to
the [deprecation
notice](https://github.com/taichi-dev/taichi/releases/tag/v1.4.0).
  • Loading branch information
strongoier authored Jan 17, 2023
1 parent 30496a0 commit dfac43a
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 29 deletions.
7 changes: 1 addition & 6 deletions python/taichi/lang/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
The list of currently available extensions is ['sparse', 'quant', \
'mesh', 'quant_basic', 'data64', 'adstack', 'bls', 'assertion', \
'extfunc', 'dynamic_index'].
'extfunc'].
"""


Expand Down Expand Up @@ -360,11 +360,6 @@ def init(arch=None,
if require_version is not None:
check_require_version(require_version)

if "dynamic_index" in kwargs:
warnings.warn(
"Dynamic index is supported by default and the switch will be removed in v1.5.0.",
DeprecationWarning)

if "default_up" in kwargs:
raise KeyError(
"'default_up' is always the unsigned type of 'default_ip'. Please set 'default_ip' instead."
Expand Down
1 change: 0 additions & 1 deletion taichi/analysis/offline_cache_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ static std::vector<std::uint8_t> get_offline_cache_key_of_compile_config(
serializer(config->demote_no_access_mesh_fors);
serializer(config->experimental_auto_mesh_local);
serializer(config->auto_mesh_local_default_occupacy);
serializer(config->dynamic_index);
serializer(config->real_matrix_scalarize);
serializer.finalize();

Expand Down
2 changes: 0 additions & 2 deletions taichi/inc/extensions.inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ PER_EXTENSION(adstack) // For keeping the history of mutable local variables
PER_EXTENSION(bls) // Block-local storage
PER_EXTENSION(assertion) // Run-time asserts in Taichi kernels
PER_EXTENSION(extfunc) // Invoke external functions or backend source
PER_EXTENSION(
dynamic_index) // Dynamic index support for both global and local tensors
1 change: 0 additions & 1 deletion taichi/program/compile_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ CompileConfig::CompileConfig() {
gpu_max_reg = 0; // 0 means using the default value from the CUDA driver.
verbose = true;
fast_math = true;
dynamic_index = true;
flatten_if = false;
make_thread_local = true;
make_block_local = true;
Expand Down
1 change: 0 additions & 1 deletion taichi/program/compile_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ struct CompileConfig {
bool timeline{false};
bool verbose;
bool fast_math;
bool dynamic_index;
bool flatten_if;
bool make_thread_local;
bool make_block_local;
Expand Down
14 changes: 7 additions & 7 deletions taichi/program/extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ bool is_extension_supported(Arch arch, Extension ext) {
{Arch::x64,
{Extension::sparse, Extension::quant, Extension::quant_basic,
Extension::data64, Extension::adstack, Extension::assertion,
Extension::extfunc, Extension::dynamic_index, Extension::mesh}},
Extension::extfunc, Extension::mesh}},
{Arch::arm64,
{Extension::sparse, Extension::quant, Extension::quant_basic,
Extension::data64, Extension::adstack, Extension::assertion,
Extension::dynamic_index, Extension::mesh}},
Extension::mesh}},
{Arch::cuda,
{Extension::sparse, Extension::quant, Extension::quant_basic,
Extension::data64, Extension::adstack, Extension::bls,
Extension::assertion, Extension::dynamic_index, Extension::mesh}},
{Arch::metal, {Extension::dynamic_index}},
{Arch::opengl, {Extension::dynamic_index, Extension::extfunc}},
Extension::assertion, Extension::mesh}},
{Arch::metal, {}},
{Arch::opengl, {Extension::extfunc}},
{Arch::gles, {}},
{Arch::vulkan, {Extension::dynamic_index}},
{Arch::dx11, {Extension::dynamic_index}},
{Arch::vulkan, {}},
{Arch::dx11, {}},
{Arch::cc, {Extension::data64, Extension::extfunc, Extension::adstack}},
};
// if (with_opengl_extension_data64())
Expand Down
1 change: 0 additions & 1 deletion taichi/python/export_lang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ void export_lang(py::module &m) {
.def_readwrite("advanced_optimization",
&CompileConfig::advanced_optimization)
.def_readwrite("ad_stack_size", &CompileConfig::ad_stack_size)
.def_readwrite("dynamic_index", &CompileConfig::dynamic_index)
.def_readwrite("flatten_if", &CompileConfig::flatten_if)
.def_readwrite("make_thread_local", &CompileConfig::make_thread_local)
.def_readwrite("make_block_local", &CompileConfig::make_block_local)
Expand Down
10 changes: 0 additions & 10 deletions tests/python/test_deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,3 @@ def ker(tex: ti.types.rw_texture(num_dimensions=2, lod=0)):
for i, j in ti.ndrange(n, n):
ret = ti.cast(1, ti.f32)
tex.store(ti.Vector([i, j]), ti.Vector([ret, 0.0, 0.0, 0.0]))


@pytest.mark.parametrize("value", [True, False])
def test_deprecated_dynamic_index(value):
with pytest.warns(
DeprecationWarning,
match=
"Dynamic index is supported by default and the switch will be removed in v1.5.0."
):
ti.init(dynamic_index=value)

0 comments on commit dfac43a

Please sign in to comment.