|
| 1 | +macro warnpcfail(ex::Expr) |
| 2 | + modl = __module__ |
| 3 | + file = __source__.file === nothing ? "?" : String(__source__.file) |
| 4 | + line = __source__.line |
| 5 | + quote |
| 6 | + $(esc(ex)) || @warn """precompile directive |
| 7 | + $($(Expr(:quote, ex))) |
| 8 | + failed. Please report an issue in $($modl) (after checking for duplicates) or remove this directive.""" _file=$file _line=$line |
| 9 | + end |
| 10 | +end |
| 11 | + |
1 | 12 | function _precompile_()
|
2 | 13 | ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
|
3 |
| - @assert precompile(HyperRectangle{2,Float32}, (Int, Int, Int, Int)) |
4 |
| - @assert precompile(==, (HyperRectangle{2,Float32}, HyperRectangle{2,Float32})) |
5 |
| - @assert precompile(normal_mesh, (Tesselation{3,Float32,Cylinder{3,Float32},1},)) |
6 |
| - @assert precompile(normal_mesh, (Tesselation{3,Float32,HyperSphere{3,Float32},1},)) |
7 |
| - @assert precompile(normal_mesh, (HyperSphere{3,Float32},)) |
8 |
| - @assert precompile(Tuple{typeof(*),SMatrix{4, 4, Float32, 16},HyperRectangle{3, Float32}}) # time: 0.11091917 |
9 |
| - @assert precompile(Tuple{typeof(coordinates),HyperRectangle{2, Float32},Tuple{Int64, Int64}}) # time: 0.08693867 |
10 |
| - @assert precompile(union, (HyperRectangle{3, Float32}, HyperRectangle{3, Float32})) |
11 |
| - @assert precompile(Tuple{typeof(decompose),Type{Point{2, Float32}},HyperRectangle{2, Float32}}) # time: 0.026609203 |
12 |
| - @assert precompile(Tuple{Type{HyperRectangle{3, Float32}},HyperRectangle{2, Float32}}) # time: 0.023717888 |
13 |
| - @assert precompile(Tuple{typeof(+),HyperRectangle{3, Float32},Point{3, Float32}}) # time: 0.006633118 |
14 |
| - @assert precompile(Tuple{Type{Rect2D{T} where T},Float32,Float32,Float32,Float32}) # time: 0.001636267 |
15 |
| - @assert precompile(Tuple{typeof(*),HyperRectangle{2, Float32},Float32}) # time: 0.001057589 |
| 14 | + @warnpcfail precompile(HyperRectangle{2,Float32}, (Int, Int, Int, Int)) |
| 15 | + @warnpcfail precompile(==, (HyperRectangle{2,Float32}, HyperRectangle{2,Float32})) |
| 16 | + @warnpcfail precompile(normal_mesh, (Tesselation{3,Float32,Cylinder{3,Float32},1},)) |
| 17 | + @warnpcfail precompile(normal_mesh, (Tesselation{3,Float32,HyperSphere{3,Float32},1},)) |
| 18 | + @warnpcfail precompile(normal_mesh, (HyperSphere{3,Float32},)) |
| 19 | + @warnpcfail precompile(Tuple{typeof(*),SMatrix{4, 4, Float32, 16},HyperRectangle{3, Float32}}) # time: 0.11091917 |
| 20 | + @warnpcfail precompile(Tuple{typeof(coordinates),HyperRectangle{2, Float32},Tuple{Int64, Int64}}) # time: 0.08693867 |
| 21 | + @warnpcfail precompile(union, (HyperRectangle{3, Float32}, HyperRectangle{3, Float32})) |
| 22 | + @warnpcfail precompile(Tuple{typeof(decompose),Type{Point{2, Float32}},HyperRectangle{2, Float32}}) # time: 0.026609203 |
| 23 | + @warnpcfail precompile(Tuple{Type{HyperRectangle{3, Float32}},HyperRectangle{2, Float32}}) # time: 0.023717888 |
| 24 | + @warnpcfail precompile(Tuple{typeof(+),HyperRectangle{3, Float32},Point{3, Float32}}) # time: 0.006633118 |
| 25 | + @warnpcfail precompile(Tuple{Type{Rect2D{T} where T},Float32,Float32,Float32,Float32}) # time: 0.001636267 |
| 26 | + @warnpcfail precompile(Tuple{typeof(*),HyperRectangle{2, Float32},Float32}) # time: 0.001057589 |
16 | 27 |
|
17 | 28 | if Base.VERSION >= v"1.6.0-DEV.1083"
|
18 |
| - @assert precompile(triangle_mesh, (Polygon{2, Float32, Point2f0, LineString{2, Float32, Point2f0, |
| 29 | + @warnpcfail precompile(triangle_mesh, (Polygon{2, Float32, Point2f0, LineString{2, Float32, Point2f0, |
19 | 30 | Base.ReinterpretArray{Line{2, Float32}, 1, Tuple{Point2f0, Point2f0}, TupleView{Tuple{Point2f0, Point2f0}, 2, 1, Vector{Point2f0}}, false}},
|
20 | 31 | Vector{LineString{2, Float32, Point2f0, Base.ReinterpretArray{Line{2, Float32}, 1, Tuple{Point2f0, Point2f0}, TupleView{Tuple{Point2f0, Point2f0}, 2, 1, Vector{Point2f0}}, false}}}},))
|
21 | 32 | else
|
22 |
| - @assert precompile(triangle_mesh, (Polygon{2, Float32, Point2f0, LineString{2, Float32, Point2f0, |
| 33 | + @warnpcfail precompile(triangle_mesh, (Polygon{2, Float32, Point2f0, LineString{2, Float32, Point2f0, |
23 | 34 | Base.ReinterpretArray{Line{2, Float32}, 1, Tuple{Point2f0, Point2f0}, TupleView{Tuple{Point2f0, Point2f0}, 2, 1, Vector{Point2f0}}}},
|
24 | 35 | Vector{LineString{2, Float32, Point2f0, Base.ReinterpretArray{Line{2, Float32}, 1, Tuple{Point2f0, Point2f0}, TupleView{Tuple{Point2f0, Point2f0}, 2, 1, Vector{Point2f0}}}}}},))
|
25 | 36 | end
|
26 | 37 |
|
27 |
| - @assert precompile(split_intersections, (Vector{Point2f0},)) |
| 38 | + @warnpcfail precompile(split_intersections, (Vector{Point2f0},)) |
28 | 39 | end
|
0 commit comments