Skip to content

Commit 3c6be73

Browse files
committed
refactor: no lambda function
1 parent 0da6f5e commit 3c6be73

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Compiler.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,12 @@ const DUS_SLICE_SIMPLIFY = Ref(true)
701701
const CONCATS_TO_DUS = Ref(false)
702702
const WHILE_UNROLL_THRESHOLD = Ref(4)
703703

704+
function _propagate_direction(sym::Symbol)
705+
sym === :up && return MLIR.API.ENZYMEXLA_PROPAGATE_UP
706+
sym === :down && return MLIR.API.ENZYMEXLA_PROPAGATE_DOWN
707+
return MLIR.API.ENZYMEXLA_PROPAGATE_NONE
708+
end
709+
704710
# Optimization passes via transform dialect
705711
function optimization_passes(
706712
compile_options::CompileOptions;
@@ -713,12 +719,6 @@ function optimization_passes(
713719
raise_shlo_to_blas_lapack::Bool=true,
714720
self_to_convolution::Bool=false,
715721
)
716-
function _propagate_direction(sym::Symbol)
717-
sym === :up && return MLIR.API.ENZYMEXLA_PROPAGATE_UP
718-
sym === :down && return MLIR.API.ENZYMEXLA_PROPAGATE_DOWN
719-
return MLIR.API.ENZYMEXLA_PROPAGATE_NONE
720-
end
721-
722722
options = MLIR.API.EnzymeXLATransformPassesOptions(
723723
compile_options.max_constant_threshold, # max_constant_threshold
724724
WHILE_UNROLL_THRESHOLD[], # while_unroll_threshold

0 commit comments

Comments
 (0)