Revert "Add support for cooperative kernels to immediate command lists"

This reverts commit fc72de1168.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation 2022-09-27 06:04:40 +02:00 committed by Compute-Runtime-Automation
parent d7eacc0280
commit d0d1514f7a
7 changed files with 11 additions and 66 deletions

View File

@ -99,9 +99,9 @@ struct CommandList : _ze_command_list_handle_t {
const CmdListKernelLaunchParams &launchParams) = 0;
virtual ze_result_t appendLaunchCooperativeKernel(ze_kernel_handle_t kernelHandle,
const ze_group_count_t *launchKernelArgs,
ze_event_handle_t signalEvent,
ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents,
ze_event_handle_t *waitEventHandles) = 0;
ze_event_handle_t *phWaitEvents) = 0;
virtual ze_result_t appendLaunchKernelIndirect(ze_kernel_handle_t kernelHandle,
const ze_group_count_t *pDispatchArgumentsBuffer,
ze_event_handle_t hEvent, uint32_t numWaitEvents,

View File

@ -88,9 +88,9 @@ struct CommandListCoreFamily : CommandListImp {
const CmdListKernelLaunchParams &launchParams) override;
ze_result_t appendLaunchCooperativeKernel(ze_kernel_handle_t kernelHandle,
const ze_group_count_t *launchKernelArgs,
ze_event_handle_t signalEvent,
ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents,
ze_event_handle_t *waitEventHandles) override;
ze_event_handle_t *phWaitEvents) override;
ze_result_t appendLaunchKernelIndirect(ze_kernel_handle_t kernelHandle,
const ze_group_count_t *pDispatchArgumentsBuffer,
ze_event_handle_t hEvent, uint32_t numWaitEvents,

View File

@ -253,18 +253,18 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernel(ze_kernel_h
template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchCooperativeKernel(ze_kernel_handle_t kernelHandle,
const ze_group_count_t *launchKernelArgs,
ze_event_handle_t signalEvent,
ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents,
ze_event_handle_t *waitEventHandles) {
ze_event_handle_t *phWaitEvents) {
ze_result_t ret = addEventsToCmdList(numWaitEvents, waitEventHandles);
ze_result_t ret = addEventsToCmdList(numWaitEvents, phWaitEvents);
if (ret) {
return ret;
}
Event *event = nullptr;
if (signalEvent) {
event = Event::fromHandle(signalEvent);
if (hSignalEvent) {
event = Event::fromHandle(hSignalEvent);
}
CmdListKernelLaunchParams launchParams = {};

View File

@ -118,12 +118,6 @@ struct CommandListCoreFamilyImmediate : public CommandListCoreFamily<gfxCoreFami
uint32_t numWaitEvents,
ze_event_handle_t *phWaitEvents) override;
ze_result_t appendLaunchCooperativeKernel(ze_kernel_handle_t kernelHandle,
const ze_group_count_t *launchKernelArgs,
ze_event_handle_t signalEvent,
uint32_t numWaitEvents,
ze_event_handle_t *waitEventHandles) override;
MOCKABLE_VIRTUAL ze_result_t executeCommandListImmediateWithFlushTask(bool performMigration);
void checkAvailableSpace();

View File

@ -458,19 +458,6 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendMemoryRangesBar
return flushImmediate(ret, true);
}
template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendLaunchCooperativeKernel(ze_kernel_handle_t kernelHandle,
const ze_group_count_t *launchKernelArgs,
ze_event_handle_t signalEvent,
uint32_t numWaitEvents,
ze_event_handle_t *waitEventHandles) {
if (this->isFlushTaskSubmissionEnabled) {
checkAvailableSpace();
}
auto ret = CommandListCoreFamily<gfxCoreFamily>::appendLaunchCooperativeKernel(kernelHandle, launchKernelArgs, signalEvent, numWaitEvents, waitEventHandles);
return flushImmediate(ret, true);
}
template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::flushImmediate(ze_result_t inputRet, bool performMigration) {
if (inputRet == ZE_RESULT_SUCCESS) {

View File

@ -180,9 +180,9 @@ struct MockCommandList : public CommandList {
ADDMETHOD_NOBASE(appendLaunchCooperativeKernel, ze_result_t, ZE_RESULT_SUCCESS,
(ze_kernel_handle_t kernelHandle,
const ze_group_count_t *launchKernelArgs,
ze_event_handle_t signalEvent,
ze_event_handle_t hSignalEvent,
uint32_t numWaitEvents,
ze_event_handle_t *waitEventHandles));
ze_event_handle_t *phWaitEvents));
ADDMETHOD_NOBASE(appendLaunchKernelIndirect, ze_result_t, ZE_RESULT_SUCCESS,
(ze_kernel_handle_t kernelHandle,

View File

@ -784,41 +784,5 @@ HWTEST_F(CommandListAppendLaunchKernel, givenInvalidEventListWhenAppendLaunchCoo
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, returnValue);
}
HWTEST2_F(CommandListAppendLaunchKernel, givenImmediateCommandListWhenAppendLaunchCooperativeKernelUsingFlushTaskThenExpectCorrectExecuteCall, IsAtLeastSkl) {
createKernel();
MockCommandListImmediateHw<gfxCoreFamily> cmdList;
cmdList.isFlushTaskSubmissionEnabled = true;
cmdList.cmdListType = CommandList::CommandListType::TYPE_IMMEDIATE;
cmdList.csr = device->getNEODevice()->getDefaultEngine().commandStreamReceiver;
cmdList.initialize(device, NEO::EngineGroupType::RenderCompute, 0u);
ze_group_count_t groupCount{1, 1, 1};
ze_result_t returnValue;
returnValue = cmdList.appendLaunchCooperativeKernel(kernel->toHandle(), &groupCount, nullptr, 0, nullptr);
EXPECT_EQ(0u, cmdList.executeCommandListImmediateCalledCount);
EXPECT_EQ(1u, cmdList.executeCommandListImmediateWithFlushTaskCalledCount);
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
}
HWTEST2_F(CommandListAppendLaunchKernel, givenImmediateCommandListWhenAppendLaunchCooperativeKernelNotUsingFlushTaskThenExpectCorrectExecuteCall, IsAtLeastSkl) {
createKernel();
MockCommandListImmediateHw<gfxCoreFamily> cmdList;
cmdList.isFlushTaskSubmissionEnabled = false;
cmdList.cmdListType = CommandList::CommandListType::TYPE_IMMEDIATE;
cmdList.csr = device->getNEODevice()->getDefaultEngine().commandStreamReceiver;
cmdList.initialize(device, NEO::EngineGroupType::RenderCompute, 0u);
ze_group_count_t groupCount{1, 1, 1};
ze_result_t returnValue;
returnValue = cmdList.appendLaunchCooperativeKernel(kernel->toHandle(), &groupCount, nullptr, 0, nullptr);
EXPECT_EQ(1u, cmdList.executeCommandListImmediateCalledCount);
EXPECT_EQ(0u, cmdList.executeCommandListImmediateWithFlushTaskCalledCount);
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
}
} // namespace ult
} // namespace L0