Skip to content

Commit

Permalink
Recompile invalidations from Static.jl
Browse files Browse the repository at this point in the history
Since we know that Static.jl gives a lot of invalidations, and this is the spot where the yare introduced into downstream usage, this can be done to force recompilation and get much better precompile caches. While this will increase precompilation time, this should just be spread out among other packages and not necessarily be as noticable (in fact maybe reducing the amount done in OrdinaryDiffEq?)
  • Loading branch information
ChrisRackauckas committed Sep 18, 2023
1 parent b182daf commit 1c368e0
Showing 1 changed file with 45 additions and 42 deletions.
87 changes: 45 additions & 42 deletions src/StaticArrayInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,51 @@ else
end
end

using ArrayInterface
import ArrayInterface: allowed_getindex, allowed_setindex!, aos_to_soa, buffer,
parent_type, fast_matrix_colors, findstructralnz,
has_sparsestruct,
issingular, isstructured, matrix_colors, restructure,
lu_instance,
safevec, zeromatrix, undefmatrix, ColoringAlgorithm,
fast_scalar_indexing, parameterless_type,
is_forwarding_wrapper,
map_tuple_type, flatten_tuples, GetIndex, SetIndex!,
defines_strides, ndims_index, ndims_shape,
stride_preserving_index

# ArrayIndex subtypes and methods
import ArrayInterface: ArrayIndex, MatrixIndex, VectorIndex, BidiagonalIndex,
TridiagonalIndex
# managing immutables
import ArrayInterface: ismutable, can_change_size, can_setindex
# constants
import ArrayInterface: MatAdjTrans, VecAdjTrans, UpTri, LoTri
# device pieces
import ArrayInterface: AbstractDevice, AbstractCPU, CPUPointer, CPUTuple, CheckParent,
CPUIndex, GPU, can_avx, device

using Static
using Static: Zero, One, nstatic, eq, ne, gt, ge, lt, le, eachop, eachop_tuple,
permute, invariant_permutation, field_type, reduce_tup, find_first_eq,
OptionallyStaticUnitRange, OptionallyStaticStepRange, OptionallyStaticRange,
IntType,
SOneTo, SUnitRange

using IfElse

using Base.Cartesian
using Base: @propagate_inbounds, tail, OneTo, LogicalIndex, Slice, ReinterpretArray,
ReshapedArray, AbstractCartesianIndex

using Base.Iterators: Pairs
using LinearAlgebra

import Compat
using PrecompileTools

@recompile_invalidations begin
using ArrayInterface
import ArrayInterface: allowed_getindex, allowed_setindex!, aos_to_soa, buffer,
parent_type, fast_matrix_colors, findstructralnz,
has_sparsestruct,
issingular, isstructured, matrix_colors, restructure,
lu_instance,
safevec, zeromatrix, undefmatrix, ColoringAlgorithm,
fast_scalar_indexing, parameterless_type,
is_forwarding_wrapper,
map_tuple_type, flatten_tuples, GetIndex, SetIndex!,
defines_strides, ndims_index, ndims_shape,
stride_preserving_index

# ArrayIndex subtypes and methods
import ArrayInterface: ArrayIndex, MatrixIndex, VectorIndex, BidiagonalIndex,
TridiagonalIndex
# managing immutables
import ArrayInterface: ismutable, can_change_size, can_setindex
# constants
import ArrayInterface: MatAdjTrans, VecAdjTrans, UpTri, LoTri
# device pieces
import ArrayInterface: AbstractDevice, AbstractCPU, CPUPointer, CPUTuple, CheckParent,
CPUIndex, GPU, can_avx, device

using Static
using Static: Zero, One, nstatic, eq, ne, gt, ge, lt, le, eachop, eachop_tuple,
permute, invariant_permutation, field_type, reduce_tup, find_first_eq,
OptionallyStaticUnitRange, OptionallyStaticStepRange, OptionallyStaticRange,
IntType,
SOneTo, SUnitRange

using IfElse

using Base.Cartesian
using Base: @propagate_inbounds, tail, OneTo, LogicalIndex, Slice, ReinterpretArray,
ReshapedArray, AbstractCartesianIndex

using Base.Iterators: Pairs
using LinearAlgebra

import Compat
end

"""
StrideIndex(x)
Expand Down Expand Up @@ -492,7 +496,6 @@ end

## Precompilation

using PrecompileTools
@setup_workload begin
# Putting some things in `setup` can reduce the size of the
# precompile file and potentially make loading faster.
Expand Down

0 comments on commit 1c368e0

Please sign in to comment.