Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add oneto(::StaticInt{N}) #99

Merged
merged 2 commits into from
Feb 20, 2023
Merged

Add oneto(::StaticInt{N}) #99

merged 2 commits into from
Feb 20, 2023

Conversation

chriselrod
Copy link
Collaborator

No description provided.

@chriselrod
Copy link
Collaborator Author

(T, #= /home/chriselrod/.julia/dev/LoopVectorization/test/broadcast.jl:10 =# @__LINE__()) = (Float32, 10)
broadcast_float: Error During Test at /home/chriselrod/.julia/dev/LoopVectorization/test/broadcast.jl:16
  Test threw exception
  Expression: LoopVectorization.static_size(bl) === (size(b, 1), size(b, 2), LoopVectorization.StaticInt(1))
  MethodError: no method matching Base.OneTo(::Static.StaticInt{1})
  
  Closest candidates are:
    Base.OneTo(::T) where T<:Integer
     @ Base range.jl:462
    Base.OneTo(::AbstractRange{T}) where T<:Integer
     @ Base range.jl:463
  
  Stacktrace:
   [1] oneto(r::Static.StaticInt{1})
     @ Base ./range.jl:464
   [2] map
     @ ./tuple.jl:291 [inlined]
   [3] axes
     @ ./abstractarray.jl:98 [inlined]
   [4] static_axes
     @ ~/.julia/packages/StaticArrayInterface/gJiae/src/axes.jl:111 [inlined]
   [5] _maybe_size(#unused#::Base.HasShape{3}, a::LowDimArray{(true, true, false), Float32, 3, Array{Float32, 3}})
     @ StaticArrayInterface ~/.julia/packages/StaticArrayInterface/gJiae/src/size.jl:28
   [6] static_size
     @ ~/.julia/packages/StaticArrayInterface/gJiae/src/size.jl:23 [inlined]

Failure from LV's tests on a local branch, updating to ArrayInterface 7.
I could look into what changed, but defining this is easier.

@codecov
Copy link

codecov bot commented Feb 20, 2023

Codecov Report

Merging #99 (3a3069c) into master (f5ebd54) will decrease coverage by 0.15%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master      #99      +/-   ##
==========================================
- Coverage   99.42%   99.28%   -0.15%     
==========================================
  Files           3        3              
  Lines         696      699       +3     
==========================================
+ Hits          692      694       +2     
- Misses          4        5       +1     
Impacted Files Coverage Δ
src/ranges.jl 99.00% <0.00%> (-0.50%) ⬇️
src/Static.jl 99.28% <0.00%> (+<0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@chriselrod
Copy link
Collaborator Author

Those piracy checks were false positives.

Example showing that `IntType` seems to be fine:
```julia
julia> struct Bar end

julia> const MyUnion = Union{Bar,Int}
MyUnion (alias for Union{Bar, Int64})

julia> MyUnion(::Int) = throw("uh oh")
MyUnion (alias for Union{Bar, Int64})

julia> MyUnion(3)
ERROR: "uh oh"
Stacktrace:
 [1] MyUnion(#unused#::Int64)
   @ Main ./REPL[4]:1
 [2] top-level scope
   @ REPL[5]:1

julia> Int(3)
3
```
@ChrisRackauckas ChrisRackauckas merged commit 000c7ec into master Feb 20, 2023
@ChrisRackauckas ChrisRackauckas deleted the oneto branch February 20, 2023 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants