|
| 1 | +tilelang.transform.add_bufstore_wrapper |
| 2 | +======================================= |
| 3 | + |
| 4 | +.. py:module:: tilelang.transform.add_bufstore_wrapper |
| 5 | +
|
| 6 | +
|
| 7 | +Classes |
| 8 | +------- |
| 9 | + |
| 10 | +.. autoapisummary:: |
| 11 | + |
| 12 | + tilelang.transform.add_bufstore_wrapper.FindVarUse |
| 13 | + tilelang.transform.add_bufstore_wrapper.AddWrapperForSingleStoreMutator |
| 14 | + |
| 15 | + |
| 16 | +Functions |
| 17 | +--------- |
| 18 | + |
| 19 | +.. autoapisummary:: |
| 20 | + |
| 21 | + tilelang.transform.add_bufstore_wrapper.AddWrapperForSingleBufStore |
| 22 | + |
| 23 | + |
| 24 | +Module Contents |
| 25 | +--------------- |
| 26 | + |
| 27 | +.. py:class:: FindVarUse |
| 28 | +
|
| 29 | + Bases: :py:obj:`tvm.tir.PyStmtExprVisitor` |
| 30 | + |
| 31 | + |
| 32 | + A Python StmtExprVisitor to define custom visitor for both Stmt and PrimExpr. |
| 33 | + |
| 34 | + Users can customize any of the visit function. |
| 35 | + |
| 36 | + |
| 37 | + .. py:attribute:: used_var |
| 38 | +
|
| 39 | +
|
| 40 | + .. py:method:: visit_var_(op) |
| 41 | +
|
| 42 | + Visit Var. |
| 43 | + |
| 44 | + Users can customize this function to overwrite VisitVar_(const VarNode* op) |
| 45 | + on the C++ side. |
| 46 | + |
| 47 | + :param op: The Var to be visited. |
| 48 | + :type op: Var |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +.. py:class:: AddWrapperForSingleStoreMutator |
| 53 | +
|
| 54 | + Bases: :py:obj:`tvm.tir.PyStmtExprMutator` |
| 55 | + |
| 56 | + |
| 57 | + Add a dummy parallel for loop to wrap the single buffer store |
| 58 | + Condition: |
| 59 | + 1. not inside a parallel for loop |
| 60 | + 2. no custom thread binding, i.e. threadIdx.x, blockIdx.x |
| 61 | + |
| 62 | + |
| 63 | + .. py:attribute:: inside_pfor |
| 64 | + :value: 0 |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + .. py:attribute:: thread_binding_var |
| 69 | +
|
| 70 | +
|
| 71 | + .. py:method:: visit_block_(op) |
| 72 | +
|
| 73 | + Visit Block. |
| 74 | + Users can customize this function to overwrite VisitStmt_(const BlockNode* op) |
| 75 | + on the C++ side. |
| 76 | + |
| 77 | + :param op: The Block to be visited. |
| 78 | + :type op: Block |
| 79 | + |
| 80 | + :returns: **result** -- The mutated Stmt. |
| 81 | + :rtype: Stmt |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + .. py:method:: visit_attr_stmt_(op) |
| 86 | +
|
| 87 | + Visit AttrStmt. |
| 88 | + Users can customize this function to overwrite VisitStmt_(const AttrStmtNode* op) |
| 89 | + on the C++ side. |
| 90 | + |
| 91 | + :param op: The AttrStmt to be visited. |
| 92 | + :type op: AttrStmt |
| 93 | + |
| 94 | + :returns: **result** -- The mutated Stmt. |
| 95 | + :rtype: Stmt |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + .. py:method:: visit_for_(op) |
| 100 | +
|
| 101 | + Visit For. |
| 102 | + Users can customize this function to overwrite VisitStmt_(const ForNode* op) |
| 103 | + on the C++ side. |
| 104 | + |
| 105 | + :param op: The For to be visited. |
| 106 | + :type op: For |
| 107 | + |
| 108 | + :returns: **result** -- The mutated Stmt. |
| 109 | + :rtype: Stmt |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + .. py:method:: visit_buffer_store_(op) |
| 114 | +
|
| 115 | + Visit BufferStore. |
| 116 | + Users can customize this function to overwrite VisitStmt_(const BufferStoreNode* op) |
| 117 | + on the C++ side. |
| 118 | + |
| 119 | + :param op: The BufferStore to be visited. |
| 120 | + :type op: BufferStore |
| 121 | + |
| 122 | + :returns: **result** -- The mutated Stmt. |
| 123 | + :rtype: Stmt |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | +.. py:function:: AddWrapperForSingleBufStore() |
| 128 | +
|
0 commit comments