Fix Cython compilation warnings in NL Means and Watershed#2947
Merged
jni merged 2 commits intoscikit-image:masterfrom Mar 8, 2018
Merged
Fix Cython compilation warnings in NL Means and Watershed#2947jni merged 2 commits intoscikit-image:masterfrom
jni merged 2 commits intoscikit-image:masterfrom
Conversation
Per Cython warning, declare type of the index variable to improve performance and resolve the warning.
As per Cython warning message: ``` [1/1] Cythonizing ./work/scikit-image/skimage/restoration/_nl_means_denoising.pyx warning: skimage/restoration/_nl_means_denoising.pyx:15:26: Declarations should not be declared inline. ```
soupault
reviewed
Jan 25, 2018
|
|
||
| cdef extern from "fast_exp.h": | ||
| inline double fast_exp(double y) nogil | ||
| double fast_exp(double y) nogil |
Member
There was a problem hiding this comment.
Does this change bring an overhead?
Contributor
Author
There was a problem hiding this comment.
I do not think so, since it is declared inline in the header fast_exp.h. The warning indicated this need not be duplicated, as best I understood.
soupault
approved these changes
Jan 29, 2018
Member
|
Cool! I pulled the branch and found ~5% speed increase for 2D images and ~15% for 3D images! (The different speed makes sense because pixels in 3D images have more neighbors.) Thanks @oleksandr-pavlyk! |
Member
|
(My statements above apply to watershed — I don't expect a speedup in NL Means.) |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Addressed Cython warnings emitted during cythonization step of scikit-image build process:
I am using Cython 0.27.3.