Skip to content
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

Platform detection incorrect for AVX2 support #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Lib/Codec/EbEncHandle.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static int32_t can_use_intel_avx512()
// Using bit-fields, the fastest function will always be selected based on the available functions in the function arrays
uint32_t get_cpu_asm_type()
{
uint32_t asm_type = 0;
uint32_t asm_type = 7; //This fixes the case where AVX2 is not getting invoked even when AVX2 is supported in the platform.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @techvintage ,

Please consider to implemente the checking for AMD CPUs, like what CanUseIntelAVX512() and Check4thGenIntelCoreFeatures() do for Intel CPUs. Your change occationally can work on your platform which supports AVX2, but cannot for other (old) platforms which can only support SSEx or no intrinsics.
In theory, GetCpuAsmType() should check all the x86 CPUs with SSE and/or AVX intrinsics supported, including Intel, AMD (and VIA).

Thanks!


if (can_use_intel_avx512() == 1)
asm_type = 7; // bit-field
Expand Down