mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
Change kernel argument in command list interfaces
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a35425f787
commit
9cbc3101c7
@@ -217,11 +217,11 @@ struct CommandListCoreFamily : CommandListImp {
|
||||
const Vec3<size_t> &srcSize, const Vec3<size_t> &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);
|
||||
|
||||
@@ -210,7 +210,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::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<gfxCoreFamily>::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<gfxCoreFamily>::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<gfxCoreFamily>::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<gfxCoreFamily>::appendMemoryCopyKernelWithGA(v
|
||||
(dstAllocationType == NEO::AllocationType::SVM_CPU) ||
|
||||
(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>
|
||||
@@ -1541,7 +1541,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryFill(void *ptr,
|
||||
|
||||
uint32_t groups = static_cast<uint32_t>(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<gfxCoreFamily>::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<gfxCoreFamily>::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<gfxCoreFamily>::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;
|
||||
}
|
||||
|
||||
@@ -33,13 +33,12 @@ size_t CommandListCoreFamily<gfxCoreFamily>::getReserveSshSize() {
|
||||
}
|
||||
|
||||
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,
|
||||
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<std::uint32_t>(this->getCommandListPerThreadScratchSize(),
|
||||
@@ -201,11 +200,11 @@ inline size_t CommandListCoreFamily<gfxCoreFamily>::estimateBufferSizeMultiTileB
|
||||
}
|
||||
|
||||
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,
|
||||
Event *event,
|
||||
const CmdListKernelLaunchParams &launchParams) {
|
||||
return appendLaunchKernelWithParams(hKernel, threadGroupDimensions, nullptr, launchParams);
|
||||
return appendLaunchKernelWithParams(kernel, threadGroupDimensions, nullptr, launchParams);
|
||||
}
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
|
||||
@@ -121,7 +121,7 @@ void programEventL3Flush(Event *event,
|
||||
}
|
||||
|
||||
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,
|
||||
Event *event,
|
||||
const CmdListKernelLaunchParams &launchParams) {
|
||||
@@ -133,7 +133,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::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<gfxCoreFamily>::estimateBufferSizeMultiTileB
|
||||
}
|
||||
|
||||
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,
|
||||
Event *event,
|
||||
const CmdListKernelLaunchParams &launchParams) {
|
||||
if (event) {
|
||||
event->increaseKernelCount();
|
||||
}
|
||||
return appendLaunchKernelWithParams(hKernel, threadGroupDimensions, event, launchParams);
|
||||
return appendLaunchKernelWithParams(kernel, threadGroupDimensions, event, launchParams);
|
||||
}
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
|
||||
@@ -68,14 +68,14 @@ struct WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>
|
||||
|
||||
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,
|
||||
::L0::Event *event,
|
||||
const CmdListKernelLaunchParams &launchParams) override {
|
||||
|
||||
usedKernelLaunchParams = launchParams;
|
||||
appendKernelEventValue = event;
|
||||
return BaseClass::appendLaunchKernelWithParams(hKernel, threadGroupDimensions,
|
||||
return BaseClass::appendLaunchKernelWithParams(kernel, threadGroupDimensions,
|
||||
event, launchParams);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
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();
|
||||
|
||||
@@ -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<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
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<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
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<bool> 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<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
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<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class AppendFillFixture : public DeviceFixture {
|
||||
public:
|
||||
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,
|
||||
Event *event,
|
||||
const CmdListKernelLaunchParams &launchParams) override {
|
||||
@@ -55,7 +55,7 @@ class AppendFillFixture : public DeviceFixture {
|
||||
}
|
||||
|
||||
numberOfCallsToAppendLaunchKernelWithParams++;
|
||||
return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(hKernel,
|
||||
return CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(kernel,
|
||||
pThreadGroupDimensions,
|
||||
event,
|
||||
launchParams);
|
||||
|
||||
@@ -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>(L0::Event::create<uint32_t>(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>(L0::Event::create<uint32_t>(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>(L0::Event::create<uint32_t>(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>(L0::Event::create<uint32_t>(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>(L0::Event::create<uint32_t>(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>(L0::Event::create<uint32_t>(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());
|
||||
|
||||
@@ -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<unsigned short> 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;
|
||||
|
||||
Reference in New Issue
Block a user