mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Reorganization directory structure [2/n]
Change-Id: I47962d17d755e80dcd9476e1ed75560f433f6115
This commit is contained in:

committed by
Jaroslaw Chodor

parent
d015d3633f
commit
e8852a68c4
25
opencl/test/unit_test/mock_gmm/CMakeLists.txt
Normal file
25
opencl/test/unit_test/mock_gmm/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(target_name mock_gmm)
|
||||
project(${target_name})
|
||||
|
||||
# Setting up our local list of test files
|
||||
set(IGDRCL_SRCS_tests_mock_gmm
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm.cpp
|
||||
)
|
||||
add_library(${target_name} EXCLUDE_FROM_ALL OBJECT ${IGDRCL_SRCS_tests_mock_gmm})
|
||||
|
||||
target_include_directories(${target_name} PRIVATE
|
||||
${WDK_INCLUDE_PATHS}
|
||||
${NEO__GMM_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
create_project_source_tree(${target_name})
|
||||
set_target_properties(${target_name} PROPERTIES FOLDER "test mocks")
|
||||
target_compile_definitions(${target_name} PUBLIC)
|
||||
|
37
opencl/test/unit_test/mock_gmm/mock_gmm.cpp
Normal file
37
opencl/test/unit_test/mock_gmm/mock_gmm.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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
|
Reference in New Issue
Block a user