You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oh that's interesting. thread_halves looks at the bit-size of number types as part of a heuristic about how finely to divide up the work. And apparently I never considered that this could be an abstract type like Integer, it should really be more robust.
But as Chris says, you almost certainly want concrete types for any real work:
julia> a .= rand.((1:99,));
julia> @btime sum($a); # sum array of eltype Integer
255.399 ms (13354663 allocations: 203.78 MiB)
julia> a_int = Int.(a); # equivalent but concrete type
julia> @btime sum($a_int);
2.758 ms (0 allocations: 0 bytes)
Hi! I'm new to Julia so might be missing something here.
When I start Julia with
julia -t N
where N is 4 or so, and run this example:Then I get this error:
ERROR: LoadError: Abstract type Integer does not have a definite size.
When I only start my session with
julia
or when I useInt64
instead ofInteger
or when I have smaller arrays, then the code runs.The text was updated successfully, but these errors were encountered: