Skip to content

Commit 8589795

Browse files
arhikmaleadt
authored andcommitted
Use Symbol instead of Val{} in encode_reduce_body
1 parent 21beebb commit 8589795

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/compiler/intrinsics/core.jl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ function emit_reduce!(ctx::CGCtx, args, reduce_fn::Symbol)
569569
results = encode_ReduceOp!(cb, [output_tile_type], [input_tv.v], axis, [identity], [scalar_tile_type]) do block_args
570570
acc, elem = block_args[1], block_args[2]
571571

572-
res = encode_reduce_body(cb, scalar_tile_type, acc, elem, Val(reduce_fn), elem_type)
572+
res = encode_reduce_body(cb, scalar_tile_type, acc, elem, reduce_fn, elem_type)
573573
encode_YieldOp!(cb, [res])
574574
end
575575

@@ -620,19 +620,18 @@ operation_identity(::Val{:max}, dtype, ::Type{T}) where T <: Integer =
620620
#=============================================================================#
621621
# Reduce Body Operations
622622
#=============================================================================#
623-
624-
function encode_reduce_body(cb, type, acc, elem, op::Val, ::Type{T}) where T
623+
function encode_reduce_body(cb, type, acc, elem, op::Symbol, ::Type{T}) where T
625624
if T <: AbstractFloat
626-
if op == Val{:add}
625+
if op == :add
627626
encode_AddFOp!(cb, type, acc, elem)
628-
else # Val{:max}
627+
else # :max
629628
encode_MaxFOp!(cb, type, acc, elem)
630629
end
631630
else # Integer
632631
signedness = T <: Signed ? SignednessSigned : SignednessUnsigned
633-
if op == Val{:add}
632+
if op == :add
634633
encode_AddIOp!(cb, type, acc, elem)
635-
else # Val{:max}
634+
else # :max
636635
encode_MaxIOp!(cb, type, acc, elem; signedness)
637636
end
638637
end

0 commit comments

Comments
 (0)