rusticl/program: set __OPENCL_C_VERSION__ ourselves

Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
This commit is contained in:
Karol Herbst 2026-06-04 14:58:35 +02:00 committed by Marge Bot
parent 7aa9a36ade
commit 6abe48d835

View file

@ -400,6 +400,14 @@ impl CompileOptions {
ver => args.push(c"-cl-std=CL".concat(ver.api_cstr())),
}
// We set this define ourselves, so that we don't rely on clang to set it properly as 3.1
// is still quite new and we can't rely on users having a clang that supports this.
if clc_ver >= CLVersion::Cl3_1 {
args.push(c"-U__OPENCL_C_VERSION__".to_owned());
args.push(c"-D__OPENCL_C_VERSION__=".concat(clc_ver.clc_str()));
args.push(c"-DCL_VERSION_3_1=310".to_owned());
}
args
}
}