Skip to content

Commit a627594

Browse files
feature: add cloning memory copy extension descriptors
Related-To: NEO-15606 Signed-off-by: Zbigniew Zdanowicz <[email protected]>
1 parent 575f48f commit a627594

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

level_zero/core/source/cmdlist/cmdlist.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ struct CommandList : _ze_command_list_handle_t {
261261

262262
static ze_result_t setKernelState(Kernel *kernel, const ze_group_size_t groupSizes, void **arguments);
263263
static ze_result_t cloneAppendKernelExtensions(const ze_base_desc_t *desc, void *&outPnext);
264-
static void freeClonedAppendKernelExtensions(void *outPnext);
264+
static void freeClonedAppendKernelExtensions(void *pNext);
265+
static ze_result_t cloneAppendMemoryCopyExtensions(const ze_base_desc_t *desc, void *&outPnext);
266+
static void freeClonedAppendMemoryCopyExtensions(void *pNext);
265267

266268
inline ze_command_list_handle_t toHandle() { return this; }
267269

level_zero/core/source/cmdlist/cmdlist_additional_args.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,11 @@ ze_result_t CommandList::obtainMemoryCopyParamsFromExtensions(const ze_base_desc
7575
return ZE_RESULT_SUCCESS;
7676
}
7777

78+
ze_result_t CommandList::cloneAppendMemoryCopyExtensions(const ze_base_desc_t *desc, void *&outPnext) {
79+
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
80+
}
81+
82+
void CommandList::freeClonedAppendMemoryCopyExtensions(void *pNext) {
83+
}
84+
7885
} // namespace L0

level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_4.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,7 @@ HWTEST_F(CommandListCreateTests, givenRegularOutOfOrderCommandListWhenGettingInO
17311731
EXPECT_EQ(0u, commandListImp->getInOrderExecHostGpuAddress());
17321732
}
17331733

1734-
HWTEST_F(CommandListCreateTests, givenCooperativeDescriptorWhenCloneIsCalledThenClonedValueDesciriptorIsAvailable) {
1734+
HWTEST_F(CommandListCreateTests, givenCooperativeDescriptorWhenCloneAppendKernelIsCalledThenClonedValueDesciriptorIsAvailable) {
17351735
ze_command_list_append_launch_kernel_param_cooperative_desc_t cooperativeDesc{ZE_STRUCTURE_TYPE_COMMAND_LIST_APPEND_PARAM_COOPERATIVE_DESC, nullptr, true};
17361736

17371737
void *outExtPtr = nullptr;
@@ -1746,7 +1746,7 @@ HWTEST_F(CommandListCreateTests, givenCooperativeDescriptorWhenCloneIsCalledThen
17461746
CommandList::freeClonedAppendKernelExtensions(outExtPtr);
17471747
}
17481748

1749-
HWTEST_F(CommandListCreateTests, givenUnsupportedDescriptorWhenCloneIsCalledThenErrorIsReturned) {
1749+
HWTEST_F(CommandListCreateTests, givenUnsupportedDescriptorWhenCloneAppendKernelIsCalledThenErrorIsReturned) {
17501750
ze_base_desc_t ext = {};
17511751
ext.stype = ZE_STRUCTURE_TYPE_MUTABLE_GRAPH_ARGUMENT_EXP_DESC;
17521752
ext.pNext = nullptr;
@@ -1757,5 +1757,18 @@ HWTEST_F(CommandListCreateTests, givenUnsupportedDescriptorWhenCloneIsCalledThen
17571757
EXPECT_EQ(nullptr, outExtPtr);
17581758
}
17591759

1760+
HWTEST_F(CommandListCreateTests, givenUnsupportedDescriptorWhenCloneAppendMemoryCopyIsCalledThenErrorIsReturned) {
1761+
ze_base_desc_t ext = {};
1762+
ext.stype = ZE_STRUCTURE_TYPE_MUTABLE_GRAPH_ARGUMENT_EXP_DESC;
1763+
ext.pNext = nullptr;
1764+
1765+
void *outExtPtr = nullptr;
1766+
auto result = CommandList::cloneAppendMemoryCopyExtensions(&ext, outExtPtr);
1767+
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, result);
1768+
EXPECT_EQ(nullptr, outExtPtr);
1769+
1770+
CommandList::freeClonedAppendMemoryCopyExtensions(&ext);
1771+
}
1772+
17601773
} // namespace ult
17611774
} // namespace L0

0 commit comments

Comments
 (0)