Skip to content

Commit ccd9033

Browse files
CompatHelper: bump compat for "Static" to "0.7" (#147)
* CompatHelper: bump compat for "Static" to "0.7" * Integer = Union{Base.Integer,StaticInt} * Make last commit conditional Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Chris Elrod <[email protected]>
1 parent c08737e commit ccd9033

File tree

6 files changed

+14
-22
lines changed

6 files changed

+14
-22
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Octavian"
22
uuid = "6fd5a793-0b7e-452c-907f-f8bfe9c57db4"
33
authors = ["Mason Protter", "Chris Elrod", "Dilum Aluthge", "contributors"]
4-
version = "0.3.14"
4+
version = "0.3.15"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
@@ -23,7 +23,7 @@ LoopVectorization = "0.12.86"
2323
ManualMemory = "0.1.1"
2424
PolyesterWeave = "0.1.1"
2525
Requires = "1"
26-
Static = "0.2, 0.3, 0.4, 0.6"
26+
Static = "0.2, 0.3, 0.4, 0.6, 0.7"
2727
ThreadingUtilities = "0.5"
2828
VectorizationBase = "0.21.15"
2929
julia = "1.6"

src/Octavian.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ using ManualMemory: MemoryBuffer, load, store!
1717

1818
using ThreadingUtilities: _atomic_add!, _atomic_load, _atomic_store!, launch, wait, SPIN
1919

20+
if !(StaticInt <: Base.Integer)
21+
const Integer = Union{Base.Integer, StaticInt}
22+
end
23+
2024
export StaticInt
2125
export matmul!
2226
export matmul

src/funcptrs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function (::LoopMulFunc{P,TC,TA,TB,Α,Β,Md,Kd,Nd})(p::Ptr{UInt}) where {P,TC,TA
1515
end
1616
@inline _call_loopmul!(C, A, B, α, β, M, K, N, ::Val{false}) = loopmul!(C, A, B, α, β, M, K, N)
1717
@inline function _call_loopmul!(C::StridedPointer{T}, A, B, α, β, M, K, N, ::Val{true}) where {T}
18-
if M*K < first_cache_size(Val(T)) * R₂Default()
18+
if M*K < ceil(Int,Float64(first_cache_size(Val(T)) * R₂Default()))
1919
packaloopmul!(C, A, B, α, β, M, K, N)
2020
return
2121
else

src/global_constants.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,5 @@ bcache_count() = VectorizationBase.num_cache(second_cache())
7575
const BCACHEPTR = Ref{Ptr{Cvoid}}(C_NULL)
7676
const BCACHE_LOCK = Threads.Atomic{UInt}(zero(UInt))
7777

78-
@static if Sys.WORD_SIZE == 32
79-
const ACACHEPTR = Ref{Ptr{Cvoid}}(C_NULL)
80-
end
78+
const ACACHEPTR = Ref{Ptr{Cvoid}}(C_NULL)
8179

src/init.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,11 @@ function init_bcache()
2424
nothing
2525
end
2626

27-
@static if Sys.WORD_SIZE == 32
28-
function init_acache()
29-
if ACACHEPTR[] == C_NULL
30-
ACACHEPTR[] = VectorizationBase.valloc(first_cache_size() * init_num_tasks(), Cvoid, ccall(:jl_getpagesize, Int, ()))
31-
end
32-
nothing
27+
function init_acache()
28+
if ACACHEPTR[] == C_NULL
29+
ACACHEPTR[] = VectorizationBase.valloc(first_cache_size() * init_num_tasks(), Cvoid, ccall(:jl_getpagesize, Int, ()))
3330
end
34-
else
35-
init_acache() = nothing
31+
nothing
3632
end
3733

3834
function init_num_tasks()

src/memory_buffer.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22
@inline function first_cache_buffer(::Val{T}) where {T}
33
first_cache_buffer(Val{T}(), first_cache_size(Val(T)))
44
end
5-
@static if Sys.WORD_SIZE == 32
6-
@inline function first_cache_buffer(::Val{T}, N) where {T}
7-
reinterpret(Ptr{T}, ACACHEPTR[] + ((Threads.threadid()-1) * N) * static_sizeof(T))
8-
end
9-
else
10-
@inline function first_cache_buffer(::Val{T}, ::StaticInt{N}) where {T,N}
11-
MemoryBuffer{N,T}(undef)
12-
end
5+
@inline function first_cache_buffer(::Val{T}, N) where {T}
6+
reinterpret(Ptr{T}, ACACHEPTR[] + ((Threads.threadid()-1) * N) * static_sizeof(T))
137
end
148

159
BCache(i::Integer) = BCache(BCACHEPTR[]+cld_fast(second_cache_size()*i, Threads.nthreads()), i % UInt)

0 commit comments

Comments
 (0)