@@ -27,7 +27,7 @@ namespace relay {
2727 *
2828 * \return A type checked expression with its checked_type field populated.
2929 */
30- Expr InferType (const Expr& expr, const Module& mod);
30+ TVM_DLL Expr InferType (const Expr& expr, const Module& mod);
3131
3232/* !
3333 * \brief Infer the type of a function as if it is mapped to var in the mod.
@@ -39,8 +39,8 @@ Expr InferType(const Expr& expr, const Module& mod);
3939 * \return A type checked Function with its checked_type field populated.
4040 * \note this function mutates mod and is not thread-safe.
4141 */
42- Function InferType (const Function& f, const Module& mod,
43- const GlobalVar& var);
42+ TVM_DLL Function InferType (const Function& f, const Module& mod,
43+ const GlobalVar& var);
4444
4545/* !
4646 * \brief Check that types are well kinded by applying "kinding rules".
@@ -58,7 +58,7 @@ Function InferType(const Function& f, const Module& mod,
5858 *
5959 * \return true if the rules are satisified otherwise false
6060 */
61- bool KindCheck (const Type& t, const Module& mod);
61+ TVM_DLL bool KindCheck (const Type& t, const Module& mod);
6262
6363/* ! \brief Compare two expressions for structural equivalence.
6464 *
@@ -75,7 +75,7 @@ bool KindCheck(const Type& t, const Module& mod);
7575 *
7676 * \return true if equal, otherwise false
7777 */
78- bool AlphaEqual (const Expr& e1 , const Expr& e2 );
78+ TVM_DLL bool AlphaEqual (const Expr& e1 , const Expr& e2 );
7979
8080/* ! \brief Compare two types for structural equivalence.
8181 *
@@ -93,7 +93,7 @@ bool AlphaEqual(const Expr& e1, const Expr& e2);
9393 *
9494 * \return true if equal, otherwise false
9595 */
96- bool AlphaEqual (const Type& t1, const Type& t2);
96+ TVM_DLL bool AlphaEqual (const Type& t1, const Type& t2);
9797
9898/* ! \brief Check that each Var is only bound once.
9999 *
@@ -106,7 +106,7 @@ bool AlphaEqual(const Type& t1, const Type& t2);
106106 *
107107 * \return true iff all Var in expr is bound at most once.
108108 */
109- bool WellFormed (const Expr& expr);
109+ TVM_DLL bool WellFormed (const Expr& expr);
110110
111111/* ! \brief Get all bound variables from expression expr.
112112 *
@@ -117,7 +117,7 @@ bool WellFormed(const Expr& expr);
117117 *
118118 * \return List of bound vars, in the PostDFS order in the expression.
119119 */
120- tvm::Array<Var> BoundVars (const Expr& expr);
120+ TVM_DLL tvm::Array<Var> BoundVars (const Expr& expr);
121121
122122/* ! \brief Get free type parameters from expression expr.
123123 *
@@ -128,15 +128,15 @@ tvm::Array<Var> BoundVars(const Expr& expr);
128128 *
129129 * \return List of free vars, in the PostDFS order in the expression.
130130 */
131- tvm::Array<Var> FreeVars (const Expr& expr);
131+ TVM_DLL tvm::Array<Var> FreeVars (const Expr& expr);
132132
133133/* ! \brief Get all variables from expression expr.
134134 *
135135 * \param expr the expression.
136136 *
137137 * \return List of all vars, in the PostDFS order in the expression.
138138 */
139- tvm::Array<Var> AllVars (const Expr& expr);
139+ TVM_DLL tvm::Array<Var> AllVars (const Expr& expr);
140140
141141/* ! \brief Get free TypeVars from expression expr.
142142 *
@@ -147,7 +147,7 @@ tvm::Array<Var> AllVars(const Expr& expr);
147147 *
148148 * \return List of free vars, in the PostDFS order visited by expr.
149149 */
150- tvm::Array<TypeVar> FreeTypeVars (const Expr& expr);
150+ TVM_DLL tvm::Array<TypeVar> FreeTypeVars (const Expr& expr);
151151
152152/* ! \brief Get free TypeVars from type t.
153153 *
@@ -158,7 +158,7 @@ tvm::Array<TypeVar> FreeTypeVars(const Expr& expr);
158158 *
159159 * \return List of free type vars, in the PostDFS order visited by type.
160160 */
161- tvm::Array<TypeVar> FreeTypeVars (const Type& t);
161+ TVM_DLL tvm::Array<TypeVar> FreeTypeVars (const Type& t);
162162
163163/* ! \brief Get all bound type variables from expression expr.
164164 *
@@ -169,7 +169,7 @@ tvm::Array<TypeVar> FreeTypeVars(const Type& t);
169169 *
170170 * \return List of bound type vars, in the PostDFS order in the expression.
171171 */
172- tvm::Array<TypeVar> BoundTypeVars (const Expr& expr);
172+ TVM_DLL tvm::Array<TypeVar> BoundTypeVars (const Expr& expr);
173173
174174/* ! \brief Get all bound type variables from type t.
175175 *
@@ -180,23 +180,23 @@ tvm::Array<TypeVar> BoundTypeVars(const Expr& expr);
180180 *
181181 * \return List of bound type vars, in the PostDFS order visited by type.
182182 */
183- tvm::Array<TypeVar> BoundTypeVars (const Type& t);
183+ TVM_DLL tvm::Array<TypeVar> BoundTypeVars (const Type& t);
184184
185185/* ! \brief Get all type variables in expression expr.
186186 *
187187 * \param expr the expression.
188188 *
189189 * \return List of type vars, in the PostDFS order in the expression.
190190 */
191- tvm::Array<TypeVar> AllTypeVars (const Expr& expr);
191+ TVM_DLL tvm::Array<TypeVar> AllTypeVars (const Expr& expr);
192192
193193/* ! \brief Get all type variables in type t.
194194 *
195195 * \param t the type.
196196 *
197197 * \return List of type vars, in the PostDFS order visited by type.
198198 */
199- tvm::Array<TypeVar> AllTypeVars (const Type& t);
199+ TVM_DLL tvm::Array<TypeVar> AllTypeVars (const Type& t);
200200
201201/* ! \brief Remove expressions which does not effect the program result.
202202 *
@@ -211,22 +211,22 @@ tvm::Array<TypeVar> AllTypeVars(const Type& t);
211211 *
212212 * \return the optimized expression.
213213 */
214- Expr DeadCodeElimination (const Expr& e);
214+ TVM_DLL Expr DeadCodeElimination (const Expr& e);
215215
216216/* !
217217 * \brief Fold constant expressions.
218218 * \param expr the expression to be optimized.
219219 * \return The optimized expression.
220220 */
221- Expr FoldConstant (const Expr& expr);
221+ TVM_DLL Expr FoldConstant (const Expr& expr);
222222
223223/* !
224224 * \brief Fuse operations into expr into seperate functions.
225225 * \param expr The expression.
226226 * \param fuse_opt_level Optimization level.
227227 * \return The optimized expression.
228228 */
229- Expr FuseOps (const Expr& expr, int fuse_opt_level);
229+ TVM_DLL Expr FuseOps (const Expr& expr, int fuse_opt_level);
230230
231231/* !
232232 * \brief Apply rewrite rules to rewrite the expr in post DFS order.
@@ -238,7 +238,7 @@ Expr FuseOps(const Expr& expr, int fuse_opt_level);
238238 * an Expr consumed by multiple callers.
239239 * \return The rewritten expression.
240240 */
241- Expr ForwardRewrite (const Expr& expr,
241+ TVM_DLL Expr ForwardRewrite (const Expr& expr,
242242 const std::string& rewrite_map_attr_name,
243243 std::function<NodeRef(const Call&)> fcontext = nullptr,
244244 std::function<Expr(const Expr&)> fmulti_ref_trigger = nullptr);
@@ -252,7 +252,7 @@ Expr ForwardRewrite(const Expr& expr,
252252 * an Expr consumed by multiple callers.
253253 * \return The rewritten expression.
254254 */
255- Expr ForwardRewrite (const Expr& expr,
255+ TVM_DLL Expr ForwardRewrite (const Expr& expr,
256256 const FForwardRewrite& rewrite_func,
257257 std::function<NodeRef(const Call&)> fcontext = nullptr,
258258 std::function<Expr(const Expr&)> fmulti_ref_trigger = nullptr);
@@ -264,14 +264,14 @@ Expr ForwardRewrite(const Expr& expr,
264264 * operators without annotation.
265265 * \return The updated program.
266266 */
267- Expr RewriteAnnotatedOps (const Expr& expr, int fallback_device);
267+ TVM_DLL Expr RewriteAnnotatedOps (const Expr& expr, int fallback_device);
268268
269269/* !
270270 * \brief Collect the device mapping information of each expression.
271271 * \param expr The expression.
272272 * \return The device mapping.
273273 */
274- Map<Expr, Integer> CollectDeviceInfo (const Expr& expr);
274+ TVM_DLL Map<Expr, Integer> CollectDeviceInfo (const Expr& expr);
275275
276276/* ! \brief A hashing structure in the style of std::hash. */
277277struct StructuralHash {
0 commit comments