-
Notifications
You must be signed in to change notification settings - Fork 364
Add build options to disable SSE intrinsics usage #1446
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?
Conversation
cmake ../media-driver/ -DENABLE_PRODUCTION_KMD=ON -DMEDIA_BUILD_FATAL_WARNINGS=OFF -DBUILD_CMRTLIB=OFF -DENABLE_X86_INTRINSICS=OFF Signed-off-by: XinfengZhang <[email protected]>
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.
Build fails. Why do we need this option to disable intrinsic? What's the rationale behind that?
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.
cm-related filed LGTM
@@ -52,6 +52,10 @@ cmake_dependent_option( BUILD_KERNELS | |||
option (BUILD_CMRTLIB "Build and Install cmrtlib together with media driver" ON) | |||
|
|||
option (ENABLE_PRODUCTION_KMD "Enable Production KMD header files" OFF) | |||
option (ENABLE_X86_INTRINSICS "Enable x86 intrinsics" ON) |
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.
This should not be configuration step check. Instead, this should be runtime check whether some features are supported or not. If not supported - disable these feature or select a supported path (since few implementations typically possible).
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.
Intel has _may_i_use_cpu_feature()
intrinsics function: https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_may_i_use_cpu_feature
GCC has __builtin_cpu_supports()
for runtime checks: https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/x86-Built-in-Functions.html
And other compilers have similar features.
Google provides "cpu_features" library (under Apache license).
@@ -53,7 +53,7 @@ set(MEDIA_COMPILER_FLAGS_COMMON | |||
-Wl,--gc-sections | |||
|
|||
# -m32 or -m64 | |||
-m${ARCH} | |||
#-m${ARCH} |
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.
why? If not needed - remove completely.
cmake ../media-driver/ -DENABLE_PRODUCTION_KMD=ON -DMEDIA_BUILD_FATAL_WARNINGS=OFF -DBUILD_CMRTLIB=OFF -DENABLE_X86_INTRINSICS=OFF
Signed-off-by: XinfengZhang [email protected]