Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making OpenCL radial profile evaluation additive
In af8c045 we changed the way profiles put values into the target Image object from being a straight value copying to be additive. This removed the need for an extra memory allocation in the Model, plus it simplified the process of combining results from different profiles in an effective way. An oversight to that change was the OpenCL implementation of the radial profiles, which were still overwriting values when writing to the target image. This is fixed in this commit. To simplify the solution we are performing an extra memory allocation here to give the OpenCL kernels a clean slate, as usual; otherwise we would need to change all OpenCL kernels to make *them* additive, and we would always have to transfer the current contents of the image first into the OpenCL device before the kernel is launched (which we currently avoid with OpenCL 1.2 devices by doing a fill operation with 0s, when possible). On top of that, for floating-point kernels we would still require an extra allocation anyway. A new unit test has been added to double-check that when evaluating a Model with two radial profiles via OpenCL we still get a sensible image. The test adds two diametrically opposed profiles and then checks that their centers have the same flux, which wouldn't be the case if only one of them makes it into the final image. When doing this work I also realized that when the 'rough' parameter is set, we were not scaling the resulting image by the pixel scale, so I'm fixing that as well. Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
- Loading branch information
Showing
3 changed files
with
51 additions
and
19 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
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