|
29 | 29 | #include <string> |
30 | 30 | #include <type_traits> |
31 | 31 | #include <utility> |
32 | | -#include <vector> |
33 | 32 |
|
34 | 33 | namespace tvm { |
35 | 34 | namespace tir { |
@@ -335,124 +334,6 @@ class BufferRealize : public Stmt { |
335 | 334 | TVM_DEFINE_OBJECT_REF_COW_METHOD(BufferRealizeNode); |
336 | 335 | }; |
337 | 336 |
|
338 | | -/*! |
339 | | - * \brief Store value into mult-dimensional array that will be read by the consumer |
340 | | - * of the producer. |
341 | | - * |
342 | | - * \note This node only appears in high-level DSLs that are built on top of the TIR. |
343 | | - * It should not appear in a valid TIR PrimFunc. A high-level DSL needs to lower |
344 | | - * this node before TIR transformations. |
345 | | - * |
346 | | - * \sa DataProducer |
347 | | - */ |
348 | | -class ProducerStoreNode : public StmtNode { |
349 | | - public: |
350 | | - /*! \brief The producer to store the results into. */ |
351 | | - DataProducer producer; |
352 | | - /*! \brief The value to be stored. */ |
353 | | - PrimExpr value; |
354 | | - /*! \brief The index arguments of the function. */ |
355 | | - Array<PrimExpr> indices; |
356 | | - |
357 | | - void VisitAttrs(AttrVisitor* v) { |
358 | | - v->Visit("producer", &producer); |
359 | | - v->Visit("value", &value); |
360 | | - v->Visit("indices", &indices); |
361 | | - v->Visit("span", &span); |
362 | | - } |
363 | | - |
364 | | - bool SEqualReduce(const ProducerStoreNode* other, SEqualReducer equal) const { |
365 | | - return equal(producer, other->producer) && equal(value, other->value) && |
366 | | - equal(indices, other->indices); |
367 | | - } |
368 | | - |
369 | | - void SHashReduce(SHashReducer hash_reduce) const { |
370 | | - hash_reduce(producer); |
371 | | - hash_reduce(value); |
372 | | - hash_reduce(indices); |
373 | | - } |
374 | | - |
375 | | - static constexpr const char* _type_key = "tir.ProducerStore"; |
376 | | - TVM_DECLARE_FINAL_OBJECT_INFO(ProducerStoreNode, StmtNode); |
377 | | -}; |
378 | | - |
379 | | -/*! |
380 | | - * \brief Managed reference to ProducerStoreNode. |
381 | | - * \sa ProducerStoreNode |
382 | | - */ |
383 | | -class ProducerStore : public Stmt { |
384 | | - public: |
385 | | - TVM_DLL ProducerStore(DataProducer producer, PrimExpr value, Array<PrimExpr> indices, |
386 | | - Span span = Span()); |
387 | | - |
388 | | - TVM_DEFINE_OBJECT_REF_METHODS(ProducerStore, Stmt, ProducerStoreNode); |
389 | | - TVM_DEFINE_OBJECT_REF_COW_METHOD(ProducerStoreNode); |
390 | | -}; |
391 | | - |
392 | | -/*! |
393 | | - * \brief Annotate the bounds where the data produced by the producer |
394 | | - * need to be written and read in body. |
395 | | - * We will need to allocate space for the corresponding regions. |
396 | | - * |
397 | | - * \note This node only appears in high-level DSLs that are built on top of the TIR. |
398 | | - * It should not appear in a valid TIR PrimFunc. A high-level DSL needs to lower |
399 | | - * this node before TIR transformations. |
400 | | - * |
401 | | - * \sa DataProducer |
402 | | - */ |
403 | | -class ProducerRealizeNode : public StmtNode { |
404 | | - public: |
405 | | - /*! \brief The producer that produces the data. */ |
406 | | - DataProducer producer; |
407 | | - /*! \brief Bounds to be realized. */ |
408 | | - Region bounds; |
409 | | - /*! \brief Only realize if condition holds. */ |
410 | | - PrimExpr condition; |
411 | | - /*! \brief The body of realization. */ |
412 | | - Stmt body; |
413 | | - /*! \brief The storage scope associated with this realization. */ |
414 | | - String storage_scope; |
415 | | - |
416 | | - void VisitAttrs(AttrVisitor* v) { |
417 | | - v->Visit("producer", &producer); |
418 | | - v->Visit("bounds", &bounds); |
419 | | - v->Visit("condition", &condition); |
420 | | - v->Visit("body", &body); |
421 | | - v->Visit("storage_scope", &storage_scope); |
422 | | - v->Visit("span", &span); |
423 | | - } |
424 | | - |
425 | | - bool SEqualReduce(const ProducerRealizeNode* other, SEqualReducer equal) const { |
426 | | - return equal(producer, other->producer) && equal(bounds, other->bounds) && |
427 | | - equal(condition, other->condition) && equal(body, other->body) && |
428 | | - equal(storage_scope, other->storage_scope); |
429 | | - } |
430 | | - |
431 | | - void SHashReduce(SHashReducer hash_reduce) const { |
432 | | - hash_reduce(producer); |
433 | | - hash_reduce(bounds); |
434 | | - hash_reduce(condition); |
435 | | - hash_reduce(body); |
436 | | - hash_reduce(storage_scope); |
437 | | - } |
438 | | - |
439 | | - static constexpr const char* _type_key = "tir.ProducerRealize"; |
440 | | - TVM_DECLARE_FINAL_OBJECT_INFO(ProducerRealizeNode, StmtNode); |
441 | | -}; |
442 | | - |
443 | | -/*! |
444 | | - * \brief Managed reference to ProducerRealizeNode. |
445 | | - * \sa ProducerRealizeNode |
446 | | - */ |
447 | | -class ProducerRealize : public Stmt { |
448 | | - public: |
449 | | - TVM_DLL ProducerRealize(DataProducer producer, Region bounds, PrimExpr condition, Stmt body, |
450 | | - String storage_scope = "", Span span = Span()); |
451 | | - |
452 | | - TVM_DEFINE_OBJECT_REF_METHODS(ProducerRealize, Stmt, ProducerRealizeNode); |
453 | | - TVM_DEFINE_OBJECT_REF_COW_METHOD(ProducerRealizeNode); |
454 | | -}; |
455 | | - |
456 | 337 | /*! |
457 | 338 | * \brief Allocate a buffer that can be used in body. |
458 | 339 | */ |
@@ -1090,51 +971,6 @@ class While : public Stmt { |
1090 | 971 | TVM_DEFINE_OBJECT_REF_COW_METHOD(WhileNode); |
1091 | 972 | }; |
1092 | 973 |
|
1093 | | -/*! |
1094 | | - * \brief A prefetch hint for a buffer |
1095 | | - */ |
1096 | | -class PrefetchNode : public StmtNode { |
1097 | | - public: |
1098 | | - /*! \brief The function to be prefetched. */ |
1099 | | - Buffer buffer; |
1100 | | - /*! \brief Bounds to be prefetched. */ |
1101 | | - Array<Range> bounds; |
1102 | | - |
1103 | | - void VisitAttrs(AttrVisitor* v) { |
1104 | | - v->Visit("buffer", &buffer); |
1105 | | - v->Visit("bounds", &bounds); |
1106 | | - v->Visit("span", &span); |
1107 | | - } |
1108 | | - |
1109 | | - bool SEqualReduce(const PrefetchNode* other, SEqualReducer equal) const { |
1110 | | - return equal(buffer, other->buffer) && equal(bounds, other->bounds); |
1111 | | - } |
1112 | | - |
1113 | | - void SHashReduce(SHashReducer hash_reduce) const { |
1114 | | - hash_reduce(buffer); |
1115 | | - hash_reduce(bounds); |
1116 | | - } |
1117 | | - |
1118 | | - PrefetchNode() = default; |
1119 | | - PrefetchNode(Buffer buffer, Array<Range> bounds, Span span = Span()) |
1120 | | - : StmtNode(span), buffer(buffer), bounds(bounds) {} |
1121 | | - |
1122 | | - static constexpr const char* _type_key = "tir.Prefetch"; |
1123 | | - TVM_DECLARE_FINAL_OBJECT_INFO(PrefetchNode, StmtNode); |
1124 | | -}; |
1125 | | - |
1126 | | -/*! |
1127 | | - * \brief Managed reference to PrefetchNode. |
1128 | | - * \sa PrefetchNode |
1129 | | - */ |
1130 | | -class Prefetch : public Stmt { |
1131 | | - public: |
1132 | | - TVM_DLL explicit Prefetch(Buffer buffer, Array<Range> bounds, Span span = Span()); |
1133 | | - |
1134 | | - TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(Prefetch, Stmt, PrefetchNode); |
1135 | | - TVM_DEFINE_OBJECT_REF_COW_METHOD(PrefetchNode); |
1136 | | -}; |
1137 | | - |
1138 | 974 | /*! |
1139 | 975 | * \brief Representing the region of multi-dimensional buffer access. |
1140 | 976 | */ |
|
0 commit comments