Skip to content

Commit

Permalink
Update for VectorizationBase 0.16/LoopVec 0.10 (replace constants wit…
Browse files Browse the repository at this point in the history
…h functions)
  • Loading branch information
chriselrod committed Jan 25, 2021
1 parent db6bd7c commit 5d01036
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Gaius"
uuid = "bffe22d1-cb55-4f4e-ac2c-f4dd4bf58912"
authors = ["MasonProtter <[email protected]>"]
version = "0.6.2"
version = "0.6.3"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -13,10 +13,10 @@ VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"

[compat]
BenchmarkTools = "0.5"
LoopVectorization = "0.9.18"
LoopVectorization = "0.10"
StructArrays = "0.4.4"
UnsafeArrays = "1.0.1"
VectorizationBase = "0.15.2"
VectorizationBase = "0.16"
julia = "1.5"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion src/Gaius.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using LinearAlgebra: Adjoint, Transpose
using LoopVectorization: @avx
using StructArrays: StructArray
using UnsafeArrays: @uviews, UnsafeArray
using VectorizationBase: AVX512F, AbstractStridedPointer, gesp, vload, vstore!
using VectorizationBase: AbstractStridedPointer, gesp, vload, vstore!

export t_blocked_mul
export t_blocked_mul!
Expand Down
4 changes: 2 additions & 2 deletions src/choose_block_size.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function choose_block_size(C, A, B, ::Nothing)
if (*)(length(C) |> Int128, length(A) |> Int128, length(B) |> Int128) >= ((3DEFAULT_BLOCK_SIZE) >>> 1)^6
DEFAULT_BLOCK_SIZE
if (*)(length(C) |> Int128, length(A) |> Int128, length(B) |> Int128) >= ((3default_block_size()) >>> 1)^6
default_block_size()
else
32
end
Expand Down
2 changes: 1 addition & 1 deletion src/global_constants.jl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const DEFAULT_BLOCK_SIZE = AVX512F ? 96 : 64
@generated default_block_size() = VectorizationBase.has_feature("x86_64_avx512f") ? 96 : 64
2 changes: 1 addition & 1 deletion src/init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function __init__()
end

function _print_num_threads_warning()
sys_nc = VectorizationBase.NUM_CORES
sys_nc = VectorizationBase.num_cores()
jl_nt = Threads.nthreads()
return _print_num_threads_warning(sys_nc, jl_nt)
end
Expand Down
12 changes: 6 additions & 6 deletions src/public_mul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function mul_serial!(C::AbstractArray{T}, A::AbstractArray{T}, B::AbstractArray{
end

function mul!(C::StructArray{Complex{T}}, A::StructArray{Complex{T}}, B::StructArray{Complex{T}};
block_size = DEFAULT_BLOCK_SIZE, sizecheck=true) where {T <: Eltypes}
block_size = default_block_size(), sizecheck=true) where {T <: Eltypes}
sizecheck && check_compatible_sizes(C.re, A.re, B.re)

_block_size = choose_block_size(C, A, B, block_size)
Expand All @@ -113,7 +113,7 @@ function mul!(C::StructArray{Complex{T}}, A::StructArray{Complex{T}}, B::StructA
end

function mul_serial!(C::StructArray{Complex{T}}, A::StructArray{Complex{T}}, B::StructArray{Complex{T}};
block_size = DEFAULT_BLOCK_SIZE, sizecheck=true) where {T <: Eltypes}
block_size = default_block_size(), sizecheck=true) where {T <: Eltypes}
sizecheck && check_compatible_sizes(C.re, A.re, B.re)

_block_size = choose_block_size(C, A, B, block_size)
Expand All @@ -133,7 +133,7 @@ end
function mul!(C::Adjoint{Complex{T}, <:StructArray{Complex{T}}},
A::Adjoint{Complex{T}, <:StructArray{Complex{T}}},
B::StructArray{Complex{T}};
block_size = DEFAULT_BLOCK_SIZE, sizecheck=true) where {T <: Eltypes}
block_size = default_block_size(), sizecheck=true) where {T <: Eltypes}
sizecheck && check_compatible_sizes(C.parent.re', A.parent.re', B.re)

_block_size = choose_block_size(C, A, B, block_size)
Expand All @@ -155,7 +155,7 @@ end
function mul_serial!(C::Adjoint{Complex{T}, <:StructArray{Complex{T}}},
A::Adjoint{Complex{T}, <:StructArray{Complex{T}}},
B::StructArray{Complex{T}};
block_size = DEFAULT_BLOCK_SIZE, sizecheck=true) where {T <: Eltypes}
block_size = default_block_size(), sizecheck=true) where {T <: Eltypes}
sizecheck && check_compatible_sizes(C.parent.re', A.parent.re', B.re)

_block_size = choose_block_size(C, A, B, block_size)
Expand All @@ -177,7 +177,7 @@ end
function mul!(C::Transpose{Complex{T}, <:StructArray{Complex{T}}},
A::Transpose{Complex{T}, <:StructArray{Complex{T}}},
B::StructArray{Complex{T}};
block_size = DEFAULT_BLOCK_SIZE, sizecheck=true) where {T <: Eltypes}
block_size = default_block_size(), sizecheck=true) where {T <: Eltypes}
sizecheck && check_compatible_sizes(C.parent.re |> transpose, A.parent.re |> transpose, B.re)

_block_size = choose_block_size(C, A, B, block_size)
Expand All @@ -197,7 +197,7 @@ end
function mul_serial!(C::Transpose{Complex{T}, <:StructArray{Complex{T}}},
A::Transpose{Complex{T}, <:StructArray{Complex{T}}},
B::StructArray{Complex{T}};
block_size = DEFAULT_BLOCK_SIZE, sizecheck=true) where {T <: Eltypes}
block_size = default_block_size(), sizecheck=true) where {T <: Eltypes}
sizecheck && check_compatible_sizes(C.parent.re |> transpose, A.parent.re |> transpose, B.re)

_block_size = choose_block_size(C, A, B, block_size)
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using Test: @testset, @test, @test_logs, @test_throws

include("test_suite_preamble.jl")

@info("VectorizationBase.NUM_CORES is $(VectorizationBase.NUM_CORES)")
@info("VectorizationBase.num_cores() is $(VectorizationBase.num_cores())")

include("block_operations.jl")
include("public_mul_coverage.jl")
Expand Down

0 comments on commit 5d01036

Please sign in to comment.