diff --git a/src/gallium/frontends/rusticl/core/program.rs b/src/gallium/frontends/rusticl/core/program.rs index 175081e8d84..fbbac4b6f69 100644 --- a/src/gallium/frontends/rusticl/core/program.rs +++ b/src/gallium/frontends/rusticl/core/program.rs @@ -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 } }