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

ERROR: LoadError: Abstract type Integer does not have a definite size. #148

Open
verena-neufeld opened this issue Jun 16, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@verena-neufeld
Copy link

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:

using Tullio

a = Array{Integer}(undef, 5, 9000, 300)
b = zeros(Integer, 5, 9000)
c = zeros(Integer, 5, 300)

@tullio a[i, j, k] = b[i, j] - c[i, k]

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 use Int64 instead of Integer or when I have smaller arrays, then the code runs.

@chriselrod
Copy link
Contributor

I'd strongly suggest using Int instead of Integer.

@mcabbott
Copy link
Owner

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)

@mcabbott mcabbott added the bug Something isn't working label Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants