- ``allow_invalid_spirv`` disables validation of any input SPIR-V
- ``clc`` dumps all OpenCL C source being compiled
- ``program`` dumps compilation logs to stderr
+ - ``sync`` waits on the GPU to complete after every event
.. _clc-env-var:
pub allow_invalid_spirv: bool,
pub clc: bool,
pub program: bool,
+ pub sync_every_event: bool,
}
pub struct PlatformFeatures {
allow_invalid_spirv: false,
clc: false,
program: false,
+ sync_every_event: false,
};
static mut PLATFORM_FEATURES: PlatformFeatures = PlatformFeatures {
fp16: false,
"allow_invalid_spirv" => debug.allow_invalid_spirv = true,
"clc" => debug.clc = true,
"program" => debug.program = true,
+ "sync" => debug.sync_every_event = true,
_ => eprintln!("Unknown RUSTICL_DEBUG flag found: {}", flag),
}
}
use crate::core::context::*;
use crate::core::device::*;
use crate::core::event::*;
+use crate::core::platform::*;
use crate::impl_cl_type_trait;
use mesa_rust::pipe::context::PipeContext;
e.call(&pipe);
- if !e.is_user() {
- flushed.push(e);
- } else {
+ if e.is_user() {
// On each user event we flush our events as application might
// wait on them before signaling user events.
flush_events(&mut flushed, &pipe);
// Wait on user events as they are synchronization points in the
// application's control.
e.wait();
+ } else if Platform::dbg().sync_every_event {
+ flushed.push(e);
+ flush_events(&mut flushed, &pipe);
+ } else {
+ flushed.push(e);
}
}