Skip to content

Commit

Permalink
switch to SnoopPrecompile.jl (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha authored Jan 5, 2023
1 parent 5c30e4a commit cfc3a87
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Octavian"
uuid = "6fd5a793-0b7e-452c-907f-f8bfe9c57db4"
authors = ["Chris Elrod", "Dilum Aluthge", "Mason Protter", "contributors"]
version = "0.3.19"
version = "0.3.20"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
Expand All @@ -11,6 +11,7 @@ LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
ManualMemory = "d125e4d3-2237-4719-b19c-fa641b8a4667"
PolyesterWeave = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c"
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
ThreadingUtilities = "8290d209-cae3-49c0-8002-c8c24d57dab5"
VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
Expand All @@ -23,6 +24,7 @@ LoopVectorization = "0.12.86"
ManualMemory = "0.1.1"
PolyesterWeave = "0.1.1, 0.2"
Requires = "1"
SnoopPrecompile = "1"
Static = "0.7.5, 0.8"
ThreadingUtilities = "0.5"
VectorizationBase = "0.21.15"
Expand Down
28 changes: 19 additions & 9 deletions src/Octavian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ using ManualMemory: MemoryBuffer, load, store!

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

using SnoopPrecompile: @precompile_setup, @precompile_all_calls

if !(StaticInt <: Base.Integer)
const Integer = Union{Base.Integer,StaticInt}
end
Expand All @@ -63,18 +65,26 @@ include("complex_matmul.jl")
include("init.jl") # `Octavian.__init__()` is defined in this file

@static if VERSION >= v"1.8.0-beta1"
let
@precompile_setup begin
# Putting some things in `setup` can reduce the size of the
# precompile file and potentially make loading faster.
__init__()
A64 = rand(100, 100)
matmul(A64, A64)
matmul(A64', A64)
matmul(A64, A64')
matmul(A64', A64')
A32 = rand(Float32, 100, 100)
matmul(A32, A32)
matmul(A32', A32)
matmul(A32, A32')
matmul(A32', A32')

@precompile_all_calls begin
# All calls in this block will be precompiled, regardless of whether
# they belong to Octavian.jl or not (on Julia 1.8 and higher).
matmul(A64, A64)
matmul(A64', A64)
matmul(A64, A64')
matmul(A64', A64')

matmul(A32, A32)
matmul(A32', A32)
matmul(A32, A32')
matmul(A32', A32')
end
end
end

Expand Down

2 comments on commit cfc3a87

@chriselrod
Copy link
Collaborator

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/75177

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.20 -m "<description of version>" cfc3a872bc816627c248e8cb910d54befe924757
git push origin v0.3.20

Please sign in to comment.