Skip to content

Commit c39ab93

Browse files
authored
[TIR] Create a StringImm reference type (apache#4806)
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
1 parent bb1b7db commit c39ab93

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/tvm/tir/expr.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ class StringImmNode : public PrimExprNode {
337337
TVM_DECLARE_FINAL_OBJECT_INFO(StringImmNode, PrimExprNode);
338338
};
339339

340+
class StringImm : public PrimExpr {
341+
public:
342+
TVM_DEFINE_OBJECT_REF_METHODS(StringImm, PrimExpr, StringImmNode);
343+
};
344+
340345
/*!
341346
* \brief Cast value from one data type to another.
342347
* \note The lanes of value should keep fixed.

0 commit comments

Comments
 (0)