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

What should we do when allocating nominal arrays? #166

Open
leissa opened this issue Dec 16, 2022 · 2 comments
Open

What should we do when allocating nominal arrays? #166

leissa opened this issue Dec 16, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@leissa
Copy link
Member

leissa commented Dec 16, 2022

What should we do with sth like this?

«i: n; «i as Nat; T»»

See #165.

@leissa leissa added the enhancement New feature or request label Dec 16, 2022
@NeuralCoder3
Copy link
Collaborator

NeuralCoder3 commented Jan 9, 2023

As note:
An alternative (to #165) way how this issue manifests is during code generation (instead of application):

%core.trait.* is expected to be resolved entirely before code generation.
In some cases, however, it remains and no size is computed.

Example: %core.trait.size «_3152207; «_3152209; .Idx 4294967296»».
Fork: Neuralcoder3
Branch: matrix_dialect
Call: ./build/bin/thorin -d matrix lit/matrix/print_const_dyn_mat.thorin -d affine -d direct -d clos -o - -VVVV --output-ll T.ll
Note: add_mem is disabled due to another bug (possibly related to projections)

The indices are statically unknown.

Note: Code generation fails with assert(false); without telling that it happens during code generation or what is wrong.
A more informative error like assert(false && "trait should be lowered before codegen"); would be helpful.

@leissa
Copy link
Member Author

leissa commented Jan 9, 2023

We've already mentioned that in a couple of other issues like #9 that we probably want to move away from assertions and instead use proper error messages/exceptions instead. In the midterm we could expose this "failure is an option" to the compilation pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants