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

move to only support LTS and forward #131

Closed
wants to merge 2 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
59 changes: 15 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: CI
name: Run tests

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

# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
Expand All @@ -16,51 +14,24 @@ permissions:

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# See <https://julialang-s3.julialang.org/bin/versions.json> for available Julia versions
include:
- arch: "x64"
os: "ubuntu-latest"
version: "1.10"
- arch: "x64"
os: "windows-latest"
version: "1.10"
- arch: "x64"
os: "macOS-latest"
version: "1.10"
- arch: "x86"
os: "ubuntu-latest"
version: "1.10"
- arch: "x64"
os: "ubuntu-latest"
version: "1.9"
- arch: "x64"
os: "ubuntu-latest"
version: "1.8"
- arch: "x64"
os: "ubuntu-latest"
version: "1.7"
- arch: "x64"
os: "ubuntu-latest"
version: "1.6"
# - arch: "x64"
# os: "ubuntu-latest"
# version: "nightly"
julia-version: ['lts', '1']
julia-arch: [x64, x86]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good to be explicit about version numbers since SIMD.jl has some low-level code. I'd write '1.10, 1.11 here.

os: [ubuntu-latest, windows-latest, macOS-latest]
exclude:
- os: macOS-latest
julia-arch: x86
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macos-latest is now an ARM system. We should probably be explicitly about version numbers here and test on both macos-13 (x86-64) and macos-14 (arm64). The interesting thing here is that we can actually test on an ARM system!

It would probably also be good to be explicit about the Ubuntu and Windows versions.


steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v2
env:
CODECOV_TOKEN: 82aae245-ad5c-41ac-9e30-b64617ce25b0
with:
file: lcov.info
# with:
# annotate: true
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"

[compat]
PrecompileTools = "1"
julia = "1.6"
julia = "1.10"
11 changes: 2 additions & 9 deletions src/LLVM_intrinsics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,8 @@ const OVERFLOW_INTRINSICS = [
:umul_with_overflow
]

const SUPPORTS_VEC_OVERFLOW = Base.libllvm_version >= v"9"
for f in OVERFLOW_INTRINSICS
@eval @generated function $f(x::LVec{N, T}, y::LVec{N, T}) where {N, T <: IntegerTypes}
if !SUPPORTS_VEC_OVERFLOW
return :(error("LLVM version 9.0 or greater required (Julia 1.5 or greater)"))
end
ff = llvm_name($(QuoteNode(f)), N, T)
if $(QuoteNode(f)) == :smul_with_overflow && Sys.ARCH == :i686 && T == Int64
str = "this intrinsic ($ff) is broken on i686"
Expand Down Expand Up @@ -822,13 +818,12 @@ const HORZ_REDUCTION_OPS_INT = [
:umin
]

