Skip to content

Commit e180896

Browse files
committed
review
1 parent 59764c6 commit e180896

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Ops.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -916,27 +916,22 @@ end
916916

917917
function sort(
918918
x::TracedRArray{T,N};
919-
comparator::Function,
919+
comparator,
920920
dimension=1,
921921
is_stable=false,
922922
location=mlir_stacktrace("sort", @__FILE__, @__LINE__),
923923
) where {T,N}
924924
#C4:
925925
@assert 0 < dimension <= ndims(x) "$x invalid dimension"
926926

927-
#C5:
928-
method = Base.methods(
929-
comparator, (Reactant.TracedRArray{T,N}, Reactant.TracedRArray{T,N})
930-
)
931-
@assert size(method, 1) != 0 error("$comparator is not a valid comparator")
932-
@assert size(method, 1) == 1 error("$comparator ambiguous candidates")
933927
#TODO: move to @trace
934928
(a, b) = (ConcreteRNumber(T(0)), ConcreteRNumber(T(0)))
935929
func = Reactant.make_mlir_fn(comparator, (a, b), (), "main"; no_args_in_result=true)[2]
936930

937931
fn_name = String(
938932
MLIR.IR.attr(func, String(MLIR.API.mlirSymbolTableGetSymbolAttributeName()))
939933
)
934+
#C5:
940935
@assert fn_name == "main" "$comparator: no function generated"
941936
@assert MLIR.IR.nregions(func) == 1
942937
ftype_attr = MLIR.IR.attr(func, "function_type")
@@ -949,7 +944,6 @@ function sort(
949944
comparator = MLIR.IR.Region()
950945
MLIR.API.mlirRegionTakeBody(comparator, MLIR.IR.region(func, 1))
951946
MLIR.IR.rmfromparent!(func)
952-
global leaked = comparator
953947
for block in MLIR.IR.BlockIterator(comparator)
954948
return_op = MLIR.IR.terminator(block)
955949
MLIR.IR.name(return_op) == "func.return" || continue

0 commit comments

Comments
 (0)