test whether image fits into CUDA textures #89
Merged
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.
Description
Several recent bug reports are concerned with images that exceed the CUDA Texture size, but where PopSift just says "out of memory".
This PR adds a method testTextureFit() to class PopSift. This test can be called explicitly to test whether PopSift can be used for a given image and downscale factor, but even if it is not called explicitly, it is called during enqueue(). If an exceeded texture size is detected during enqueue(), NULL will be returned and a multi-line error string is printed on cerr to explain the error (because there are 2 different limits: (linear texture for image loading and layered texture for DoG pyramid creation).
The PR adds also the method testTextureFitErrorString() to get the multi-line explanation as a string for the caller's own purposes.
Features list
New method PopSift::testTextureFit.
New method PopSift::testTextureFitErrorString.
Provides explanations and hints for errors #77 and #88.
Implementation remarks
PopSift::enqueue changes behaviour. It can now return NULL if it will be impossible to process the given image size.