From commits-return-14776-archive-asf-public=cust-asf.ponee.io@tvm.apache.org Sun Jun 7 20:21:41 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 24AC218065B for ; Sun, 7 Jun 2020 22:21:41 +0200 (CEST) Received: (qmail 54755 invoked by uid 500); 7 Jun 2020 20:21:40 -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 54746 invoked by uid 99); 7 Jun 2020 20:21:40 -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; Sun, 07 Jun 2020 20:21:40 +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_=235743=3A_=5BREFACTOR=5D=5BTE=5D=5BTIR=5D_Call=3A=3A?= =?utf-8?q?Halide_=3D=3E_ProducerLoad=2C_DSL/TIR_decouple=2E?= Message-ID: <159156130041.17834.7704227227317184551.asfpy@gitbox.apache.org> Date: Sun, 07 Jun 2020 20:21:40 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit References: In-Reply-To: tqchen commented on a change in pull request #5743: URL: https://github.com/apache/incubator-tvm/pull/5743#discussion_r436398419 ########## File path: include/tvm/tir/expr.h ########## @@ -449,12 +449,64 @@ class BufferLoadNode : public PrimExprNode { TVM_DECLARE_FINAL_OBJECT_INFO(BufferLoadNode, PrimExprNode); }; +/*! + * \brief Managed reference to BufferLoadNode. + * \sa BufferLoadNode + */ class BufferLoad : public PrimExpr { public: TVM_DLL explicit BufferLoad(Buffer buffer, Array indices); TVM_DEFINE_OBJECT_REF_METHODS(BufferLoad, PrimExpr, BufferLoadNode); }; +/*! + * \brief Load value from the result produced by the producer. + * + * \note This node only appears in high-level DSLs that are built on top of the TIR. + * It should not appear in a valid TIR PrimFunc. A high-level DSL needs to lower + * this node before TIR transformations. + * + * \sa ProducerLoad, DataProducerNode + */ +class ProducerLoadNode : public PrimExprNode { + public: + /*! \brief The buffer producer. */ + DataProducer producer; + /*! \brief The location arguments. */ + Array indices; + + void VisitAttrs(AttrVisitor* v) { + v->Visit("dtype", &(this->dtype)); + v->Visit("producer", &producer); + v->Visit("indices", &indices); + } + + bool SEqualReduce(const ProducerLoadNode* other, SEqualReducer equal) const { + return equal(dtype, other->dtype) && equal(producer, other->producer) && + equal(indices, other->indices); + } + + void SHashReduce(SHashReducer hash_reduce) const { + hash_reduce(dtype); + hash_reduce(producer); + hash_reduce(indices); + } + Review comment: these properties are already true for subclass of PrimExpr(they are set in BaseExpr) ---------------------------------------------------------------- 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