diff --git a/Project.toml b/Project.toml index 089209f..77de5a1 100644 --- a/Project.toml +++ b/Project.toml @@ -3,7 +3,11 @@ uuid = "fdea26ae-647d-5447-a871-4b548cad5224" authors = ["Erik Schnetter ", "Kristoffer Carlsson "] version = "3.4.2" +[deps] +SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c" + [compat] +SnoopPrecompile = "1" julia = "1.6" [extras] diff --git a/src/SIMD.jl b/src/SIMD.jl index 121ec8f..12f9f97 100644 --- a/src/SIMD.jl +++ b/src/SIMD.jl @@ -17,9 +17,9 @@ const BIntegerTypes = Union{IntegerTypes, Bool} const FloatingTypes = Union{Float32, Float64} # Float16 support is non-native in Julia and gets passed as an i16 const ScalarTypes = Union{IntegerTypes, FloatingTypes} const VecTypes = Union{ScalarTypes, Ptr, Bool} - include("LLVM_intrinsics.jl") include("simdvec.jl") include("arrayops.jl") +include("precompile.jl") end diff --git a/src/precompile.jl b/src/precompile.jl new file mode 100644 index 0000000..5b071bf --- /dev/null +++ b/src/precompile.jl @@ -0,0 +1,14 @@ +using SnoopPrecompile + +@precompile_all_calls begin + for dim in (2, 3, 4) + v = SIMD.Vec(ntuple(i -> 0.0, dim)) + v + v + v * v + 1.0 * v + 1.0 + v + v2 = Base.setindex(v, 2.0, 1) + muladd(v, v, v) + SIMD.constantvector(1.0, Vec{dim, Float64}) + end +end