Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Oct 9, 2024
1 parent 897ebe6 commit 67879b2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
18 changes: 9 additions & 9 deletions src/IR/Attribute.jl
Original file line number Diff line number Diff line change
Expand Up @@ -614,10 +614,10 @@ end
# TODO mlirDenseElementsAttrGetRawData

"""
isopaqueelements(attr)
isopaqueelements(attr)
Checks whether the given attribute is an opaque elements attribute.
"""
Checks whether the given attribute is an opaque elements attribute.
"""
function isopaqueelements(attr::Attribute)
MLIR_VERSION[] >= v"15" || throw(
MLIRException("`isopaqueelements(::Attribute)` requires MLIR version 15 or later"),
Expand All @@ -637,10 +637,10 @@ issparseelements(attr::Attribute) = API.mlirAttributeIsASparseElements(attr)
# TODO mlirSparseElementsAttrGetValues

"""
isdensearray(attr, ::Core.Type{T})
isdensearray(attr, ::Core.Type{T})
Checks whether the given attribute is a dense array attribute.
"""
Checks whether the given attribute is a dense array attribute.
"""
function isdensearray end

function isdensearray(attr::Attribute, ::Core.Type{Bool})
Expand Down Expand Up @@ -707,10 +707,10 @@ function isdensearray(attr::Attribute, ::Core.Type{Float64})
end

"""
DenseArrayAttribute(array; context=context())
DenseArrayAttribute(array; context=context())
Create a dense array attribute with the given elements.
"""
Create a dense array attribute with the given elements.
"""
function DenseArrayAttribute end

function DenseArrayAttribute(values::AbstractArray{Bool}; context::Context=context())
Expand Down
12 changes: 6 additions & 6 deletions src/IR/Pass.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ Create a new top-level PassManager.
PassManager(; context::Context=context()) = PassManager(API.mlirPassManagerCreate(context))

"""
PassManager(anchorOp; context=context())
PassManager(anchorOp; context=context())
Create a new top-level PassManager anchored on `anchorOp`.
"""
Create a new top-level PassManager anchored on `anchorOp`.
"""
function PassManager(anchor_op::Operation; context::Context=context())
MLIR_VERSION[] >= v"16" ||
throw(MLIRException("`PassManager(::Operation)` requires MLIR version 16 or later"))
Expand Down Expand Up @@ -173,10 +173,10 @@ function Base.parse(opm::OpPassManager, pipeline::String)
end

"""
add_pipeline!(passManager, pipelineElements, callback, userData)
add_pipeline!(passManager, pipelineElements, callback, userData)
Parse a sequence of textual MLIR pass pipeline elements and add them to the provided OpPassManager. If parsing fails an error message is reported using the provided callback.
"""
Parse a sequence of textual MLIR pass pipeline elements and add them to the provided OpPassManager. If parsing fails an error message is reported using the provided callback.
"""
function add_pipeline!(op_pass::OpPassManager, pipeline)
if MLIR_VERSION[] >= v"16"
io = IOBuffer()
Expand Down
24 changes: 12 additions & 12 deletions src/IR/Type.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,21 @@ end

# Floating point types
"""
Float8E5M2(; context=context())
Float8E5M2(; context=context())
Creates an f8E5M2 type in the given context. The type is owned by the context.
"""
Creates an f8E5M2 type in the given context. The type is owned by the context.
"""
function Float8E5M2(; context::Context=context())
MLIR_VERSION[] >= v"16" ||
throw(MLIRException("`Float8E5M2()` requires MLIR version 16 or later"))
return Type(API.mlirFloat8E5M2TypeGet(context))
end

"""
Float8E4M3FN(; context=context())
Float8E4M3FN(; context=context())
Creates an f8E4M3FN type in the given context. The type is owned by the context.
"""
Creates an f8E4M3FN type in the given context. The type is owned by the context.
"""
function Float8E4M3FN(; context::Context=context())
MLIR_VERSION[] >= v"16" ||
throw(MLIRException("`Float8E4M3FN()` requires MLIR version 16 or later"))
Expand Down Expand Up @@ -191,21 +191,21 @@ Creates a f64 type in the given context. The type is owned by the context.
Type(::Core.Type{Float64}; context::Context=context()) = Type(API.mlirF64TypeGet(context))

"""
isf8e5m2(type)
isf8e5m2(type)
Checks whether the given type is an f8E5M2 type.
"""
Checks whether the given type is an f8E5M2 type.
"""
function isf8e5m2(type::Type)
MLIR_VERSION[] >= v"16" ||
throw(MLIRException("`isf8e5m2()` requires MLIR version 16 or later"))
return API.mlirTypeIsAFloat8E5M2(type)
end

"""
isf8e4m3fn(type)
isf8e4m3fn(type)
Checks whether the given type is an f8E4M3FN type.
"""
Checks whether the given type is an f8E4M3FN type.
"""
function isf8e4m3fn(type::Type)
MLIR_VERSION[] >= v"16" ||
throw(MLIRException("`isf8e4m3fn()` requires MLIR version 16 or later"))
Expand Down

0 comments on commit 67879b2

Please sign in to comment.