From c39ab93d69ec7d2553446ba9a31055dd5e4579e8 Mon Sep 17 00:00:00 2001 From: mbarrett97 <55580676+mbarrett97@users.noreply.github.com> Date: Mon, 3 Feb 2020 17:55:43 +0000 Subject: [PATCH] [TIR] Create a StringImm reference type (#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 --- include/tvm/tir/expr.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/tvm/tir/expr.h b/include/tvm/tir/expr.h index b4787d6..93b04db 100644 --- a/include/tvm/tir/expr.h +++ b/include/tvm/tir/expr.h @@ -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. -- 2.7.4