diff --git a/level_zero/core/source/cmdlist/cmdlist_imp.cpp b/level_zero/core/source/cmdlist/cmdlist_imp.cpp index b6c69f6139..59d6a2c204 100644 --- a/level_zero/core/source/cmdlist/cmdlist_imp.cpp +++ b/level_zero/core/source/cmdlist/cmdlist_imp.cpp @@ -17,6 +17,7 @@ #include "level_zero/core/source/cmdqueue/cmdqueue.h" #include "level_zero/core/source/device/device.h" #include "level_zero/core/source/device/device_imp.h" +#include "level_zero/core/source/hw_helpers/l0_hw_helper.h" #include "level_zero/tools/source/metrics/metric.h" #include "igfxfmid.h" @@ -26,9 +27,7 @@ namespace L0 { CommandList::CommandList(uint32_t numIddsPerBlock) : commandContainer(numIddsPerBlock) { - if (NEO::DebugManager.flags.MultiReturnPointCommandList.get() != -1) { - multiReturnPointCommandList = !!NEO::DebugManager.flags.MultiReturnPointCommandList.get(); - } + multiReturnPointCommandList = L0HwHelper::enableMultiReturnPointCommandList(); } CommandListAllocatorFn commandListFactory[IGFX_MAX_PRODUCT] = {}; diff --git a/level_zero/core/source/cmdqueue/cmdqueue.cpp b/level_zero/core/source/cmdqueue/cmdqueue.cpp index fbc2cd8dbb..c251ae1fbb 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue.cpp +++ b/level_zero/core/source/cmdqueue/cmdqueue.cpp @@ -19,6 +19,7 @@ #include "level_zero/core/source/device/device.h" #include "level_zero/core/source/device/device_imp.h" #include "level_zero/core/source/driver/driver_handle_imp.h" +#include "level_zero/core/source/hw_helpers/l0_hw_helper.h" #include "level_zero/core/source/kernel/kernel.h" #include "igfxfmid.h" @@ -39,10 +40,7 @@ CommandQueueImp::CommandQueueImp(Device *device, NEO::CommandStreamReceiver *csr useKmdWaitFunction = !!(overrideUseKmdWaitFunction); } - int overrideMultiReturnPointCommandList = NEO::DebugManager.flags.MultiReturnPointCommandList.get(); - if (overrideMultiReturnPointCommandList != -1) { - multiReturnPointCommandList = !!(overrideMultiReturnPointCommandList); - } + multiReturnPointCommandList = L0HwHelper::enableMultiReturnPointCommandList(); } ze_result_t CommandQueueImp::destroy() { diff --git a/level_zero/core/source/hw_helpers/l0_hw_helper.cpp b/level_zero/core/source/hw_helpers/l0_hw_helper.cpp index f019be2bcd..21dd272c62 100644 --- a/level_zero/core/source/hw_helpers/l0_hw_helper.cpp +++ b/level_zero/core/source/hw_helpers/l0_hw_helper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,4 +15,12 @@ L0HwHelper &L0HwHelper::get(GFXCORE_FAMILY gfxCore) { return *l0HwHelperFactory[gfxCore]; } +bool L0HwHelper::enableMultiReturnPointCommandList() { + constexpr bool defaultValue = false; + if (NEO::DebugManager.flags.MultiReturnPointCommandList.get() != -1) { + return !!NEO::DebugManager.flags.MultiReturnPointCommandList.get(); + } + return defaultValue; +} + } // namespace L0 diff --git a/level_zero/core/source/hw_helpers/l0_hw_helper.h b/level_zero/core/source/hw_helpers/l0_hw_helper.h index ee2faefb3e..296b594508 100644 --- a/level_zero/core/source/hw_helpers/l0_hw_helper.h +++ b/level_zero/core/source/hw_helpers/l0_hw_helper.h @@ -30,6 +30,7 @@ struct EventPool; class L0HwHelper { public: static L0HwHelper &get(GFXCORE_FAMILY gfxCore); + static bool enableMultiReturnPointCommandList(); virtual void setAdditionalGroupProperty(ze_command_queue_group_properties_t &groupProperty, NEO::EngineGroupT &group) const = 0; virtual L0::Event *createEvent(L0::EventPool *eventPool, const ze_event_desc_t *desc, L0::Device *device) const = 0;