Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion 3rdparty/tvm-tirx
Submodule tvm-tirx updated 623 files
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ if(TVM_USE_INSTALLED_TIRX)
"TVM_OPENCL_DLL=__attribute__((visibility(\"default\")))")
endif()
endif()
if(NOT TVM_TIRX_VERSION STREQUAL "0.1.0a2")
message(FATAL_ERROR "TVM requires apache-tvm-tirx 0.1.0a2")
if(NOT TVM_TIRX_VERSION STREQUAL "0.1.0a4")
message(FATAL_ERROR "TVM requires apache-tvm-tirx 0.1.0a4")
endif()
else()
# Keep source-built core libraries beside the parent libraries.
Expand Down
1 change: 0 additions & 1 deletion apps/android_rpc/app/src/main/jni/tvm_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
#include "../3rdparty/tvm-tirx/src/runtime/tensor.cc"
#include "../3rdparty/tvm-tirx/src/runtime/thread_pool.cc"
#include "../3rdparty/tvm-tirx/src/runtime/threading_backend.cc"
#include "../3rdparty/tvm-tirx/src/runtime/workspace_pool.cc"
// clang-format on

#ifdef TVM_OPENCL_RUNTIME
Expand Down
14 changes: 7 additions & 7 deletions docs/arch/runtime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,35 +216,35 @@ We can also define subclass ``ObjectRef`` to hold each subtypes of ``Object``. E
RegisterReflection function.


Each ``Object`` subclass will override this to register its members. Here is an example implementation of IntImmNode.
Each ``Object`` subclass will override this to register its members. Here is an example implementation of IntImmObj.

.. code:: c

class IntImmNode : public PrimExprNode {
class IntImmObj : public PrimExprNode {
public:
/*! \brief the Internal value. */
int64_t value;

static void RegisterReflection() {
namespace refl = tvm::ffi::reflection;
refl::ObjectDef<IntImmNode>().def_ro("value", &IntImmNode::value);
refl::ObjectDef<IntImmObj>().def_ro("value", &IntImmObj::value);
}
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("ir.IntImm", IntImmNode, PrimExprNode);
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("ir.IntImm", IntImmObj, PrimExprNode);
};
// in cc file
TVM_FFI_STATIC_INIT_BLOCK() { IntImmNode::RegisterReflection(); }
TVM_FFI_STATIC_INIT_BLOCK() { IntImmObj::RegisterReflection(); }

The RegisterReflection gives us a reflection API to register each member of the object.
We can use this function to visit the node and serialize any language object recursively.
It also allows us to get members of an object easily in front-end language.
For example, we can access the value field of the IntImmNode.
For example, we can access the value field of the IntImmObj.

.. code:: python

import tvm

x = tvm_tirx.ir.IntImm("int32", 1)
# access the value field of IntImmNode
# access the value field of IntImmObj
print(x.value)

New ``Object`` can be added to C++ without changing the front-end runtime, making it easy to make extensions to the compiler stack.
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/relax/analysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ VarUsageInfo CollectVarUsage(const Expr& expr);
*
* \return A set of variable nodes that are used in the expression
*/
TVM_DLL std::set<const VarNode*> GetUsedVars(const Expr& expr);
TVM_DLL std::set<const VarObj*> GetUsedVars(const Expr& expr);

/*!
* \brief Remove unused statements inside DataflowBlocks.
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/relax/binding_rewrite.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class DataflowBlockRewriteObj : public ffi::Object {

DataflowBlock dfb_; //!< The rewritten dataflow block.
ffi::Optional<Function> root_fn_; //!< The rewritten function.
const FunctionNode* original_fn_ptr_; //!< Pointer to the original function.
const FunctionObj* original_fn_ptr_; //!< Pointer to the original function.
ffi::Map<Var, ffi::Array<Var>> to_users_; //!< Map from variable to its users.
ffi::Array<Var> fn_outputs_; //!< Variables required by function outputs.

Expand Down
Loading
Loading