Change kernel argument in command list interfaces

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2022-06-20 18:12:25 +00:00
committed by Compute-Runtime-Automation
parent a35425f787
commit 9cbc3101c7
10 changed files with 59 additions and 61 deletions

View File

@@ -217,11 +217,11 @@ struct CommandListCoreFamily : CommandListImp {
const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize, const Vec3<size_t> &srcSize, const Vec3<size_t> &dstSize,
Event *signalEvent); 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, const ze_group_count_t *threadGroupDimensions,
Event *event, Event *event,
const CmdListKernelLaunchParams &launchParams); const CmdListKernelLaunchParams &launchParams);
ze_result_t appendLaunchKernelSplit(ze_kernel_handle_t hKernel, ze_result_t appendLaunchKernelSplit(Kernel *kernel,
const ze_group_count_t *threadGroupDimensions, const ze_group_count_t *threadGroupDimensions,
Event *event, Event *event,
const CmdListKernelLaunchParams &launchParams); const CmdListKernelLaunchParams &launchParams);

View File

@@ -210,7 +210,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernel(ze_kernel_h
event = Event::fromHandle(hEvent); event = Event::fromHandle(hEvent);
} }
auto res = appendLaunchKernelWithParams(hKernel, threadGroupDimensions, auto res = appendLaunchKernelWithParams(Kernel::fromHandle(hKernel), threadGroupDimensions,
event, launchParams); event, launchParams);
if (NEO::DebugManager.flags.EnableSWTags.get()) { if (NEO::DebugManager.flags.EnableSWTags.get()) {
@@ -243,7 +243,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchCooperativeKernel(
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
launchParams.isCooperative = true; launchParams.isCooperative = true;
return appendLaunchKernelWithParams(hKernel, pLaunchFuncArgs, return appendLaunchKernelWithParams(Kernel::fromHandle(hKernel), pLaunchFuncArgs,
event, launchParams); event, launchParams);
} }
@@ -267,7 +267,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelIndirect(ze_
appendEventForProfiling(event, true, false); appendEventForProfiling(event, true, false);
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
launchParams.isIndirect = true; launchParams.isIndirect = true;
ret = appendLaunchKernelWithParams(hKernel, pDispatchArgumentsBuffer, ret = appendLaunchKernelWithParams(Kernel::fromHandle(hKernel), pDispatchArgumentsBuffer,
nullptr, launchParams); nullptr, launchParams);
appendSignalEventPostWalker(event, false); appendSignalEventPostWalker(event, false);
@@ -305,7 +305,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchMultipleKernelsInd
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
launchParams.isIndirect = true; launchParams.isIndirect = true;
launchParams.isPredicate = true; launchParams.isPredicate = true;
ret = appendLaunchKernelWithParams(phKernels[i], ret = appendLaunchKernelWithParams(Kernel::fromHandle(phKernels[i]),
haveLaunchArguments ? &pLaunchArgumentsBuffer[i] : nullptr, haveLaunchArguments ? &pLaunchArgumentsBuffer[i] : nullptr,
nullptr, launchParams); nullptr, launchParams);
if (ret) { if (ret) {
@@ -923,7 +923,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyKernelWithGA(v
(dstAllocationType == NEO::AllocationType::SVM_CPU) || (dstAllocationType == NEO::AllocationType::SVM_CPU) ||
(dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR); (dstAllocationType == NEO::AllocationType::EXTERNAL_HOST_PTR);
return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelSplit(builtinFunction->toHandle(), &dispatchFuncArgs, signalEvent, launchParams); return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelSplit(builtinFunction, &dispatchFuncArgs, signalEvent, launchParams);
} }
template <GFXCORE_FAMILY gfxCoreFamily> template <GFXCORE_FAMILY gfxCoreFamily>
@@ -1541,7 +1541,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryFill(void *ptr,
uint32_t groups = static_cast<uint32_t>(size) / groupSizeX; uint32_t groups = static_cast<uint32_t>(size) / groupSizeX;
ze_group_count_t dispatchFuncArgs{groups, 1u, 1u}; ze_group_count_t dispatchFuncArgs{groups, 1u, 1u};
res = appendLaunchKernelSplit(builtinFunction->toHandle(), &dispatchFuncArgs, signalEvent, launchParams); res = appendLaunchKernelSplit(builtinFunction, &dispatchFuncArgs, signalEvent, launchParams);
if (res) { if (res) {
return res; return res;
} }
@@ -1555,7 +1555,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryFill(void *ptr,
builtinFunction->setArgBufferWithAlloc(0, dstAllocation.alignedAllocationPtr, dstAllocation.alloc); builtinFunction->setArgBufferWithAlloc(0, dstAllocation.alignedAllocationPtr, dstAllocation.alloc);
builtinFunction->setArgumentValue(1, sizeof(dstOffset), &dstOffset); builtinFunction->setArgumentValue(1, sizeof(dstOffset), &dstOffset);
res = appendLaunchKernelSplit(builtinFunction->toHandle(), &dispatchFuncRemainderArgs, signalEvent, launchParams); res = appendLaunchKernelSplit(builtinFunction, &dispatchFuncRemainderArgs, signalEvent, launchParams);
if (res) { if (res) {
return res; return res;
} }
@@ -1614,7 +1614,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryFill(void *ptr,
appendEventForProfilingAllWalkers(signalEvent, true); appendEventForProfilingAllWalkers(signalEvent, true);
ze_group_count_t dispatchFuncArgs{groups, 1u, 1u}; ze_group_count_t dispatchFuncArgs{groups, 1u, 1u};
res = appendLaunchKernelSplit(builtinFunction->toHandle(), &dispatchFuncArgs, signalEvent, launchParams); res = appendLaunchKernelSplit(builtinFunction, &dispatchFuncArgs, signalEvent, launchParams);
if (res) { if (res) {
return res; return res;
} }
@@ -1644,7 +1644,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryFill(void *ptr,
patternGfxAlloc); patternGfxAlloc);
builtinFunctionRemainder->setArgumentValue(3, sizeof(patternAllocationSize), &patternAllocationSize); builtinFunctionRemainder->setArgumentValue(3, sizeof(patternAllocationSize), &patternAllocationSize);
res = appendLaunchKernelSplit(builtinFunctionRemainder->toHandle(), &dispatchFuncArgs, signalEvent, launchParams); res = appendLaunchKernelSplit(builtinFunctionRemainder, &dispatchFuncArgs, signalEvent, launchParams);
if (res) { if (res) {
return res; return res;
} }

View File

@@ -33,13 +33,12 @@ size_t CommandListCoreFamily<gfxCoreFamily>::getReserveSshSize() {
} }
template <GFXCORE_FAMILY gfxCoreFamily> template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(ze_kernel_handle_t hKernel, ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(Kernel *kernel,
const ze_group_count_t *threadGroupDimensions, const ze_group_count_t *threadGroupDimensions,
Event *event, Event *event,
const CmdListKernelLaunchParams &launchParams) { const CmdListKernelLaunchParams &launchParams) {
const auto kernel = Kernel::fromHandle(hKernel);
const auto &kernelDescriptor = kernel->getKernelDescriptor();
UNRECOVERABLE_IF(kernel == nullptr); UNRECOVERABLE_IF(kernel == nullptr);
const auto &kernelDescriptor = kernel->getKernelDescriptor();
appendEventForProfiling(event, true, false); appendEventForProfiling(event, true, false);
const auto functionImmutableData = kernel->getImmutableData(); const auto functionImmutableData = kernel->getImmutableData();
auto perThreadScratchSize = std::max<std::uint32_t>(this->getCommandListPerThreadScratchSize(), auto perThreadScratchSize = std::max<std::uint32_t>(this->getCommandListPerThreadScratchSize(),
@@ -201,11 +200,11 @@ inline size_t CommandListCoreFamily<gfxCoreFamily>::estimateBufferSizeMultiTileB
} }
template <GFXCORE_FAMILY gfxCoreFamily> template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelSplit(ze_kernel_handle_t hKernel, ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelSplit(Kernel *kernel,
const ze_group_count_t *threadGroupDimensions, const ze_group_count_t *threadGroupDimensions,
Event *event, Event *event,
const CmdListKernelLaunchParams &launchParams) { const CmdListKernelLaunchParams &launchParams) {
return appendLaunchKernelWithParams(hKernel, threadGroupDimensions, nullptr, launchParams); return appendLaunchKernelWithParams(kernel, threadGroupDimensions, nullptr, launchParams);
} }
template <GFXCORE_FAMILY gfxCoreFamily> template <GFXCORE_FAMILY gfxCoreFamily>

View File

@@ -121,7 +121,7 @@ void programEventL3Flush(Event *event,
} }
template <GFXCORE_FAMILY gfxCoreFamily> template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(ze_kernel_handle_t hKernel, ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(Kernel *kernel,
const ze_group_count_t *threadGroupDimensions, const ze_group_count_t *threadGroupDimensions,
Event *event, Event *event,
const CmdListKernelLaunchParams &launchParams) { const CmdListKernelLaunchParams &launchParams) {
@@ -133,7 +133,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(z
} }
NEO::Device *neoDevice = device->getNEODevice(); NEO::Device *neoDevice = device->getNEODevice();
const auto kernel = Kernel::fromHandle(hKernel);
UNRECOVERABLE_IF(kernel == nullptr); UNRECOVERABLE_IF(kernel == nullptr);
const auto functionImmutableData = kernel->getImmutableData(); const auto functionImmutableData = kernel->getImmutableData();
auto &kernelDescriptor = kernel->getKernelDescriptor(); auto &kernelDescriptor = kernel->getKernelDescriptor();
@@ -361,14 +360,14 @@ inline size_t CommandListCoreFamily<gfxCoreFamily>::estimateBufferSizeMultiTileB
} }
template <GFXCORE_FAMILY gfxCoreFamily> template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelSplit(ze_kernel_handle_t hKernel, ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelSplit(Kernel *kernel,
const ze_group_count_t *threadGroupDimensions, const ze_group_count_t *threadGroupDimensions,
Event *event, Event *event,
const CmdListKernelLaunchParams &launchParams) { const CmdListKernelLaunchParams &launchParams) {
if (event) { if (event) {
event->increaseKernelCount(); event->increaseKernelCount();
} }
return appendLaunchKernelWithParams(hKernel, threadGroupDimensions, event, launchParams); return appendLaunchKernelWithParams(kernel, threadGroupDimensions, event, launchParams);
} }
template <GFXCORE_FAMILY gfxCoreFamily> template <GFXCORE_FAMILY gfxCoreFamily>

View File

@@ -68,14 +68,14 @@ struct WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>
WhiteBox() : ::L0::CommandListCoreFamily<gfxCoreFamily>(BaseClass::defaultNumIddsPerBlock) {} WhiteBox() : ::L0::CommandListCoreFamily<gfxCoreFamily>(BaseClass::defaultNumIddsPerBlock) {}
ze_result_t appendLaunchKernelWithParams(ze_kernel_handle_t hKernel, ze_result_t appendLaunchKernelWithParams(::L0::Kernel *kernel,
const ze_group_count_t *threadGroupDimensions, const ze_group_count_t *threadGroupDimensions,
::L0::Event *event, ::L0::Event *event,
const CmdListKernelLaunchParams &launchParams) override { const CmdListKernelLaunchParams &launchParams) override {
usedKernelLaunchParams = launchParams; usedKernelLaunchParams = launchParams;
appendKernelEventValue = event; appendKernelEventValue = event;
return BaseClass::appendLaunchKernelWithParams(hKernel, threadGroupDimensions, return BaseClass::appendLaunchKernelWithParams(kernel, threadGroupDimensions,
event, launchParams); event, launchParams);
} }

View File

@@ -1227,19 +1227,19 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenCooperativeAndNonCooperativeKernel
pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
launchParams.isCooperative = false; 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); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
launchParams.isCooperative = true; 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); EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result);
pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>(); pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
launchParams.isCooperative = true; launchParams.isCooperative = true;
result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
launchParams.isCooperative = false; 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); EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result);
} }
@@ -1351,7 +1351,7 @@ HWTEST2_F(MultiTileCommandListAppendLaunchFunctionXeHpCoreTest, givenCooperative
ASSERT_EQ(ZE_RESULT_SUCCESS, result); ASSERT_EQ(ZE_RESULT_SUCCESS, result);
auto sizeBefore = commandListWithNonCooperativeKernel->commandContainer.getCommandStream()->getUsed(); auto sizeBefore = commandListWithNonCooperativeKernel->commandContainer.getCommandStream()->getUsed();
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
result = commandListWithNonCooperativeKernel->appendLaunchKernelWithParams(kernel->toHandle(), &groupCount, nullptr, launchParams); result = commandListWithNonCooperativeKernel->appendLaunchKernelWithParams(kernel.get(), &groupCount, nullptr, launchParams);
ASSERT_EQ(ZE_RESULT_SUCCESS, result); ASSERT_EQ(ZE_RESULT_SUCCESS, result);
auto sizeAfter = commandListWithNonCooperativeKernel->commandContainer.getCommandStream()->getUsed(); auto sizeAfter = commandListWithNonCooperativeKernel->commandContainer.getCommandStream()->getUsed();
GenCmdList cmdList; GenCmdList cmdList;
@@ -1366,7 +1366,7 @@ HWTEST2_F(MultiTileCommandListAppendLaunchFunctionXeHpCoreTest, givenCooperative
ASSERT_EQ(ZE_RESULT_SUCCESS, result); ASSERT_EQ(ZE_RESULT_SUCCESS, result);
sizeBefore = commandListWithCooperativeKernel->commandContainer.getCommandStream()->getUsed(); sizeBefore = commandListWithCooperativeKernel->commandContainer.getCommandStream()->getUsed();
launchParams.isCooperative = true; 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); ASSERT_EQ(ZE_RESULT_SUCCESS, result);
sizeAfter = commandListWithCooperativeKernel->commandContainer.getCommandStream()->getUsed(); sizeAfter = commandListWithCooperativeKernel->commandContainer.getCommandStream()->getUsed();
cmdList.clear(); cmdList.clear();

View File

@@ -317,7 +317,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenKernelUsingSyncBufferWhenAppendLau
pCommandList->initialize(device, engineGroupType, 0u); pCommandList->initialize(device, engineGroupType, 0u);
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
launchParams.isCooperative = true; launchParams.isCooperative = true;
result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
{ {
@@ -325,7 +325,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenKernelUsingSyncBufferWhenAppendLau
usesSyncBuffer = {}; usesSyncBuffer = {};
pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>(); pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); 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); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
} }
{ {
@@ -335,13 +335,13 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenKernelUsingSyncBufferWhenAppendLau
groupCountX = maximalNumberOfWorkgroupsAllowed + 1; groupCountX = maximalNumberOfWorkgroupsAllowed + 1;
pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>(); pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
pCommandList->initialize(device, engineGroupType, 0u); 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); EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result);
} }
{ {
VariableBackup<bool> cooperative{&launchParams.isCooperative}; VariableBackup<bool> cooperative{&launchParams.isCooperative};
cooperative = false; 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); EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result);
} }
} }
@@ -379,7 +379,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenCooperativeKernelWhenAppendLaunchC
pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
launchParams.isCooperative = false; 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_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_TRUE(pCommandList->containsAnyKernel); EXPECT_TRUE(pCommandList->containsAnyKernel);
EXPECT_FALSE(pCommandList->containsCooperativeKernelsFlag); EXPECT_FALSE(pCommandList->containsCooperativeKernelsFlag);
@@ -387,7 +387,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenCooperativeKernelWhenAppendLaunchC
pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>(); pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
launchParams.isCooperative = true; 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_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_TRUE(pCommandList->containsAnyKernel); EXPECT_TRUE(pCommandList->containsAnyKernel);
EXPECT_TRUE(pCommandList->containsCooperativeKernelsFlag); EXPECT_TRUE(pCommandList->containsCooperativeKernelsFlag);
@@ -404,19 +404,19 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenAnyCooperativeKernelAndMixingAllow
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
launchParams.isCooperative = false; 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_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_TRUE(pCommandList->containsAnyKernel); EXPECT_TRUE(pCommandList->containsAnyKernel);
EXPECT_FALSE(pCommandList->containsCooperativeKernelsFlag); EXPECT_FALSE(pCommandList->containsCooperativeKernelsFlag);
launchParams.isCooperative = true; 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_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_TRUE(pCommandList->containsAnyKernel); EXPECT_TRUE(pCommandList->containsAnyKernel);
EXPECT_TRUE(pCommandList->containsCooperativeKernelsFlag); EXPECT_TRUE(pCommandList->containsCooperativeKernelsFlag);
launchParams.isCooperative = false; 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_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_TRUE(pCommandList->containsAnyKernel); EXPECT_TRUE(pCommandList->containsAnyKernel);
EXPECT_TRUE(pCommandList->containsCooperativeKernelsFlag); EXPECT_TRUE(pCommandList->containsCooperativeKernelsFlag);
@@ -436,19 +436,19 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenCooperativeAndNonCooperativeKernel
pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
launchParams.isCooperative = false; 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); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
launchParams.isCooperative = true; launchParams.isCooperative = true;
result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>(); pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u); pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
launchParams.isCooperative = true; launchParams.isCooperative = true;
result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
launchParams.isCooperative = false; launchParams.isCooperative = false;
result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
} }

