Skip to content

Commit

Permalink
update bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Jan 16, 2024
1 parent 10c3b88 commit 3405eab
Show file tree
Hide file tree
Showing 22 changed files with 339 additions and 220 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/Tblgen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: MLIR JL tblgen CI

on:
pull_request:
branches:
- main
push:
branches:
- main
tags: '*'

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.9'
- '1.10'
- 'nightly'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: |
julia --project=docs -e '
using Documenter: doctest
using MLIR
doctest(MLIR)' # change MYPACKAGE to the name of your package
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
54 changes: 54 additions & 0 deletions deps/build_ci.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()

using Git, Scratch, Dates

MLIR = Base.UUID("bfde9dd4-8f40-4a1e-be09-1475335e1c92")

# get scratch directories
support_dir = get_scratch!(LLVM, "support")

# is this a full-fledged check-out?
if isdir(joinpath(@__DIR__), "..", ".git")
# determine latest change to the wrappers
deps_timestamp = parse(Int, read(`$(git()) -C $(@__DIR__) log -1 --format=%ct LLVMExtra`, String))
@info "Latest change to the wrappers: $(unix2datetime(deps_timestamp))"

# find out which version of LLVMExtra_jll we are using
Pkg.activate(joinpath(@__DIR__, ".."))
deps = collect(values(Pkg.dependencies()))
filter!(deps) do dep
dep.name == "LLVMExtra_jll"
end
library_version = only(deps).version
@info "LLVMExtra_jll version: $(library_version)"

# compare to the JLL's tags
jll_tags = mktempdir() do dir
if !isdir(joinpath(support_dir, ".git"))
run(`$(git()) clone -q https://github.com/JuliaBinaryWrappers/LLVMExtra_jll.jl $dir`)
else
run(`$(git()) -C $dir fetch -q`)
end
tags = Dict{String,Int}()
for line in eachline(`$(git()) -C $dir tag --format "%(refname:short) %(creatordate:unix)"`)
tag, timestamp = split(line)
tags[tag] = parse(Int, timestamp)
end
tags
end
jll_timestamp = jll_tags["LLVMExtra-v$(library_version)"]
@info "LLVMExtra_jll timestamp: $(unix2datetime(jll_timestamp))"

if deps_timestamp > jll_timestamp
@info "Wrappers have changed since the last JLL build. Building the support library locally."
include(joinpath(@__DIR__, "build_local.jl"))
else
@info "Wrappers have not changed since the last JLL build. Using the JLL's support library."
end
else
@warn """LLVM.jl source code is not checked-out from Git.
This means we cannot check for changes, and need to unconditionally build the support library."""
include(joinpath(@__DIR__, "build_local.jl"))
end
7 changes: 1 addition & 6 deletions src/API/14/libMLIR_h.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@ struct MlirSymbolTable
ptr::Ptr{Cvoid}
end

"""
MlirAttribute
"""
struct MlirAttribute
ptr::Ptr{Cvoid}
end
Expand All @@ -188,9 +185,6 @@ struct MlirModule
ptr::Ptr{Cvoid}
end

"""
MlirType
"""
struct MlirType
ptr::Ptr{Cvoid}
end
Expand Down Expand Up @@ -5446,3 +5440,4 @@ end
function mlirRegisterTransformsViewOpGraph()
@ccall mlir_c.mlirRegisterTransformsViewOpGraph()::Cvoid
end

2 changes: 1 addition & 1 deletion src/Dialects/14/GPU.jl
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ module attributes {gpu.container_module} {
}
```
"""
function launch_func(asyncDependencies::Vector{Value}, gridSizeX::Value, gridSizeY::Value, gridSizeZ::Value, blockSizeX::Value, blockSizeY::Value, blockSizeZ::Value, dynamicSharedMemorySize=nothing::Union{Nothing, Value}, operands::Vector{Value}; asyncToken=nothing::Union{Nothing, MLIRType}, kernel, location=Location())
function launch_func(asyncDependencies::Vector{Value}, gridSizeX::Value, gridSizeY::Value, gridSizeZ::Value, blockSizeX::Value, blockSizeY::Value, blockSizeZ::Value, dynamicSharedMemorySize=nothing::Union{Nothing, Value}; operands::Vector{Value}, asyncToken=nothing::Union{Nothing, MLIRType}, kernel, location=Location())
results = MLIRType[]
operands = Value[asyncDependencies..., gridSizeX, gridSizeY, gridSizeZ, blockSizeX, blockSizeY, blockSizeZ, operands..., ]
owned_regions = Region[]
Expand Down
Loading

0 comments on commit 3405eab

Please sign in to comment.