Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/mlir/Dialects/EnzymeXLA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,40 @@ function stream2token(source::Value; result::IR.Type, location=Location())
)
end

"""
`lapack_symm`

C := alpha*A*B + beta*C, or C := alpha*B*A + beta*C, where alpha and beta are scalars, A is a symmetric matrix\"
"""
function lapack_symm(
A::Value,
B::Value,
C::Value,
alpha::Value,
beta::Value;
output::IR.Type,
side,
uplo,
location=Location(),
)
op_ty_results = IR.Type[output,]
operands = Value[A, B, C, alpha, beta]
owned_regions = Region[]
successors = Block[]
attributes = NamedAttribute[namedattribute("side", side), namedattribute("uplo", uplo)]

return create_operation(
"enzymexla.lapack.symm",
location;
operands,
owned_regions,
successors,
attributes,
results=op_ty_results,
result_inference=false,
)
end

function wrap(
operand::Value;
result=nothing::Union{Nothing,IR.Type},
Expand Down
4 changes: 4 additions & 0 deletions src/mlir/libMLIR_h.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11497,6 +11497,10 @@ function enzymexlaLapackSideAttrGet(ctx, left_side)
)::MlirAttribute
end

function enzymexlaLapackUploAttrGet(ctx, up)
@ccall mlir_c.enzymexlaLapackUploAttrGet(ctx::MlirContext, up::UInt8)::MlirAttribute
end

function enzymexlaQRAlgorithmAttrGet(ctx, mode)
@ccall mlir_c.enzymexlaQRAlgorithmAttrGet(ctx::MlirContext, mode::Int32)::MlirAttribute
end
Expand Down