-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Move the init of static variables to library load time #4640
Move the init of static variables to library load time #4640
Conversation
Wow, seems like apple-clang doesn't keep the lambdas unique |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear all,
this looks like a valid solution to #1593, thanks @kunaltyagi
I am not sure if I am allowed to approve a pull request, therefore I just create a review with a general comment.
Best,
Viktor
@kunaltyagi What do you think about moving the |
Sounds like a good idea. I'll take a deeper look either tomorrow or after the weekend. |
2a41f86
to
2f18899
Compare
@larshg Need help on windows 😄 |
It seems MSVC has a bug with constexpr and lambda - see here. Setting them to just static instead of constexpr, then it works - not sure if that is sufficient? Alternatively, you could add an additional definition of |
Thanks @larshg. That worked wonders |
Great😅 |
I'll have to check this error on Windows before merging:
|
I'm unable to test why Windows is having such a large error in registration. On linux machines, the error is approx 4e-5, much lower than on Windows (reducing the LUT size used in GICP6D increases error, but going to 1024 increases it to only 4.5e-5) Any ideas? Is this due to difference in c math lib? |
Perhaps because the second LUT is of float type, not of double? Not really a good explanation, but something to test out. Else you could try to replace the second LUT with a normal computation as it was before to check if that is the problem. |
This shouldn't be the case. The LUT are static variables inside the function. They are created on the first function call, and in a thread-safe manner (guarantee of language). Once init, they are returned safely. Re: adding a class for easy conversion Re: float vs double |
Ok, from my side, this is good to merge 👍 |
Added header for `array`, newly added in this PR Move the LUT for sRGB and XYZ to common, Also utilize them in gicp6d and SHOT
Not used for XYZ due to windows getting low accuracy with LUT
8b1161c
to
400a4ec
Compare
Possibly fixes #1593 (race condition in OMP implementation of SHOT)