From 9cbc3101c7f9a09112f596ff107c1342ec312eb0 Mon Sep 17 00:00:00 2001 From: Zbigniew Zdanowicz Date: Mon, 20 Jun 2022 18:12:25 +0000 Subject: [PATCH] Change kernel argument in command list interfaces Signed-off-by: Zbigniew Zdanowicz --- level_zero/core/source/cmdlist/cmdlist_hw.h | 4 +-- level_zero/core/source/cmdlist/cmdlist_hw.inl | 18 ++++++------- .../core/source/cmdlist/cmdlist_hw_base.inl | 9 +++---- .../cmdlist/cmdlist_hw_xehp_and_later.inl | 7 +++-- .../core/test/unit_tests/mocks/mock_cmdlist.h | 4 +-- .../test_cmdlist_append_launch_kernel_2.cpp | 12 ++++----- .../test_cmdlist_append_launch_kernel_3.cpp | 26 +++++++++---------- .../sources/cmdlist/test_cmdlist_fill.cpp | 4 +-- .../xe_hp_core/test_cmdlist_xe_hp_core.cpp | 22 ++++++++-------- .../xe_hpc_core/test_cmdlist_xe_hpc_core.cpp | 14 +++++----- 10 files changed, 59 insertions(+), 61 deletions(-) diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.h b/level_zero/core/source/cmdlist/cmdlist_hw.h index d1b12efc3d..910748335e 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.h +++ b/level_zero/core/source/cmdlist/cmdlist_hw.h @@ -217,11 +217,11 @@ struct CommandListCoreFamily : CommandListImp { const Vec3 &srcSize, const Vec3 &dstSize, Event *signalEvent); - MOCKABLE_VIRTUAL ze_result_t appendLaunchKernelWithParams(ze_kernel_handle_t hKernel, + MOCKABLE_VIRTUAL ze_result_t appendLaunchKernelWithParams(Kernel *kernel, const ze_group_count_t *threadGroupDimensions, Event *event, const CmdListKernelLaunchParams &launchParams); - ze_result_t appendLaunchKernelSplit(ze_kernel_handle_t hKernel, + ze_result_t appendLaunchKernelSplit(Kernel *kernel, const ze_group_count_t *threadGroupDimensions, Event *event, const CmdListKernelLaunchParams &launchParams); diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 92cf542615..e3af5f884d 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -210,7 +210,7 @@ ze_result_t CommandListCoreFamily::appendLaunchKernel(ze_kernel_h event = Event::fromHandle(hEvent); } - auto res = appendLaunchKernelWithParams(hKernel, threadGroupDimensions, + auto res = appendLaunchKernelWithParams(Kernel::fromHandle(hKernel), threadGroupDimensions, event, launchParams); if (NEO::DebugManager.flags.EnableSWTags.get()) { @@ -243,7 +243,7 @@ ze_result_t CommandListCoreFamily::appendLaunchCooperativeKernel( CmdListKernelLaunchParams launchParams = {}; launchParams.isCooperative = true; - return appendLaunchKernelWithParams(hKernel, pLaunchFuncArgs, + return appendLaunchKernelWithParams(Kernel::fromHandle(hKernel), pLaunchFuncArgs, event, launchParams); } @@ -267,7 +267,7 @@ ze_result_t CommandListCoreFamily::appendLaunchKernelIndirect(ze_ appendEventForProfiling(event, true, false); CmdListKernelLaunchParams launchParams = {}; launchParams.isIndirect = true; - ret = appendLaunchKernelWithParams(hKernel, pDispatchArgumentsBuffer, + ret = appendLaunchKernelWithParams(Kernel::fromHandle(hKernel), pDispatchArgumentsBuffer, nullptr, launchParams); appendSignalEventPostWalker(event, false); @@ -305,7 +305,7 @@ ze_result_t CommandListCoreFamily::appendLaunchMultipleKernelsInd CmdListKernelLaunchParams launchParams = {}; launchParams.isIndirect = true; launchParams.isPredicate = true; - ret = appendLaunchKernelWithParams(phKernels[i], + ret = appendLaunchKernelWithParams(Kernel::fromHandle(phKernels[i]), haveLaunchArguments ? &pLaunchArgumentsBuffer[i] : nullptr, nullptr, launchParams); if (ret) { @@ -923,7 +923,7 @@ ze_result_t CommandListCoreFamily::appendMemoryCopyKernelWithGA(v (dstAllocationType == NEO::AllocationType::SVM_CPU) || (dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR); - return CommandListCoreFamily::appendLaunchKernelSplit(builtinFunction->toHandle(), &dispatchFuncArgs, signalEvent, launchParams); + return CommandListCoreFamily::appendLaunchKernelSplit(builtinFunction, &dispatchFuncArgs, signalEvent, launchParams); } template @@ -1541,7 +1541,7 @@ ze_result_t CommandListCoreFamily::appendMemoryFill(void *ptr, uint32_t groups = static_cast(size) / groupSizeX; ze_group_count_t dispatchFuncArgs{groups, 1u, 1u}; - res = appendLaunchKernelSplit(builtinFunction->toHandle(), &dispatchFuncArgs, signalEvent, launchParams); + res = appendLaunchKernelSplit(builtinFunction, &dispatchFuncArgs, signalEvent, launchParams); if (res) { return res; } @@ -1555,7 +1555,7 @@ ze_result_t CommandListCoreFamily::appendMemoryFill(void *ptr, builtinFunction->setArgBufferWithAlloc(0, dstAllocation.alignedAllocationPtr, dstAllocation.alloc); builtinFunction->setArgumentValue(1, sizeof(dstOffset), &dstOffset); - res = appendLaunchKernelSplit(builtinFunction->toHandle(), &dispatchFuncRemainderArgs, signalEvent, launchParams); + res = appendLaunchKernelSplit(builtinFunction, &dispatchFuncRemainderArgs, signalEvent, launchParams); if (res) { return res; } @@ -1614,7 +1614,7 @@ ze_result_t CommandListCoreFamily::appendMemoryFill(void *ptr, appendEventForProfilingAllWalkers(signalEvent, true); ze_group_count_t dispatchFuncArgs{groups, 1u, 1u}; - res = appendLaunchKernelSplit(builtinFunction->toHandle(), &dispatchFuncArgs, signalEvent, launchParams); + res = appendLaunchKernelSplit(builtinFunction, &dispatchFuncArgs, signalEvent, launchParams); if (res) { return res; } @@ -1644,7 +1644,7 @@ ze_result_t CommandListCoreFamily::appendMemoryFill(void *ptr, patternGfxAlloc); builtinFunctionRemainder->setArgumentValue(3, sizeof(patternAllocationSize), &patternAllocationSize); - res = appendLaunchKernelSplit(builtinFunctionRemainder->toHandle(), &dispatchFuncArgs, signalEvent, launchParams); + res = appendLaunchKernelSplit(builtinFunctionRemainder, &dispatchFuncArgs, signalEvent, launchParams); if (res) { return res; } diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_base.inl b/level_zero/core/source/cmdlist/cmdlist_hw_base.inl index 66a6e541b4..2c1d96ad0f 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_base.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_base.inl @@ -33,13 +33,12 @@ size_t CommandListCoreFamily::getReserveSshSize() { } template -ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(ze_kernel_handle_t hKernel, +ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(Kernel *kernel, const ze_group_count_t *threadGroupDimensions, Event *event, const CmdListKernelLaunchParams &launchParams) { - const auto kernel = Kernel::fromHandle(hKernel); - const auto &kernelDescriptor = kernel->getKernelDescriptor(); UNRECOVERABLE_IF(kernel == nullptr); + const auto &kernelDescriptor = kernel->getKernelDescriptor(); appendEventForProfiling(event, true, false); const auto functionImmutableData = kernel->getImmutableData(); auto perThreadScratchSize = std::max(this->getCommandListPerThreadScratchSize(), @@ -201,11 +200,11 @@ inline size_t CommandListCoreFamily::estimateBufferSizeMultiTileB } template -ze_result_t CommandListCoreFamily::appendLaunchKernelSplit(ze_kernel_handle_t hKernel, +ze_result_t CommandListCoreFamily::appendLaunchKernelSplit(Kernel *kernel, const ze_group_count_t *threadGroupDimensions, Event *event, const CmdListKernelLaunchParams &launchParams) { - return appendLaunchKernelWithParams(hKernel, threadGroupDimensions, nullptr, launchParams); + return appendLaunchKernelWithParams(kernel, threadGroupDimensions, nullptr, launchParams); } template diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl b/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl index 4696136df9..bc950c0ba6 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl @@ -121,7 +121,7 @@ void programEventL3Flush(Event *event, } template -ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(ze_kernel_handle_t hKernel, +ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(Kernel *kernel, const ze_group_count_t *threadGroupDimensions, Event *event, const CmdListKernelLaunchParams &launchParams) { @@ -133,7 +133,6 @@ ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(z } NEO::Device *neoDevice = device->getNEODevice(); - const auto kernel = Kernel::fromHandle(hKernel); UNRECOVERABLE_IF(kernel == nullptr); const auto functionImmutableData = kernel->getImmutableData(); auto &kernelDescriptor = kernel->getKernelDescriptor(); @@ -361,14 +360,14 @@ inline size_t CommandListCoreFamily::estimateBufferSizeMultiTileB } template -ze_result_t CommandListCoreFamily::appendLaunchKernelSplit(ze_kernel_handle_t hKernel, +ze_result_t CommandListCoreFamily::appendLaunchKernelSplit(Kernel *kernel, const ze_group_count_t *threadGroupDimensions, Event *event, const CmdListKernelLaunchParams &launchParams) { if (event) { event->increaseKernelCount(); } - return appendLaunchKernelWithParams(hKernel, threadGroupDimensions, event, launchParams); + return appendLaunchKernelWithParams(kernel, threadGroupDimensions, event, launchParams); } template diff --git a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h index ac8d57f61f..0e7f15ec15 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h +++ b/level_zero/core/test/unit_tests/mocks/mock_cmdlist.h @@ -68,14 +68,14 @@ struct WhiteBox<::L0::CommandListCoreFamily> WhiteBox() : ::L0::CommandListCoreFamily(BaseClass::defaultNumIddsPerBlock) {} - ze_result_t appendLaunchKernelWithParams(ze_kernel_handle_t hKernel, + ze_result_t appendLaunchKernelWithParams(::L0::Kernel *kernel, const ze_group_count_t *threadGroupDimensions, ::L0::Event *event, const CmdListKernelLaunchParams &launchParams) override { usedKernelLaunchParams = launchParams; appendKernelEventValue = event; - return BaseClass::appendLaunchKernelWithParams(hKernel, threadGroupDimensions, + return BaseClass::appendLaunchKernelWithParams(kernel, threadGroupDimensions, event, launchParams); } diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp index db1bc09d75..7f2a5bde59 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp @@ -1227,19 +1227,19 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenCooperativeAndNonCooperativeKernel pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); CmdListKernelLaunchParams launchParams = {}; launchParams.isCooperative = false; - auto result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + auto result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); launchParams.isCooperative = true; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result); pCommandList = std::make_unique>>(); pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); launchParams.isCooperative = true; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); launchParams.isCooperative = false; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result); } @@ -1351,7 +1351,7 @@ HWTEST2_F(MultiTileCommandListAppendLaunchFunctionXeHpCoreTest, givenCooperative ASSERT_EQ(ZE_RESULT_SUCCESS, result); auto sizeBefore = commandListWithNonCooperativeKernel->commandContainer.getCommandStream()->getUsed(); CmdListKernelLaunchParams launchParams = {}; - result = commandListWithNonCooperativeKernel->appendLaunchKernelWithParams(kernel->toHandle(), &groupCount, nullptr, launchParams); + result = commandListWithNonCooperativeKernel->appendLaunchKernelWithParams(kernel.get(), &groupCount, nullptr, launchParams); ASSERT_EQ(ZE_RESULT_SUCCESS, result); auto sizeAfter = commandListWithNonCooperativeKernel->commandContainer.getCommandStream()->getUsed(); GenCmdList cmdList; @@ -1366,7 +1366,7 @@ HWTEST2_F(MultiTileCommandListAppendLaunchFunctionXeHpCoreTest, givenCooperative ASSERT_EQ(ZE_RESULT_SUCCESS, result); sizeBefore = commandListWithCooperativeKernel->commandContainer.getCommandStream()->getUsed(); launchParams.isCooperative = true; - result = commandListWithCooperativeKernel->appendLaunchKernelWithParams(kernel->toHandle(), &groupCount, nullptr, launchParams); + result = commandListWithCooperativeKernel->appendLaunchKernelWithParams(kernel.get(), &groupCount, nullptr, launchParams); ASSERT_EQ(ZE_RESULT_SUCCESS, result); sizeAfter = commandListWithCooperativeKernel->commandContainer.getCommandStream()->getUsed(); cmdList.clear(); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp index 48f06fd529..4ad1ebae28 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_3.cpp @@ -317,7 +317,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenKernelUsingSyncBufferWhenAppendLau pCommandList->initialize(device, engineGroupType, 0u); CmdListKernelLaunchParams launchParams = {}; launchParams.isCooperative = true; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); { @@ -325,7 +325,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenKernelUsingSyncBufferWhenAppendLau usesSyncBuffer = {}; pCommandList = std::make_unique>>(); pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); } { @@ -335,13 +335,13 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenKernelUsingSyncBufferWhenAppendLau groupCountX = maximalNumberOfWorkgroupsAllowed + 1; pCommandList = std::make_unique>>(); pCommandList->initialize(device, engineGroupType, 0u); - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result); } { VariableBackup cooperative{&launchParams.isCooperative}; cooperative = false; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result); } } @@ -379,7 +379,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenCooperativeKernelWhenAppendLaunchC pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); CmdListKernelLaunchParams launchParams = {}; launchParams.isCooperative = false; - auto result = pCommandList->appendLaunchKernelWithParams(kernel->toHandle(), &groupCount, nullptr, launchParams); + auto result = pCommandList->appendLaunchKernelWithParams(kernel.get(), &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_TRUE(pCommandList->containsAnyKernel); EXPECT_FALSE(pCommandList->containsCooperativeKernelsFlag); @@ -387,7 +387,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenCooperativeKernelWhenAppendLaunchC pCommandList = std::make_unique>>(); pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); launchParams.isCooperative = true; - result = pCommandList->appendLaunchKernelWithParams(kernel->toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(kernel.get(), &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_TRUE(pCommandList->containsAnyKernel); EXPECT_TRUE(pCommandList->containsCooperativeKernelsFlag); @@ -404,19 +404,19 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenAnyCooperativeKernelAndMixingAllow CmdListKernelLaunchParams launchParams = {}; launchParams.isCooperative = false; - auto result = pCommandList->appendLaunchKernelWithParams(kernel->toHandle(), &groupCount, nullptr, launchParams); + auto result = pCommandList->appendLaunchKernelWithParams(kernel.get(), &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_TRUE(pCommandList->containsAnyKernel); EXPECT_FALSE(pCommandList->containsCooperativeKernelsFlag); launchParams.isCooperative = true; - result = pCommandList->appendLaunchKernelWithParams(kernel->toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(kernel.get(), &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_TRUE(pCommandList->containsAnyKernel); EXPECT_TRUE(pCommandList->containsCooperativeKernelsFlag); launchParams.isCooperative = false; - result = pCommandList->appendLaunchKernelWithParams(kernel->toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(kernel.get(), &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_TRUE(pCommandList->containsAnyKernel); EXPECT_TRUE(pCommandList->containsCooperativeKernelsFlag); @@ -436,19 +436,19 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenCooperativeAndNonCooperativeKernel pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); CmdListKernelLaunchParams launchParams = {}; launchParams.isCooperative = false; - auto result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + auto result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); launchParams.isCooperative = true; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); pCommandList = std::make_unique>>(); pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); launchParams.isCooperative = true; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); launchParams.isCooperative = false; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); } diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_fill.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_fill.cpp index 2e7531133a..9227fc110b 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_fill.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_fill.cpp @@ -46,7 +46,7 @@ class AppendFillFixture : public DeviceFixture { public: MockCommandList() : WhiteBox<::L0::CommandListCoreFamily>() {} - ze_result_t appendLaunchKernelWithParams(ze_kernel_handle_t hKernel, + ze_result_t appendLaunchKernelWithParams(Kernel *kernel, const ze_group_count_t *pThreadGroupDimensions, Event *event, const CmdListKernelLaunchParams &launchParams) override { @@ -55,7 +55,7 @@ class AppendFillFixture : public DeviceFixture { } numberOfCallsToAppendLaunchKernelWithParams++; - return CommandListCoreFamily::appendLaunchKernelWithParams(hKernel, + return CommandListCoreFamily::appendLaunchKernelWithParams(kernel, pThreadGroupDimensions, event, launchParams); diff --git a/level_zero/core/test/unit_tests/xe_hp_core/test_cmdlist_xe_hp_core.cpp b/level_zero/core/test/unit_tests/xe_hp_core/test_cmdlist_xe_hp_core.cpp index 46ec509939..477c561770 100644 --- a/level_zero/core/test/unit_tests/xe_hp_core/test_cmdlist_xe_hp_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hp_core/test_cmdlist_xe_hp_core.cpp @@ -47,7 +47,7 @@ HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithNoGlobalAtomi EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics); CmdListKernelLaunchParams launchParams = {}; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics); @@ -70,7 +70,7 @@ HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithGlobalAtomics EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics); CmdListKernelLaunchParams launchParams = {}; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_TRUE(pCommandList->commandContainer.lastSentUseGlobalAtomics); @@ -93,7 +93,7 @@ HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithGlobalAtomics pCommandList->commandContainer.lastSentUseGlobalAtomics = true; CmdListKernelLaunchParams launchParams = {}; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_TRUE(pCommandList->commandContainer.lastSentUseGlobalAtomics); @@ -116,7 +116,7 @@ HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithNoGlobalAtomi pCommandList->commandContainer.lastSentUseGlobalAtomics = true; CmdListKernelLaunchParams launchParams = {}; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics); @@ -138,7 +138,7 @@ HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithGlobalAtomics EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics); CmdListKernelLaunchParams launchParams = {}; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics); @@ -176,7 +176,7 @@ HWTEST2_F(MultTileCommandListAppendLaunchKernelL3Flush, givenKernelWithRegularEv auto event = std::unique_ptr(L0::Event::create(eventPool.get(), &eventDesc, device)); CmdListKernelLaunchParams launchParams = {}; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, event.get(), launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); auto gpuAddress = event->getGpuAddress(device) + @@ -234,7 +234,7 @@ HWTEST2_F(MultTileCommandListAppendLaunchKernelL3Flush, givenKernelWithTimestamp auto event = std::unique_ptr(L0::Event::create(eventPool.get(), &eventDesc, device)); CmdListKernelLaunchParams launchParams = {}; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, event.get(), launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); auto gpuAddress = event->getGpuAddress(device) + @@ -288,7 +288,7 @@ HWTEST2_F(CommandListAppendLaunchKernelL3Flush, givenKernelWithEventAndWithoutWa auto event = std::unique_ptr(L0::Event::create(eventPool.get(), &eventDesc, device)); CmdListKernelLaunchParams launchParams = {}; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, event.get(), launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); GenCmdList cmdList; @@ -326,7 +326,7 @@ HWTEST2_F(CommandListAppendLaunchKernelL3Flush, givenKernelWithEventHostScopeWit auto event = std::unique_ptr(L0::Event::create(eventPool.get(), &eventDesc, device)); CmdListKernelLaunchParams launchParams = {}; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, event.get(), launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(true, event->getL3FlushForCurrenKernel()); @@ -357,7 +357,7 @@ HWTEST2_F(CommandListAppendLaunchKernelL3Flush, givenKernelWithEventZeroScopeWit auto event = std::unique_ptr(L0::Event::create(eventPool.get(), &eventDesc, device)); CmdListKernelLaunchParams launchParams = {}; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, event.get(), launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(false, event->getL3FlushForCurrenKernel()); @@ -389,7 +389,7 @@ HWTEST2_F(CommandListAppendLaunchKernelL3Flush, givenKernelWithEventHostScopeWit auto event = std::unique_ptr(L0::Event::create(eventPool.get(), &eventDesc, device)); CmdListKernelLaunchParams launchParams = {}; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, event.get(), launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(true, event->getL3FlushForCurrenKernel()); diff --git a/level_zero/core/test/unit_tests/xe_hpc_core/test_cmdlist_xe_hpc_core.cpp b/level_zero/core/test/unit_tests/xe_hpc_core/test_cmdlist_xe_hpc_core.cpp index 021e2d8be6..49a9ede2c9 100644 --- a/level_zero/core/test/unit_tests/xe_hpc_core/test_cmdlist_xe_hpc_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpc_core/test_cmdlist_xe_hpc_core.cpp @@ -45,7 +45,7 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenKernelUsingSyncBufferWhen kernelAttributes.numGrfRequired = GrfConfig::DefaultGrfNumber; CmdListKernelLaunchParams launchParams = {}; launchParams.isCooperative = true; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); { @@ -53,11 +53,11 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenKernelUsingSyncBufferWhen VariableBackup hwRevId{&hwInfo.platform.usRevId}; engineGroupType = EngineGroupType::RenderCompute; hwRevId = hwConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result); ze_group_count_t groupCount1{1, 1, 1}; - result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount1, nullptr, launchParams); + result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount1, nullptr, launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); } } @@ -370,7 +370,7 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenHwSupportsSystemFenceWhen ASSERT_EQ(ZE_RESULT_SUCCESS, result); CmdListKernelLaunchParams launchParams = {}; - result = commandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, event.get(), launchParams); + result = commandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); GenCmdList commands; @@ -437,7 +437,7 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenHwSupportsSystemFenceWhen ASSERT_EQ(ZE_RESULT_SUCCESS, result); CmdListKernelLaunchParams launchParams = {}; - result = commandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, event.get(), launchParams); + result = commandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); GenCmdList commands; @@ -563,7 +563,7 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenHwSupportsSystemFenceWhen ASSERT_EQ(ZE_RESULT_SUCCESS, result); CmdListKernelLaunchParams launchParams = {}; - result = commandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, event.get(), launchParams); + result = commandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); GenCmdList commands; @@ -632,7 +632,7 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenHwSupportsSystemFenceWhen ASSERT_EQ(ZE_RESULT_SUCCESS, result); CmdListKernelLaunchParams launchParams = {}; - result = commandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, event.get(), launchParams); + result = commandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams); EXPECT_EQ(ZE_RESULT_SUCCESS, result); GenCmdList commands;