From 6570a7a828116a2cdd3ee0cbe3010dae8a6b1218 Mon Sep 17 00:00:00 2001 From: Vinod Tipparaju Date: Tue, 11 Aug 2020 12:16:54 +0530 Subject: [PATCH] ULT: zeCommandListAppendMemoryCopyFromContext for Immediate CommandList Change-Id: I377d4a76a4621373aed4e4b59bd82eb494fee9d6 Signed-off-by: Vinod Tipparaju --- .../sources/cmdlist/test_cmdlist_1.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp index f09f58038e..0d26416cb8 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_1.cpp @@ -14,6 +14,7 @@ #include "test.h" #include "level_zero/core/source/builtin/builtin_functions_lib_impl.h" +#include "level_zero/core/source/cmdlist/cmdlist.h" #include "level_zero/core/source/cmdqueue/cmdqueue_imp.h" #include "level_zero/core/source/context/context.h" #include "level_zero/core/source/driver/driver_handle_imp.h" @@ -207,6 +208,21 @@ TEST_F(CommandListCreate, whenCreatingImmediateCommandListThenItHasImmediateComm EXPECT_NE(nullptr, commandList->cmdQImmediate); } +TEST_F(CommandListCreate, whenInvokingAppendMemoryCopyFromContextForImmediateCommandListThenSuccessIsReturned) { + const ze_command_queue_desc_t desc = {}; + std::unique_ptr commandList(CommandList::createImmediate(productFamily, device, &desc, false, true)); + ASSERT_NE(nullptr, commandList); + + EXPECT_EQ(device, commandList->device); + EXPECT_EQ(CommandList::CommandListType::TYPE_IMMEDIATE, commandList->cmdListType); + EXPECT_NE(nullptr, commandList->cmdQImmediate); + + void *srcPtr = reinterpret_cast(0x1234); + void *dstPtr = reinterpret_cast(0x2345); + auto result = commandList->appendMemoryCopyFromContext(dstPtr, nullptr, srcPtr, 8, nullptr, 0, nullptr); + EXPECT_EQ(ZE_RESULT_SUCCESS, result); +} + TEST_F(CommandListCreate, givenQueueDescriptionwhenCreatingImmediateCommandListForEveryEnigneThenItHasImmediateCommandQueueCreated) { auto engines = neoDevice->getEngineGroups(); uint32_t numaAvailableEngineGroups = 0;