-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #5073: Slices of dynamic shared memory all alias
The root of the issue was that computations of indices and slice bounds were incorrect because the shape of dynamic shared memory is generally (0,). To fix this, we compute the shape (1-D only) of dynamic shared arrays using the dynamic shared memory size and the itemsize of the type of the array when it is created. This is implemented by reading the special register %dynamic_smem_size - unfortunately NVVM doesn't provide an intrinsic for this, so we access it using inline assembly. As part of these changes, the `_generic_array` function is refactored and `_make_array` folded into it (`_generic_array` was the only caller and its parameters were the same as its local variables). The refactored version checks for errors earlier on and moves groups the creation of various variables more closely with their usages.
- Loading branch information
Showing
2 changed files
with
291 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters