diff --git a/src/gallium/frontends/rusticl/api/event.rs b/src/gallium/frontends/rusticl/api/event.rs index 31b87570be0..1afd1318c47 100644 --- a/src/gallium/frontends/rusticl/api/event.rs +++ b/src/gallium/frontends/rusticl/api/event.rs @@ -50,7 +50,7 @@ impl CLInfo for cl_event { Ok(match *q { // TODO - CL_PROFILING_COMMAND_QUEUED => cl_prop::(0), + CL_PROFILING_COMMAND_QUEUED => cl_prop::(event.get_time(EventTimes::Queued)), CL_PROFILING_COMMAND_SUBMIT => cl_prop::(1), CL_PROFILING_COMMAND_START => cl_prop::(2), CL_PROFILING_COMMAND_END => cl_prop::(3), diff --git a/src/gallium/frontends/rusticl/core/queue.rs b/src/gallium/frontends/rusticl/core/queue.rs index f0d73345af2..22d37aa0238 100644 --- a/src/gallium/frontends/rusticl/core/queue.rs +++ b/src/gallium/frontends/rusticl/core/queue.rs @@ -118,6 +118,9 @@ impl Queue { } pub fn queue(&self, e: Arc) { + if self.is_profiling_enabled() { + e.set_time(EventTimes::Queued, self.device.screen().get_timestamp()); + } self.state.lock().unwrap().pending.push(e); } @@ -149,6 +152,10 @@ impl Queue { queues.remove(self); queues } + + pub fn is_profiling_enabled(&self) -> bool { + (self.props & (CL_QUEUE_PROFILING_ENABLE as u64)) != 0 + } } impl Drop for Queue {