Skip to content

Commit 11a56e6

Browse files
committed
format
1 parent 041dbf1 commit 11a56e6

File tree

6 files changed

+29
-26
lines changed

6 files changed

+29
-26
lines changed

torch/csrc/jit/codegen/cuda/arith.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -630,10 +630,12 @@ TensorView* eye(Val* size, DataType dtype) {
630630

631631
// UNARY OPERATIONS
632632

633-
#define NVFUSER_DEFINE_UNARY_OP(op_name, op_type) \
634-
Val* op_name(Val* v) { return unaryOp(UnaryOpType::op_type, v); } \
635-
TensorView* op_name(TensorView* tv) { \
636-
return unaryOp(UnaryOpType::op_type, tv); \
633+
#define NVFUSER_DEFINE_UNARY_OP(op_name, op_type) \
634+
Val* op_name(Val* v) { \
635+
return unaryOp(UnaryOpType::op_type, v); \
636+
} \
637+
TensorView* op_name(TensorView* tv) { \
638+
return unaryOp(UnaryOpType::op_type, tv); \
637639
}
638640

639641
NVFUSER_DEFINE_UNARY_OP(set, Set)
@@ -763,10 +765,12 @@ NVFUSER_DEFINE_UNARY_FLOAT_OP(tan, Tan)
763765
NVFUSER_DEFINE_UNARY_FLOAT_OP(tanh, Tanh)
764766
#undef NVFUSER_DEFINE_UNARY_FLOAT_OP
765767

766-
#define NVFUSER_DEFINE_UNARY_IS_OP(op_name, op_type) \
767-
Val* op_name(Val* v) { return unaryIsOp(UnaryOpType::op_type, v); } \
768-
TensorView* op_name(TensorView* tv) { \
769-
return unaryIsOp(UnaryOpType::op_type, tv); \
768+
#define NVFUSER_DEFINE_UNARY_IS_OP(op_name, op_type) \
769+
Val* op_name(Val* v) { \
770+
return unaryIsOp(UnaryOpType::op_type, v); \
771+
} \
772+
TensorView* op_name(TensorView* tv) { \
773+
return unaryIsOp(UnaryOpType::op_type, tv); \
770774
}
771775

772776
NVFUSER_DEFINE_UNARY_IS_OP(isfinite, IsFinite)

torch/csrc/jit/codegen/cuda/ir_iostream.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,10 +506,8 @@ void IrPrinter::handle(const RNGOp* rop) {
506506

507507
void IrPrinter::handle(const SelectOp* sop) {
508508
indent() << sop->output(0) << "\n";
509-
indent() << " = select( " << sop->input(0)
510-
<< ", dim = " << sop->getDim()
511-
<< ", index = " << sop->input(1)
512-
<< " )\n";
509+
indent() << " = select( " << sop->input(0) << ", dim = " << sop->getDim()
510+
<< ", index = " << sop->input(1) << " )\n";
513511
}
514512

515513
void IrPrinter::handle(const ReductionOp* rop) {

torch/csrc/jit/codegen/cuda/ir_utils.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -266,18 +266,17 @@ struct SubstituteInExpr : public OptInDispatch {
266266
}
267267

268268
void handle(SelectOp* select_expr) final {
269-
auto input = reference_->sameAs(select_expr->input(0)) ? substitute_
270-
: select_expr->input(0);
271-
auto index = reference_->sameAs(select_expr->input(1)) ? substitute_
272-
: select_expr->input(1);
273-
auto out = reference_->sameAs(select_expr->output(0)) ? substitute_
274-
: select_expr->output(0);
269+
auto input = reference_->sameAs(select_expr->input(0))
270+
? substitute_
271+
: select_expr->input(0);
272+
auto index = reference_->sameAs(select_expr->input(1))
273+
? substitute_
274+
: select_expr->input(1);
275+
auto out = reference_->sameAs(select_expr->output(0))
276+
? substitute_
277+
: select_expr->output(0);
275278
expr_ = IrBuilder::create<SelectOp>(
276-
select_expr->container(),
277-
out,
278-
input,
279-
select_expr->getDim(),
280-
index);
279+
select_expr->container(), out, input, select_expr->getDim(), index);
281280
}
282281

283282
void handle(RNGOp* rng_expr) final {

torch/csrc/jit/codegen/cuda/scheduler/pointwise_utils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ bool DomainMap::areAllInputIdsMappedTo(TensorView* input_tv, TensorView* tv)
2727
// like T0[I0, b] + T1[b, I1]
2828
auto concrete =
2929
ca_map_.getConcreteMappedID(in_id, IdMappingMode::PERMISSIVE);
30-
if (!concrete->isBroadcast() && !in_id->isReduction() && !isSelectId(in_id)) {
30+
if (!concrete->isBroadcast() && !in_id->isReduction() &&
31+
!isSelectId(in_id)) {
3132
in_concrete_ids.insert(concrete);
3233
}
3334
}

torch/csrc/jit/codegen/cuda/scheduler/utils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,8 @@ std::vector<TensorView*> cacheInputs(Fusion* fusion, bool unroll) {
975975
// If we're going to unroll, make a cache of the inputs
976976
auto in_tvs = ir_utils::filterByType<TensorView>(fusion->inputs());
977977
for (auto tv : in_tvs) {
978-
if (tv->uses().empty() || tv->isFusionOutput() || scheduler_utils::isSelectInput(tv)) {
978+
if (tv->uses().empty() || tv->isFusionOutput() ||
979+
scheduler_utils::isSelectInput(tv)) {
979980
continue;
980981
}
981982
auto cached_tv = tv->cacheAfter();

torch/csrc/jit/codegen/cuda/test/test_gpu_indexing_ops.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,4 @@ TEST_F(NVFuserTest, FusionSelectOpPersistent_CUDA) {
133133

134134
} // namespace jit
135135
} // namespace torch
136-
#endif // #if defined(USE_CUDA)
136+
#endif // #if defined(USE_CUDA)

0 commit comments

Comments
 (0)