View File

@@ -46,7 +46,7 @@ class AppendFillFixture : public DeviceFixture {
public: public:
MockCommandList() : WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>() {} MockCommandList() : WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>() {}
ze_result_t appendLaunchKernelWithParams(ze_kernel_handle_t hKernel, ze_result_t appendLaunchKernelWithParams(Kernel *kernel,
const ze_group_count_t *pThreadGroupDimensions, const ze_group_count_t *pThreadGroupDimensions,
Event *event, Event *event,
const CmdListKernelLaunchParams &launchParams) override { const CmdListKernelLaunchParams &launchParams) override {
@@ -55,7 +55,7 @@ class AppendFillFixture : public DeviceFixture {
} }
numberOfCallsToAppendLaunchKernelWithParams++; numberOfCallsToAppendLaunchKernelWithParams++;
return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(hKernel, return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(kernel,
pThreadGroupDimensions, pThreadGroupDimensions,
event, event,
launchParams); launchParams);

View File

@@ -47,7 +47,7 @@ HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithNoGlobalAtomi
EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics); EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics); EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
@@ -70,7 +70,7 @@ HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithGlobalAtomics
EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics); EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_TRUE(pCommandList->commandContainer.lastSentUseGlobalAtomics); EXPECT_TRUE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
@@ -93,7 +93,7 @@ HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithGlobalAtomics
pCommandList->commandContainer.lastSentUseGlobalAtomics = true; pCommandList->commandContainer.lastSentUseGlobalAtomics = true;
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_TRUE(pCommandList->commandContainer.lastSentUseGlobalAtomics); EXPECT_TRUE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
@@ -116,7 +116,7 @@ HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithNoGlobalAtomi
pCommandList->commandContainer.lastSentUseGlobalAtomics = true; pCommandList->commandContainer.lastSentUseGlobalAtomics = true;
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics); EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
@@ -138,7 +138,7 @@ HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithGlobalAtomics
EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics); EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics); EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
@@ -176,7 +176,7 @@ HWTEST2_F(MultTileCommandListAppendLaunchKernelL3Flush, givenKernelWithRegularEv
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device)); auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
CmdListKernelLaunchParams launchParams = {}; 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(ZE_RESULT_SUCCESS, result);
auto gpuAddress = event->getGpuAddress(device) + auto gpuAddress = event->getGpuAddress(device) +
@@ -234,7 +234,7 @@ HWTEST2_F(MultTileCommandListAppendLaunchKernelL3Flush, givenKernelWithTimestamp
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device)); auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
CmdListKernelLaunchParams launchParams = {}; 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(ZE_RESULT_SUCCESS, result);
auto gpuAddress = event->getGpuAddress(device) + auto gpuAddress = event->getGpuAddress(device) +
@@ -288,7 +288,7 @@ HWTEST2_F(CommandListAppendLaunchKernelL3Flush, givenKernelWithEventAndWithoutWa
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device)); auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
CmdListKernelLaunchParams launchParams = {}; 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(ZE_RESULT_SUCCESS, result);
GenCmdList cmdList; GenCmdList cmdList;
@@ -326,7 +326,7 @@ HWTEST2_F(CommandListAppendLaunchKernelL3Flush, givenKernelWithEventHostScopeWit
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device)); auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
CmdListKernelLaunchParams launchParams = {}; 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(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(true, event->getL3FlushForCurrenKernel()); EXPECT_EQ(true, event->getL3FlushForCurrenKernel());
@@ -357,7 +357,7 @@ HWTEST2_F(CommandListAppendLaunchKernelL3Flush, givenKernelWithEventZeroScopeWit
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device)); auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
CmdListKernelLaunchParams launchParams = {}; 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(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(false, event->getL3FlushForCurrenKernel()); EXPECT_EQ(false, event->getL3FlushForCurrenKernel());
@@ -389,7 +389,7 @@ HWTEST2_F(CommandListAppendLaunchKernelL3Flush, givenKernelWithEventHostScopeWit
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device)); auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
CmdListKernelLaunchParams launchParams = {}; 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(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(true, event->getL3FlushForCurrenKernel()); EXPECT_EQ(true, event->getL3FlushForCurrenKernel());

View File

@@ -45,7 +45,7 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenKernelUsingSyncBufferWhen
kernelAttributes.numGrfRequired = GrfConfig::DefaultGrfNumber; kernelAttributes.numGrfRequired = GrfConfig::DefaultGrfNumber;
CmdListKernelLaunchParams launchParams = {}; CmdListKernelLaunchParams launchParams = {};
launchParams.isCooperative = true; launchParams.isCooperative = true;
result = pCommandList->appendLaunchKernelWithParams(kernel.toHandle(), &groupCount, nullptr, launchParams); result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
{ {
@@ -53,11 +53,11 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenKernelUsingSyncBufferWhen
VariableBackup<unsigned short> hwRevId{&hwInfo.platform.usRevId}; VariableBackup<unsigned short> hwRevId{&hwInfo.platform.usRevId};
engineGroupType = EngineGroupType::RenderCompute; engineGroupType = EngineGroupType::RenderCompute;
hwRevId = hwConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); 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); EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result);
ze_group_count_t groupCount1{1, 1, 1}; 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); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
} }
} }
@@ -370,7 +370,7 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenHwSupportsSystemFenceWhen
ASSERT_EQ(ZE_RESULT_SUCCESS, result); ASSERT_EQ(ZE_RESULT_SUCCESS, result);
CmdListKernelLaunchParams launchParams = {}; 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); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
GenCmdList commands; GenCmdList commands;
@@ -437,7 +437,7 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenHwSupportsSystemFenceWhen
ASSERT_EQ(ZE_RESULT_SUCCESS, result); ASSERT_EQ(ZE_RESULT_SUCCESS, result);
CmdListKernelLaunchParams launchParams = {}; 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); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
GenCmdList commands; GenCmdList commands;
@@ -563,7 +563,7 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenHwSupportsSystemFenceWhen
ASSERT_EQ(ZE_RESULT_SUCCESS, result); ASSERT_EQ(ZE_RESULT_SUCCESS, result);
CmdListKernelLaunchParams launchParams = {}; 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); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
GenCmdList commands; GenCmdList commands;
@@ -632,7 +632,7 @@ HWTEST2_F(CommandListAppendLaunchKernelXeHpcCore, givenHwSupportsSystemFenceWhen
ASSERT_EQ(ZE_RESULT_SUCCESS, result); ASSERT_EQ(ZE_RESULT_SUCCESS, result);
CmdListKernelLaunchParams launchParams = {}; 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); EXPECT_EQ(ZE_RESULT_SUCCESS, result);
GenCmdList commands; GenCmdList commands;