rusticl: Add RUSTICL_FEATURES=intel

We're going to hide some of the cl_intel_* extensions behind that until
they start stabilizing.

Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31772>
This commit is contained in:
Adam Jackson 2025-05-23 11:12:01 -04:00 committed by Marge Bot
parent f07ccd9142
commit 96e99d47e7
2 changed files with 4 additions and 0 deletions

View file

@ -1188,6 +1188,7 @@ Rusticl environment variables
- ``fp16`` enables OpenCL half support
- ``fp64`` enables OpenCL double support
- ``intel`` enables various Intel OpenCL extensions
.. envvar:: RUSTICL_DEBUG

View file

@ -46,6 +46,7 @@ pub struct PlatformDebug {
pub struct PlatformFeatures {
pub fp16: bool,
pub fp64: bool,
pub intel: bool,
}
static PLATFORM_ENV_ONCE: Once = Once::new();
@ -72,6 +73,7 @@ static mut PLATFORM_DBG: PlatformDebug = PlatformDebug {
static mut PLATFORM_FEATURES: PlatformFeatures = PlatformFeatures {
fp16: false,
fp64: false,
intel: false,
};
fn load_env() {
@ -108,6 +110,7 @@ fn load_env() {
match flag {
"fp16" => features.fp16 = true,
"fp64" => features.fp64 = true,
"intel" => features.intel = true,
"" => (),
_ => eprintln!("Unknown RUSTICL_FEATURES flag found: {}", flag),
}