Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

XinfengZhang
Copy link
Contributor

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]

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]>
Copy link
Contributor

@dvrogozh dvrogozh left a 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?

Copy link
Contributor

@HeFan2017 HeFan2017 left a 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)
Copy link
Contributor

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).

Copy link

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}
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants