a comma-separated list of debug channels to enable.
+ - ``allow_invalid_spirv`` disables validation of any input SPIR-V
- ``clc`` dumps all OpenCL C source being compiled
- ``program`` dumps compilation logs to stderr
}
pub struct PlatformDebug {
+ pub allow_invalid_spirv: bool,
pub clc: bool,
pub program: bool,
}
devs: Vec::new(),
};
static mut PLATFORM_DBG: PlatformDebug = PlatformDebug {
+ allow_invalid_spirv: false,
clc: false,
program: false,
};
if let Ok(debug_flags) = env::var("RUSTICL_DEBUG") {
for flag in debug_flags.split(',') {
match flag {
+ "allow_invalid_spirv" => debug.allow_invalid_spirv = true,
"clc" => debug.clc = true,
"program" => debug.program = true,
_ => eprintln!("Unknown RUSTICL_DEBUG flag found: {}", flag),
// has to match CL_DEVICE_MAX_PARAMETER_SIZE
limit_max_function_arg: dev.param_max_size() as u32,
};
- spirv.clone_on_validate(&options)
+ if Platform::dbg().allow_invalid_spirv {
+ (Some(spirv.clone()), String::new())
+ } else {
+ spirv.clone_on_validate(&options)
+ }
}
ProgramSourceType::Src(src) => {
let args = prepare_options(&options, dev);