Maximise the usage of dynamic shared memory for GaussianSmoothingKernel #519
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR maximises the usage of available dynamic shared memory for a particular GPU device by explicitly opt-in for the
GaussianSmoothingKernel
. Both pycuda and CuPy version are modified, and a flag is added to the respectiveload_kernel
function to support this behaviour. The modification ofload_kernel
allows future kernels to utilise the full shared memory capacity, should the need arises.The benefit of this is that
GaussianSmoothingKernel
is able to support a largersmooth_gradient
, as the smoothing radius is limited by the 'halo' in the CUDA kernel which uses dynamic shared memory.However, this does not completely solve #497 as it still limits
smooth_gradient
, but it does allow a larger value if your GPU has a shared memory capacity greater than 48 kB. Smoothing in the reciprocal space #504 will remove this limit.