From commits-return-13022-archive-asf-public=cust-asf.ponee.io@tvm.apache.org Thu May 7 01:15:38 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2C6F118064F for ; Thu, 7 May 2020 03:15:38 +0200 (CEST) Received: (qmail 36104 invoked by uid 500); 7 May 2020 01:15:37 -0000 Mailing-List: contact commits-help@tvm.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tvm.apache.org Delivered-To: mailing list commits@tvm.apache.org Received: (qmail 36095 invoked by uid 99); 7 May 2020 01:15:37 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2020 01:15:37 +0000 From: =?utf-8?q?GitBox?= To: commits@tvm.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bincubator-tvm=5D_tqchen_commented_on_a_change_in_p?= =?utf-8?q?ull_request_=235533=3A_Cache_ObjectPtr=3CPrimExprNode=3E_instead_?= =?utf-8?q?of_raw_pointers_in_bound_analyzer?= Message-ID: <158881413736.26397.3270192952602400484.asfpy@gitbox.apache.org> Date: Thu, 07 May 2020 01:15:37 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit References: In-Reply-To: tqchen commented on a change in pull request #5533: URL: https://github.com/apache/incubator-tvm/pull/5533#discussion_r421182429 ########## File path: include/tvm/runtime/object.h ########## @@ -350,6 +350,39 @@ inline RelayRefType GetRef(const ObjectType* ptr); template inline SubRef Downcast(BaseRef ref); +template class ObjectPtr; + +/*! + * \brief Get an object ptr type from a raw object ptr. + * + * \param ptr The object pointer + * \tparam BaseType The reference type + * \tparam ObjectType The object type + * \return The corresponding ObjectPtr type + */ +template ::value, int>::type = 0> +inline ObjectPtr GetObjectPtr(ObjectType* ptr); + +/*! + * \brief Get an object ptr type from a raw object ptr. + * + * \param ptr The object pointer + * \tparam ObjectType The object type + * \return The corresponding ObjectPtr type + */ +template +inline ObjectPtr GetObjectPtr(ObjectType* ptr); Review comment: That is what I mean, we should use GetObjectPtr as it is not a quite frequently used feature ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org