Skip to content

Commit c59abbe

Browse files
Add option for extending cmdlist
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
1 parent b2b333d commit c59abbe

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

level_zero/core/source/device/device_imp.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ ze_result_t DeviceImp::createCommandList(const ze_command_list_desc_t *desc,
168168

169169
auto productFamily = neoDevice->getHardwareInfo().platform.eProductFamily;
170170
ze_result_t returnValue = ZE_RESULT_SUCCESS;
171-
*commandList = CommandList::create(productFamily, this, engineGroupType, desc->flags, returnValue);
171+
auto createCommandList = getCmdListCreateFunc(desc);
172+
*commandList = createCommandList(productFamily, this, engineGroupType, desc->flags, returnValue);
172173

173174
return returnValue;
174175
}

level_zero/core/source/device/device_imp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ struct DeviceImp : public Device {
130130
void populateSubDeviceCopyEngineGroups();
131131
bool isQueueGroupOrdinalValid(uint32_t ordinal);
132132

133+
using CmdListCreateFunT = std::function<ze_command_list_handle_t(uint32_t, Device *, NEO::EngineGroupType, ze_command_list_flags_t, ze_result_t &)>;
134+
CmdListCreateFunT getCmdListCreateFunc(const ze_command_list_desc_t *desc);
135+
133136
protected:
134137
NEO::Device::EngineGroupsT subDeviceCopyEngineGroups{};
135138

level_zero/core/source/device/device_imp_helper.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021 Intel Corporation
2+
* Copyright (C) 2021-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -13,4 +13,8 @@ namespace L0 {
1313

1414
void DeviceImp::processAdditionalKernelProperties(NEO::HwHelper &hwHelper, ze_device_module_properties_t *pKernelProperties) {
1515
}
16+
17+
DeviceImp::CmdListCreateFunT DeviceImp::getCmdListCreateFunc(const ze_command_list_desc_t *desc) {
18+
return &CommandList::create;
19+
}
1620
} // namespace L0

0 commit comments

Comments
 (0)