schedule_pass.h 1.85 KB
Newer Older
1 2
/*!
 *  Copyright (c) 2016 by Contributors
tqchen committed
3
 * \file tvm/schedule_pass.h
4 5 6 7 8
 * \brief  Collection of Schedule pass functions.
 *
 *  These passes works on the schedule hyper-graph
 *  and infers information such as bounds, check conditions
 *  read/write dependencies between the IterVar
9
 */
10 11
#ifndef TVM_SCHEDULE_PASS_H_
#define TVM_SCHEDULE_PASS_H_
12

13 14
#include "base.h"
#include "schedule.h"
15 16

namespace tvm {
17
namespace schedule {
18 19 20 21 22 23 24

/*!
 * \brief Infer the bound of all iteration variables relates to the schedule.
 *
 * \param sch The root schedule to infer all the bounds.
 * \return the result bound of the iteration Variable
 */
25
Map<IterVar, Range> InferBound(const Schedule& sch);
26

27 28 29 30 31
/*!
 * \brief Schedule s' dependent operations.
 *
 * \param s The schedule to be realized
 * \param dom_map The domain of each iter vars.
32 33 34 35
 * \param debug_keep_trivial_loop Whether keep trivial loops with extent of 1 during lowering.
 *                                This is a debug feature for dataflow/axis analysis.
 *                                Note: If this is true, The lowered IR may be incorrect,
 *                                because we will also delete the init part of reduction
36 37
 * \return the result Stmt
 */
38
Stmt ScheduleOps(Schedule s, Map<IterVar, Range> dom_map, bool debug_keep_trivial_loop);
39

40 41 42 43 44 45 46
/*!
 * \brief To automatically inline the element-wise operations.
 *
 * \param sch The schedule to be inlined.
 */
void AutoInlineElemWise(Schedule sch);

47 48 49 50 51 52 53 54
/*!
 * \brief To automatically inline operations with injective writes
 *   (i.e. writes without reduction or sequential loops). Note
 *   that in this case, guarantees about contiguity, transpose, stride,
 *   alignemnt and memory footprint in general do not hold.
 *
 * \param sch The schedule to be inlined.
 */
55
EXPORT void AutoInlineInjective(Schedule sch);
56

57
}  // namespace schedule
58
}  // namespace tvm
59
#endif  // TVM_SCHEDULE_PASS_H_