From 21e89b121a3d33922e1021ac57d27985ff0f5659 Mon Sep 17 00:00:00 2001 From: Mateusz Hoppe Date: Mon, 29 Mar 2021 17:44:01 +0000 Subject: [PATCH] Optimize preemption programming Signed-off-by: Mateusz Hoppe --- level_zero/core/source/cmdqueue/cmdqueue_hw.inl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl index 53ab25cb61..644e7efe94 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl @@ -269,10 +269,12 @@ ze_result_t CommandQueueHw::executeCommandLists( NEO::PreemptionHelper::programStateSip(child, *neoDevice); } - NEO::PreemptionHelper::programCmdStream(child, - cmdQueuePreemption, - commandQueuePreemptionMode, - csr->getPreemptionAllocation()); + if (cmdQueuePreemption != commandQueuePreemptionMode) { + NEO::PreemptionHelper::programCmdStream(child, + cmdQueuePreemption, + commandQueuePreemptionMode, + csr->getPreemptionAllocation()); + } statePreemption = cmdQueuePreemption; const bool sipKernelUsed = devicePreemption == NEO::PreemptionMode::MidThread ||