Files
compute-runtime/unit_tests/mock_gmm/mock_gmm.cpp
Mateusz Jablonski 9562daa2d0 Create wrapper for Gmm exported functions
Related-To: NEO-2551

Change-Id: I6d2912b2cb020e9544e52af7c46f54d5174a1a52
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2020-01-20 11:15:24 +01:00

38 lines
1.1 KiB
C++

/*
* Copyright (C) 2018-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "core/gmm_helper/gmm_interface.h"
namespace NEO {
GMM_INIT_IN_ARGS passedInputArgs = {};
SKU_FEATURE_TABLE passedFtrTable = {};
WA_TABLE passedWaTable = {};
bool copyInputArgs = false;
namespace GmmInterface {
GMM_STATUS initialize(GMM_INIT_IN_ARGS *pInArgs, GMM_INIT_OUT_ARGS *pOutArgs) {
pOutArgs->pGmmClientContext = reinterpret_cast<GMM_CLIENT_CONTEXT *>(0x01);
if (pInArgs) {
if (pInArgs->Platform.eProductFamily == PRODUCT_FAMILY::IGFX_UNKNOWN &&
pInArgs->Platform.ePCHProductFamily == PCH_PRODUCT_FAMILY::PCH_UNKNOWN) {
return GMM_ERROR;
}
if (copyInputArgs) {
passedInputArgs = *pInArgs;
passedFtrTable = *reinterpret_cast<SKU_FEATURE_TABLE *>(pInArgs->pSkuTable);
passedWaTable = *reinterpret_cast<WA_TABLE *>(pInArgs->pWaTable);
}
return GMM_SUCCESS;
}
return GMM_INVALIDPARAM;
}
void destroy(GMM_INIT_OUT_ARGS *pInArgs) {
}
} // namespace GmmInterface
} // namespace NEO