const horizontal_reduction_prefix = Base.libllvm_version < v"12" ? "experimental.vector.reduce." : "vector.reduce."
for (fs, c) in zip([HORZ_REDUCTION_OPS_FLOAT, HORZ_REDUCTION_OPS_INT],
[FloatingTypes, IntegerTypes])
for f in fs
f_red = Symbol("reduce_", f)
@eval @generated function $f_red(x::LVec{N, T}) where {N,T<:$c}
ff = llvm_name(string(horizontal_reduction_prefix, $(QuoteNode(f))), N, T)
ff = llvm_name(string("vector.reduce.", $(QuoteNode(f))), N, T)
mod = """
declare $(d[T]) @$ff(<$N x $(d[T])>)

Expand All @@ -849,9 +844,7 @@ for (fs, c) in zip([HORZ_REDUCTION_OPS_FLOAT, HORZ_REDUCTION_OPS_INT],
end

# The fadd and fmul reductions take an initializer
const horz_reduction_version = (v"9" < Base.libllvm_version < v"12") ? "v2." : ""
const horz_experimental = Base.libllvm_version < v"12" ? "experimental." : ""
const horizontal_reduction_2arg_prefix = "$(horz_experimental)vector.reduce.$horz_reduction_version"
const horizontal_reduction_2arg_prefix = "vector.reduce."
for (f, neutral) in [(:fadd, "0.0"), (:fmul, "1.0")]
f_red = Symbol("reduce_", f)
@eval @generated function $f_red(x::LVec{N, T}, ::F=nothing) where {N,T<:FloatingTypes, F<:FPFlags}
Expand Down
32 changes: 15 additions & 17 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,17 @@ llvm_ir(f, args) = sprint(code_llvm, f, Base.typesof(args...))
end

using Base.Checked: add_with_overflow, sub_with_overflow, mul_with_overflow
if Base.libllvm_version >= v"9"
@testset "overflow arithmetic" begin
for f in (add_with_overflow, sub_with_overflow, mul_with_overflow)
for T in [Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64]
t2 = div(typemax(T), T(2)) + one(T)
t1 = div(typemin(T), T(2)) - (T <: Unsigned ? zero(T) : one(T))
v = Vec(t2, t1, T(0), t2 - one(T))
if f == mul_with_overflow && Sys.ARCH == :i686 && T == Int64
@test_throws ErrorException f(v,v)
continue
end
@test Tuple(zip(Tuple.(f(v,v))...)) === map(f, Tuple(v), Tuple(v))
@testset "overflow arithmetic" begin
for f in (add_with_overflow, sub_with_overflow, mul_with_overflow)
for T in [Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64]
t2 = div(typemax(T), T(2)) + one(T)
t1 = div(typemin(T), T(2)) - (T <: Unsigned ? zero(T) : one(T))
v = Vec(t2, t1, T(0), t2 - one(T))
if f == mul_with_overflow && Sys.ARCH == :i686 && T == Int64
@test_throws ErrorException f(v,v)
continue
end
@test Tuple(zip(Tuple.(f(v,v))...)) === map(f, Tuple(v), Tuple(v))
end
end
end
Expand Down Expand Up @@ -552,7 +550,7 @@ llvm_ir(f, args) = sprint(code_llvm, f, Base.typesof(args...))
end

@testset "expandload" begin
if Base.libllvm_version >= v"9" || Sys.CPU_NAME == "skylake"
if Sys.CPU_NAME == "skylake"
for arr in [arri32, arrf64]
VT = Vec{4,eltype(arr)}
arr .= 1:length(arr)
Expand All @@ -563,12 +561,12 @@ llvm_ir(f, args) = sprint(code_llvm, f, Base.typesof(args...))
@test vloadx(arr, 1, Vec((false, false, false, false))) === VT((0, 0, 0, 0))
end
else
@info "Skipping tests for `expandload`" Base.libllvm_version Sys.CPU_NAME
@info "Skipping tests for `expandload`" Sys.CPU_NAME
end
end

@testset "compressstore" begin
if Base.libllvm_version >= v"9" || Sys.CPU_NAME == "skylake"
if Sys.CPU_NAME == "skylake"
for arr in [arri32, arrf64]
VT = Vec{4,eltype(arr)}
arr .= 1:length(arr)
Expand All @@ -585,7 +583,7 @@ llvm_ir(f, args) = sprint(code_llvm, f, Base.typesof(args...))
zero(arr)
end
else
@info "Skipping tests for `compressstore`" Base.libllvm_version Sys.CPU_NAME
@info "Skipping tests for `compressstore`" Sys.CPU_NAME
end
end

Expand Down Expand Up @@ -861,7 +859,7 @@ llvm_ir(f, args) = sprint(code_llvm, f, Base.typesof(args...))
return dest
end

if Base.libllvm_version >= v"9" || Sys.CPU_NAME == "skylake"
if Sys.CPU_NAME == "skylake"
let n = 15
src = randn(n)
pred = Vector{Bool}(src .> 0)
Expand Down
Loading