-
Notifications
You must be signed in to change notification settings - Fork 338
Closed
Description
macOS has different way dealing with AVX512 than Windows and Linux:
- By default AVX512 is off in the newly created thread, which means CPUID flags will indicate AVX512 availability, but OS support check (XCR0) will not succeed.
- AVX512 can be enabled either by calling
thread_set_state()
or by executing any AVX512 instruction, which would cause #UD exception handled by the OS.
This results in ISPC auto-dispatch routing to AVX2 execution instead fo AVX512.
Arguments for not enabling AVX512 as part of the dispatch:
- user need to opt-in for AVX512 explicitly, if AVX512 assumed to be called.
Arguments for enabling AVX512 as part of the dispatch:
- if AVX512 target was built and is part of available targets for auto-dispatch, the user assumes to run AVX512 when it's available.
I'm leaning towards enabling AVX512 by default by disabling OS support check (XCR0) on macOS, so execution would trigger OS enabling the AVX512 as a result of execution of ISPC code.
Here's the link to Darwin code with comments on implementation on-demand AVX512 support: link to apple/darwin-xpu
Metadata
Metadata
Assignees
Labels
No labels