refactor: move gmm callbacks definition to common place

- merge all the callbacks to single template class
- store callback functions in global arrays
- partially reuse callbacks on Linux

Related-To: NEO-11080
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2025-08-14 10:43:51 +00:00
committed by Compute-Runtime-Automation
parent a7e40d1543
commit ec36dd6275
38 changed files with 286 additions and 243 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -20,6 +20,9 @@ extern GfxCoreHelperCreateFunctionType gfxCoreHelperFactory[IGFX_MAX_CORE];
using Family = XeHpcCoreFamily;
static auto gfxFamily = IGFX_XE_HPC_CORE;
template <typename GfxFamily>
struct GmmCallbacks;
struct EnableCoreXeHpcCore {
EnableCoreXeHpcCore() {
gfxCoreHelperFactory[gfxFamily] = GfxCoreHelperHw<Family>::create;
@@ -27,6 +30,7 @@ struct EnableCoreXeHpcCore {
populateFactoryTable<CommandStreamReceiverHw<Family>>();
populateFactoryTable<TbxCommandStreamReceiverHw<Family>>();
populateFactoryTable<DebuggerL0Hw<Family>>();
populateFactoryTable<GmmCallbacks<Family>>();
}
};

View File

@@ -0,0 +1,13 @@
/*
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/xe_hpc_core/hw_cmds_xe_hpc_core_base.h"
static auto gfxCore = IGFX_XE_HPC_CORE;
using Family = NEO::XeHpcCoreFamily;
#include "gmm_callbacks.inl"

View File

@@ -1,16 +0,0 @@
/*
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/windows/gmm_callbacks.inl"
#include "shared/source/xe_hpc_core/hw_cmds_xe_hpc_core_base.h"
namespace NEO {
template struct DeviceCallbacks<XeHpcCoreFamily>;
template struct TTCallbacks<XeHpcCoreFamily>;
} // namespace NEO