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

Fix #5073: Slices of dynamic shared memory all alias #5099

Merged
merged 1 commit into from
Feb 26, 2020

Conversation

gmarkall
Copy link
Member

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.

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.
@gmarkall gmarkall changed the title [WIP] Fix #5073: Slices of dynamic shared memory all alias Fix #5073: Slices of dynamic shared memory all alias Jan 17, 2020
@gmarkall
Copy link
Member Author

Removed [WIP] now that CI has passed.

@stuartarchibald stuartarchibald added this to the Numba 0.49 RC milestone Jan 17, 2020
@stuartarchibald stuartarchibald added CUDA CUDA related issue/PR Pending BuildFarm For PRs that have been reviewed but pending a push through our buildfarm labels Jan 21, 2020
Copy link
Contributor

@stuartarchibald stuartarchibald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch. The code looks good and the tests cover the changes.

@stuartarchibald stuartarchibald added 4 - Waiting on CI Review etc done, waiting for CI to finish and removed 3 - Ready for Review labels Feb 26, 2020
@stuartarchibald
Copy link
Contributor

Farm build ID numba_smoketest_cuda_24.

@stuartarchibald stuartarchibald added 5 - Ready to merge Review and testing done, is ready to merge BuildFarm Passed For PRs that have been through the buildfarm and passed and removed 4 - Waiting on CI Review etc done, waiting for CI to finish Pending BuildFarm For PRs that have been reviewed but pending a push through our buildfarm labels Feb 26, 2020
@seibert seibert merged commit 0f2f216 into numba:master Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to merge Review and testing done, is ready to merge BuildFarm Passed For PRs that have been through the buildfarm and passed CUDA CUDA related issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants