make hash functions constexpr friendly so we can compute string hashe… #2843
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 makes the hash functions
constexpr
friendly. If you're compiling for a CUDA device, then they will also be declared with__device__
as well.Description
I have pretty much excised all the hashing code from
farmhash.cpp
and have moved it to a new file,farmhash.h
. As such, I suppose we should change the copyright notice infarmhash.cpp
since it no longer contains any google code.Tests
I have a local OSL branch that uses ustring hashes in lieu of
const char *
for CUDA/OptiX code and it successfully grabs the the constexpr ustring hash at compile time when building the CUDA code. Also, I don't see any changes in the testsuite in this branch compared to 'master' on my machine.Checklist:
have previously submitted a Contributor License Agreement
(individual, and if there is any way my
employers might think my programming belongs to them, then also
corporate).
(adding new test cases if necessary).