Fix GPU addressing bug
While working on BFS discovered a bug in the address computations for the GPU backend when dealing with arrays of products.
Discovered a few issues that were causing this
- The size of the element type of an array was not being put in parentheses leading to very weird computations
- Offsets into a record were not being computed correctly (there was an unnecessary subtraction)
- Offsets into a record were not being generated in code
- When processing indices the type of the current collection was not being updated which is necessary to properly compute sizes
- (Actually unrelated, but noticed it) Sizes of arrays were not being computed properly, it was using
get_alignment
as the element size rather thanget_size
.
See comments for some questions I have related to extra_dim_collects
.
Merge request reports
Activity
requested review from @rarbore2
assigned to @aaronjc4
- Resolved by Aaron Councilman
I'm not 100% certain what the
extra_dim_collects
are, but I assume it's related to collections that we add extra dimensions to collect the results from each GPU thread (or something similar).If that's the case, I suspect it should only be considered when we're looking at a "top-level" type, in particular therefore when computing sizes in
get_size
recursive calls would always getNone
for this argument, and I think incodegen_collect
again only at the top-level collection would we pass in the provided value, on subsequent indices it should passNone
toget_size
.
enabled an automatic merge when all merge checks for cd96d833 pass
mentioned in commit 4ceecb94