Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.3 - Complete refactor #16

Closed
wants to merge 5 commits into from
Closed
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
1 change: 1 addition & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style = "yas"
29 changes: 21 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
name: CI
on:
- push
- pull_request
- workflow_dispatch
push:
branches:
- 'master'
- 'main'
- 'release-'
tags: '*'
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
Expand All @@ -11,24 +21,27 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- 'lts'
- '1' # automatically expands to the latest stable 1.x release of Julia
os:
- ubuntu-latest
- macOS-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
env:
JULIA_NUM_THREADS: 4
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: lcov.info
file: lcov.info
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Manifest.toml
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

88 changes: 0 additions & 88 deletions Manifest.toml

This file was deleted.

26 changes: 17 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
name = "TBLIS"
uuid = "48530278-0828-4a49-9772-0f3830dfa1e9"
authors = ["MattDavis <matthew.davis010@gmail.com>"]
version = "0.2.0"
authors = ["Lukas Devos <ldevos98@gmail.com>"]
version = "0.3.0"

[deps]
Hwloc_jll = "e33a78d0-f292-5ffc-b300-72abe9b543c8"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
tblis_jll = "9c7f617c-f299-5d18-afb6-044c7798b3d0"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "SafeTestsets", "Random", "Aqua"]

[compat]
julia = "1"
Hwloc_jll = "2"
tblis_jll = "1"
Aqua = "0.8.9"
Random = "1"
SafeTestsets = "0.1.0"
Test = "1"
julia = "1.10"
tblis_jll = "1.2"
4 changes: 4 additions & 0 deletions gen/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
tblis_jll = "9c7f617c-f299-5d18-afb6-044c7798b3d0"
9 changes: 9 additions & 0 deletions gen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# How to auto-generate the wrappers

1. `cd` to this directory
2. run `julia --project generator.jl`, then you could find the updated wrappers in the `lib` folder

## How to upgrade Clang.jl

1. `cd` to this directory
2. run `julia --project` and then in the Julia REPL, run `pkg> up`
38 changes: 38 additions & 0 deletions gen/generator.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()
using Pkg.Artifacts
using Clang.Generators
using Clang.Generators.JLLEnvs
using tblis_jll
using JuliaFormatter

cd(@__DIR__)

# ensure output path exists
outpath = joinpath(@__DIR__, "..", "src", "lib")
!isdir(outpath) && mkpath(outpath)

# headers
include_dir = normpath(joinpath(tblis_jll.artifact_dir, "include"))

tci_h = joinpath(include_dir, "tci.h")
@assert isfile(tci_h)
tblis_h = joinpath(include_dir, "tblis", "tblis.h")
@assert isfile(tblis_h)

# load common option
options = load_options(joinpath(@__DIR__, "generator.toml"))

# run generator for all platforms
for target in JLLEnvs.JLL_ENV_TRIPLES
@info "processing $target"
options["general"]["output_file_path"] = joinpath(outpath, "$target.jl")
path = options["general"]["output_file_path"]
args = get_default_args(target)
push!(args, "-I$include_dir")
header_files = [tci_h, tblis_h]
ctx = create_context(header_files, args, options)
build!(ctx)
format_file(path, YASStyle())
end
24 changes: 24 additions & 0 deletions gen/generator.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[general]

library_name = "tblis"

use_julia_native_enum_type = true
use_deterministic_symbol = true
auto_mutability = true

output_ignorelist = [
"TCI_WORK_ITEM_INIT",
"TBLIS_RESTRICT",
"scomplex",
"dcomplex",
]

[codegen]
use_ccall_macro = true

[codegen.macro]
macro_mode = "basic"

functionlike_macro_includelist = [

]
26 changes: 0 additions & 26 deletions src/Ops.jl

This file was deleted.

Loading
Loading