Skip to content

Commit

Permalink
[TIR] Create a StringImm reference type (apache#4806)
Browse files Browse the repository at this point in the history
This is motivated by the want to send an
array of strings across the python/C++
boundary. Arrays only support ObjectRef types
and so can't carry StringImmNodes. This creates
a string reference type, StringImm, which can
be used with tvm::Arrays.

Change-Id: I598a44536c156b97dbfe3e9518e0a1f705da850c
  • Loading branch information
mbaret authored and zhiics committed Mar 2, 2020
1 parent 349e5ec commit d64dbbf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/tvm/tir/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,11 @@ class StringImmNode : public PrimExprNode {
TVM_DECLARE_FINAL_OBJECT_INFO(StringImmNode, PrimExprNode);
};

class StringImm : public PrimExpr {
public:
TVM_DEFINE_OBJECT_REF_METHODS(StringImm, PrimExpr, StringImmNode);
};

/*!
* \brief Cast value from one data type to another.
* \note The lanes of value should keep fixed.
Expand Down

0 comments on commit d64dbbf

Please sign in to comment.