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

Respect environment variables for disabling Vector support #84461

Closed
jeffhandley opened this issue Apr 7, 2023 · 2 comments
Closed

Respect environment variables for disabling Vector support #84461

jeffhandley opened this issue Apr 7, 2023 · 2 comments

Comments

@jeffhandley
Copy link
Member

As was metnioned in #84115 (comment)_, it would be relatively simple to recognize environment variables for disabling vector support--especially to help with testing.

Today, setting DOTNET_EnableAVX2=0 results in Vector256.IsHardwareAccelerated returning false and setting DOTNET_EnableHWIntrinsic=0 will result in Vector64.IsHardwareAccelerated and Vector.IsHardwareAccelerated returning false.

Instead of requiring those two environment variables to be set and used in different test runs, we could respect DOTNET_EnableVector128 and probably several others. This approach would make the test scenarios easier to reason about..

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 7, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Apr 7, 2023
@jeffhandley jeffhandley added area-System.Runtime.Intrinsics and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Apr 7, 2023
@jeffhandley jeffhandley added this to the 8.0.0 milestone Apr 7, 2023
@ghost
Copy link

ghost commented Apr 7, 2023

Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics
See info in area-owners.md if you want to be subscribed.

Issue Details

As was metnioned in #84115 (comment)_, it would be relatively simple to recognize environment variables for disabling vector support--especially to help with testing.

Today, setting DOTNET_EnableAVX2=0 results in Vector256.IsHardwareAccelerated returning false and setting DOTNET_EnableHWIntrinsic=0 will result in Vector64.IsHardwareAccelerated and Vector.IsHardwareAccelerated returning false.

Instead of requiring those two environment variables to be set and used in different test runs, we could respect DOTNET_EnableVector128 and probably several others. This approach would make the test scenarios easier to reason about..

Author: jeffhandley
Assignees: -
Labels:

area-System.Runtime.Intrinsics, untriaged

Milestone: -

@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Apr 7, 2023
@tannergooding
Copy link
Member

There is a better way to control this via the DOTNET_MaxVectorTBitWidth property that impacts the size of Vector<T>.

There also exists an undocumented DOTNET_PreferredVectorBitWidth that impacts whether Vector256/512.IsHardwareAccelerated report true.

Vector128 and Vector<T> themselves are "core" types for many platforms and DOTNET_EnableHWIntrinsic is the only way to disable them by design.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants