Skip to content

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jcf94 committed Jun 22, 2020
1 parent 227d8f2 commit be08a38
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/ansor/compute_dag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ void ComputeDAG::RewriteLayout(
layout_rewrite_level == kBothRewrite);
std::ostringstream os;

uint i = 0;
size_t i = 0;
if (extractor.buf_accesses.count(placeholder_op)) {
for (const auto& ev : extractor.buf_accesses[placeholder_op]) {
for (const auto& e : ev) {
Expand Down
3 changes: 1 addition & 2 deletions src/ansor/transform_step.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class ComputeAtStepNode: public StepNode {
*/
class ComputeAtStep : public Step {
public:
ComputeAtStep(int stage_id, int target_stage_id, int target_iter_id);
ComputeAtStep(int stage_id, int target_stage_id, int target_iter_id);

TVM_DEFINE_OBJECT_REF_METHODS(ComputeAtStep, Step, ComputeAtStepNode);
TVM_DEFINE_OBJECT_REF_COW_METHOD(ComputeAtStepNode);
Expand All @@ -286,7 +286,6 @@ class ComputeAtStep : public Step {
/*! \brief Fuse step that corresponds to te::Stage::compute_root */
class ComputeRootStepNode: public StepNode {
public:

void ApplyToSchedule(std::vector<te::Stage> *stages,
StageToAxesMap *stage_to_axes) const;

Expand Down
5 changes: 2 additions & 3 deletions src/runtime/rpc/rpc_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,7 @@ std::shared_ptr<RPCSession> RPCModuleGetSession(Module mod) {
}

inline void CacheFlush(const char* p, unsigned int allocation_size) {
// TODO: (FrozenGene)
// Support ARM.
// TODO(FrozenGene): Support ARM.
#if (defined(_M_X64) || defined(__x86_64__))
size_t cache_line = 64;

Expand Down Expand Up @@ -346,7 +345,7 @@ PackedFunc WrapTimeEvaluator(PackedFunc pf, TVMContext ctx, int number, int repe
CHECK_EQ(number, 1);
// we want to keep input data
for (int j = 1; j < args.size(); j++) {
CacheFlush((char*)(args[j].operator DLTensor*()->data),
CacheFlush(reinterpret_cast<char*>(args[j].operator DLTensor*()->data),
GetDataSize(*(args[j].operator DLTensor*())));
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/tir/transforms/unroll_loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct UnrollLoopConfigNode : public tvm::AttrsNode<UnrollLoopConfigNode> {
.describe("Whether to explicitly unroll the loop instead of setting a pragma")
.set_default(true);
TVM_ATTR_FIELD(explicit_unroll_max_extent)
.describe("The maximum extent of a loop that can be unrolled explicitly (-1 means infinite)")
.describe("The maximum extent of a loop that can be unrolled explicitly (-1 -> infinite)")
.set_default(32);
}
};
Expand Down Expand Up @@ -170,7 +170,8 @@ class LoopUnroller : public StmtExprMutator {
// For loop must have a constant integer extent
CHECK_NE(value, -1) << "loop doesn't have a constant integer extent";
if (value == 0) return Evaluate(0);
if (explicit_unroll_max_extent_ > 0 && value > explicit_unroll_max_extent_ && explicit_unroll_) {
if (explicit_unroll_max_extent_ > 0 &&
value > explicit_unroll_max_extent_ && explicit_unroll_) {
// Do not unroll too long loops
ForType for_type = op->for_type == ForType::Unrolled ? ForType::Serial : op->for_type;
return For(op->loop_var, op->min, op->extent, for_type, op->device_api, op->body);
Expand Down

0 comments on commit be08a38

Please sign in to comment.