forked from AcademySoftwareFoundation/OpenImageIO
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev(ustring.h): string literal operator for ustring and ustringhash (A…
…cademySoftwareFoundation#3939) * Add string literal operators for ustring and ustringhash so you can write: ``` "foo"_us "bar"_ush ``` Note that on Cuda (but not on the host), this ustringhash construction is constexpr. * Add a new `ustringhash(const char*, size_t)` constructor, which is also constexpr on the device side. * Mark the existing `ustringhash(string_view)` constructor as constexpr on the device side. We can mark those things as constexpr on the device side because on the Cuda side, the implementation only takes the hash (which is constexpr), and does not actually add a ustring to the table (which cannot be constexpr). To make such declarations easy, add a new macro to platform.h, `OIIO_DEVICE_CONSTEXPR` which is constexpr for the device, merely inline for the host. --------- Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information
Showing
3 changed files
with
61 additions
and
6 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