-
Notifications
You must be signed in to change notification settings - Fork 2k
OpenColorIO: Add options for SIMD optimization support #26105
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
7069e97
4209245
e4c7358
59a4d0a
52ac089
8545826
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,12 +22,36 @@ class OpenColorIOConan(ConanFile): | |
options = { | ||
"shared": [True, False], | ||
"fPIC": [True, False], | ||
"use_sse": [True, False], | ||
|
||
# OCIO supports a number of optimized code paths using different SIMD instruction sets. | ||
# By default it will determin the support of the current platform. A setting of none keeps | ||
# those defaults, True or False will intentionally set the values. | ||
# OCIO_USE_SSE was an option in older versions (< 2.3.2), newer versions support the following | ||
# instruction sets OCIO_USE_SSE2 up to OCIO_USE_AVX512 (no pure SSE anymore). | ||
"use_sse": ['default', True, False], | ||
"use_sse2": ['default', True, False], | ||
#"use_sse3": ['default', True, False], | ||
"use_ssse3": ['default', True, False], | ||
"use_sse4": ['default', True, False], | ||
"use_sse42": ['default', True, False], | ||
"use_avx": ['default', True, False], | ||
"use_avx2": ['default', True, False], | ||
#"use_avx512": ['default', True, False], | ||
"use_f16c": ['default', True, False], | ||
} | ||
default_options = { | ||
"shared": False, | ||
"fPIC": True, | ||
"use_sse": True, | ||
"use_sse2": 'default', | ||
#"use_sse3": 'default', | ||
"use_ssse3": 'default', | ||
"use_sse4": 'default', | ||
"use_sse42": 'default', | ||
"use_avx": 'default', | ||
"use_avx2": 'default', | ||
#"use_avx512": 'default', | ||
"use_f16c": 'default', | ||
} | ||
|
||
def export_sources(self): | ||
|
@@ -117,7 +141,37 @@ def generate(self): | |
tc.variables["TINYXML_OBJECT_LIB_EMBEDDED"] = False | ||
tc.variables["USE_EXTERNAL_LCMS"] = True | ||
|
||
tc.variables["OCIO_USE_SSE"] = self.options.get_safe("use_sse", False) | ||
# Selection of SIMD Instruction sets | ||
if not self.options.get_safe("use_sse", 'default') is 'default': | ||
print('Set OCIO_USE_SSE to ', self.options.use_sse) | ||
tc.variables["OCIO_USE_SSE"] = self.options.use_sse | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This specific OCIO_USE_SSE I don't see it in https://github.com/AcademySoftwareFoundation/OpenColorIO/blob/6fa40a4f6c3f0dd9f52f2476c3279927d5f23d71/CMakeLists.txt#L263, sure it exists? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It exists in older release, https://github.com/AcademySoftwareFoundation/OpenColorIO/blob/2.1.1/CMakeLists.txt#L148 |
||
if not self.options.get_safe("use_sse2", None) is None: | ||
print('Set OCIO_USE_SSE2 to ', self.options.use_sse2) | ||
tc.variables["OCIO_USE_SSE2"] = self.options.use_sse2 | ||
if not self.options.get_safe("use_sse3", None) is None: | ||
print('Set OCIO_USE_SSE3 to ', self.options.use_sse3) | ||
tc.variables["OCIO_USE_SSE3"] = self.options.use_sse3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get why |
||
if not self.options.get_safe("use_ssse3", None) is None: | ||
print('Set OCIO_USE_SSSE3 to ', self.options.use_ssse3) | ||
tc.variables["OCIO_USE_SSSE3"] = self.options.use_ssse3 | ||
if not self.options.get_safe("use_sse4", None) is None: | ||
print('Set OCIO_USE_SSE4 to ', self.options.use_sse4) | ||
tc.variables["OCIO_USE_SSE4"] = self.options.use_sse4 | ||
if not self.options.get_safe("use_sse42", None) is None: | ||
print('Set OCIO_USE_SSE42 to ', self.options.use_sse42) | ||
tc.variables["OCIO_USE_SSE42"] = self.options.use_sse42 | ||
if not self.options.get_safe("use_avx", 'default') is 'default': | ||
print('Set OCIO_USE_AVX to ', self.options.use_avx) | ||
tc.variables["OCIO_USE_AVX"] = self.options.use_avx | ||
if not self.options.get_safe("use_avx2", 'default') is 'default': | ||
print('Set OCIO_USE_AVX2 to ', self.options.use_avx2) | ||
tc.variables["OCIO_USE_AVX2"] = self.options.use_avx2 | ||
if not self.options.get_safe("use_avx512", 'default') is 'default': | ||
print('Set OCIO_USE_AVX512 to ', self.options.use_avx512) | ||
tc.variables["OCIO_USE_AVX512"] = self.options.use_avx512 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use_avx2 is set to default and the if is still true, while I commented out use_avx512 so it falls back to the default-param of get_safe, which is the same anyway. Don't get an output printed for use_avx512 but for use_avx2, where I'd expect both to not output anything in the default case! |
||
if not self.options.get_safe("use_f16c", 'default') is 'default': | ||
print('Set OCIO_USE_F16C to ', self.options.use_f16c) | ||
tc.variables["OCIO_USE_F16C"] = self.options.use_f16c | ||
|
||
# openexr 2.x provides Half library | ||
tc.variables["OCIO_USE_OPENEXR_HALF"] = True | ||
|
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.
The
print()
must be removed before merging. The ways to display information in recipes is viaself.output.info/verbose/warning/..
, but it seems this wouldn't be necessary, I'd remove the prints.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.
It sounds like this logic could be done in a for-loop in a more compact way.