[RUNTIME] Remove Extension VTable in favor of Unified Object system. (#4578)
authorTianqi Chen <tqchen@users.noreply.github.com>
Wed, 25 Dec 2019 17:21:01 +0000 (09:21 -0800)
committerGitHub <noreply@github.com>
Wed, 25 Dec 2019 17:21:01 +0000 (09:21 -0800)
commite91cc5aba8f99ffe216a6188edf6818e1b87237f
tree901b3452680a815a8d10c008b0ff2bf876f88211
parentff65698f403de5404af0bb94f1bc5c45ef58d9a7
[RUNTIME] Remove Extension VTable in favor of Unified Object system. (#4578)

Before the unified object protocol, we support pass
additional extension objects around by declaring a type as an extension type.
The old extension mechanism requires the types to register their
constructor and deleter to a VTable and does not enjoy the benefit of the
self-contained deletion property of the new Object system.

This PR upgrades the extension example to make use of the new object system
and removed the old Extension VTable.

Note that the register_extension funtion in the python side continues to work
when the passed argument does not require explicit container copy/deletion,
which covers the current usecases of the extension mechanism.
apps/extension/Makefile
apps/extension/python/tvm_ext/__init__.py
apps/extension/src/tvm_ext.cc
include/tvm/runtime/c_runtime_api.h
include/tvm/runtime/packed_func.h
include/tvm/runtime/registry.h
python/tvm/_ffi/ndarray.py
python/tvm/ndarray.py
src/runtime/registry.cc
tests/cpp/packed_func_test.cc