mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
feature: add mechanism to extend cmdlist launch params
Related-To: NEO-13954 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f89725d31b
commit
1877e66bc8
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2021-2024 Intel Corporation
|
||||
# Copyright (C) 2021-2025 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -18,6 +18,7 @@ target_sources(${L0_STATIC_LIB_NAME}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_hw_immediate.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_launch_params.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_extended${BRANCH_DIR_SUFFIX}cmdlist_extended.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}cmdlist_additional_args.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}mcl_cmdlist.h
|
||||
)
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ struct _ze_command_list_handle_t {
|
||||
|
||||
namespace NEO {
|
||||
class ScratchSpaceController;
|
||||
struct EncodeDispatchKernelArgs;
|
||||
} // namespace NEO
|
||||
|
||||
namespace L0 {
|
||||
@@ -208,6 +209,7 @@ struct CommandList : _ze_command_list_handle_t {
|
||||
}
|
||||
|
||||
void forceDcFlushForDcFlushMitigation();
|
||||
void setAdditionalDispatchKernelArgsFromLaunchParams(NEO::EncodeDispatchKernelArgs dispatchKernelArgs, const CmdListKernelLaunchParams &launchParams) const;
|
||||
|
||||
void setOrdinal(uint32_t ord) { ordinal = ord; }
|
||||
void setCommandListPerThreadScratchSize(uint32_t slotId, uint32_t size) {
|
||||
|
||||
18
level_zero/core/source/cmdlist/cmdlist_additional_args.cpp
Normal file
18
level_zero/core/source/cmdlist/cmdlist_additional_args.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (C) 2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
|
||||
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
||||
|
||||
namespace L0 {
|
||||
struct CmdListKernelLaunchParams;
|
||||
|
||||
void CommandList::setAdditionalDispatchKernelArgsFromLaunchParams(NEO::EncodeDispatchKernelArgs dispatchKernelArgs, const CmdListKernelLaunchParams &launchParams) const {
|
||||
}
|
||||
|
||||
} // namespace L0
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
* Copyright (C) 2020-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -204,6 +204,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
nullptr, // cpuPayloadBuffer
|
||||
nullptr, // outImplicitArgsPtr
|
||||
&additionalCommands, // additionalCommands
|
||||
nullptr, // extendedArgs
|
||||
commandListPreemptionMode, // preemptionMode
|
||||
launchParams.requiredPartitionDim, // requiredPartitionDim
|
||||
launchParams.requiredDispatchWalkOrder, // requiredDispatchWalkOrder
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "level_zero/core/source/kernel/kernel_imp.h"
|
||||
#include "level_zero/core/source/module/module.h"
|
||||
|
||||
#include "encode_dispatch_kernel_args_ext.h"
|
||||
#include "encode_surface_state_args.h"
|
||||
#include "igfxfmid.h"
|
||||
|
||||
@@ -332,6 +333,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
|
||||
auto maxWgCountPerTile = kernel->getMaxWgCountPerTile(this->engineGroupType);
|
||||
|
||||
NEO::EncodeKernelArgsExt dispatchKernelArgsExt = {};
|
||||
NEO::EncodeDispatchKernelArgs dispatchKernelArgs{
|
||||
eventAddress, // eventAddress
|
||||
static_cast<uint64_t>(Event::STATE_SIGNALED), // postSyncImmValue
|
||||
@@ -347,6 +349,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
launchParams.hostPayloadBuffer, // cpuPayloadBuffer
|
||||
nullptr, // outImplicitArgsPtr
|
||||
&additionalCommands, // additionalCommands
|
||||
&dispatchKernelArgsExt, // extendedArgs
|
||||
kernelPreemptionMode, // preemptionMode
|
||||
launchParams.requiredPartitionDim, // requiredPartitionDim
|
||||
launchParams.requiredDispatchWalkOrder, // requiredDispatchWalkOrder
|
||||
@@ -370,8 +373,9 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
this->heaplessStateInitEnabled, // isHeaplessStateInitEnabled
|
||||
interruptEvent, // interruptEvent
|
||||
!this->scratchAddressPatchingEnabled, // immediateScratchAddressPatching
|
||||
launchParams.makeKernelCommandView, // makeCommandView
|
||||
launchParams.makeKernelCommandView // makeCommandView
|
||||
};
|
||||
setAdditionalDispatchKernelArgsFromLaunchParams(dispatchKernelArgs, launchParams);
|
||||
|
||||
NEO::EncodeDispatchKernel<GfxFamily>::encodeCommon(commandContainer, dispatchKernelArgs);
|
||||
launchParams.outWalker = dispatchKernelArgs.outWalkerPtr;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2023-2024 Intel Corporation
|
||||
* Copyright (C) 2023-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <vector>
|
||||
|
||||
namespace L0 {
|
||||
struct CmdListKernelLaunchParamsExt;
|
||||
|
||||
struct CommandToPatch {
|
||||
enum CommandType {
|
||||
@@ -52,6 +53,7 @@ struct CmdListKernelLaunchParams {
|
||||
void *hostPayloadBuffer = nullptr;
|
||||
CommandToPatch *outSyncCommand = nullptr;
|
||||
CommandToPatchContainer *outListCommands = nullptr;
|
||||
CmdListKernelLaunchParamsExt *launchParamsExt = nullptr;
|
||||
size_t syncBufferPatchIndex = std::numeric_limits<size_t>::max();
|
||||
size_t regionBarrierPatchIndex = std::numeric_limits<size_t>::max();
|
||||
uint32_t externalPerThreadScratchSize[2] = {0U, 0U};
|
||||
|
||||
Reference in New Issue
Block a user