From f899df048172320aa0df715f139b8ca3e8a347f5 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Thu, 1 Aug 2024 19:14:44 -0700 Subject: [PATCH] feat: support Static 1+ --- Project.toml | 4 ++-- src/matmul.jl | 4 ++-- src/utils.jl | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index a5916e0..47415e4 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Octavian" uuid = "6fd5a793-0b7e-452c-907f-f8bfe9c57db4" authors = ["Chris Elrod", "Dilum Aluthge", "Mason Protter", "contributors"] -version = "0.3.27" +version = "0.3.28" [deps] CPUSummary = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" @@ -34,7 +34,7 @@ LoopVectorization = "0.12.86" ManualMemory = "0.1.1" PolyesterWeave = "0.1.1, 0.2" PrecompileTools = "1" -Static = "0.8.4" +Static = "0.8.4, 1" StaticArrayInterface = "1" ThreadingUtilities = "0.5" VectorizationBase = "0.21.15" diff --git a/src/matmul.jl b/src/matmul.jl index 94f38ac..f3efc56 100644 --- a/src/matmul.jl +++ b/src/matmul.jl @@ -965,7 +965,7 @@ function sync_mul!( while _atomic_load(atomp) ≠ sync_iters pause() end - atomp += cache_linesize() + atomp = __add(atomp, cache_linesize()) end end # multiply @@ -994,7 +994,7 @@ function sync_mul!( while _atomic_load(atomp + 4) ≠ sync_iters pause() end - atomp += cache_linesize() + atomp = __add(atomp, cache_linesize()) end end end diff --git a/src/utils.jl b/src/utils.jl index 1f8d8df..58f6535 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -103,3 +103,7 @@ end stridedpointer($gf(sp, :p), si, StaticInt{$Bn}()) end end + +__add(x, y) = x + y +__add(x::Ptr, ::StaticInt{N}) where {N} = x + N +__add(::StaticInt{N}, y::Ptr) where {N} = y + N