From 4c3fcb41acbe4cf16e829a56cd7c211e09e60f08 Mon Sep 17 00:00:00 2001 From: Matthew Barrett Date: Tue, 28 Jan 2020 17:13:33 +0000 Subject: [PATCH] [TIR] Create a StringImm reference type 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 b4787d6b0aed..93b04db7562a 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.