mirror of
https://github.com/intel/compute-runtime.git
synced 2025-06-28 17:58:30 +08:00
Remove HwInfoConfigTest's dependency on PlatformFixture
Signed-off-by: Daniel Chabrowski <daniel.chabrowski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
8431234845
commit
ec6d580a27
@ -12,12 +12,12 @@
|
|||||||
#include "shared/source/os_interface/hw_info_config.h"
|
#include "shared/source/os_interface/hw_info_config.h"
|
||||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||||
|
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||||
#include "shared/test/common/mocks/mock_gmm.h"
|
#include "shared/test/common/mocks/mock_gmm.h"
|
||||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||||
#include "shared/test/unit_test/helpers/gtest_helpers.h"
|
#include "shared/test/unit_test/helpers/gtest_helpers.h"
|
||||||
#include "shared/test/unit_test/utilities/base_object_utils.h"
|
#include "shared/test/unit_test/utilities/base_object_utils.h"
|
||||||
|
|
||||||
#include "opencl/source/cl_device/cl_device.h"
|
|
||||||
#include "opencl/source/sampler/sampler.h"
|
#include "opencl/source/sampler/sampler.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||||
|
|
||||||
@ -26,9 +26,7 @@
|
|||||||
using namespace NEO;
|
using namespace NEO;
|
||||||
|
|
||||||
void HwInfoConfigTest::SetUp() {
|
void HwInfoConfigTest::SetUp() {
|
||||||
PlatformFixture::SetUp();
|
pInHwInfo = *defaultHwInfo;
|
||||||
|
|
||||||
pInHwInfo = pPlatform->getClDevice(0)->getHardwareInfo();
|
|
||||||
|
|
||||||
testPlatform = &pInHwInfo.platform;
|
testPlatform = &pInHwInfo.platform;
|
||||||
testSkuTable = &pInHwInfo.featureTable;
|
testSkuTable = &pInHwInfo.featureTable;
|
||||||
@ -38,10 +36,6 @@ void HwInfoConfigTest::SetUp() {
|
|||||||
outHwInfo = {};
|
outHwInfo = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void HwInfoConfigTest::TearDown() {
|
|
||||||
PlatformFixture::TearDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
HWTEST_F(HwInfoConfigTest, givenDebugFlagSetWhenAskingForHostMemCapabilitesThenReturnCorrectValue) {
|
HWTEST_F(HwInfoConfigTest, givenDebugFlagSetWhenAskingForHostMemCapabilitesThenReturnCorrectValue) {
|
||||||
DebugManagerStateRestore restore;
|
DebugManagerStateRestore restore;
|
||||||
|
|
||||||
@ -449,7 +443,12 @@ HWTEST_F(HwInfoConfigTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequir
|
|||||||
EXPECT_FALSE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType()));
|
EXPECT_FALSE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType()));
|
||||||
graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory);
|
graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory);
|
||||||
|
|
||||||
MockGmm mockGmm(pPlatform->getClDevice(0)->getGmmHelper(), nullptr, 100, 100, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true);
|
MockExecutionEnvironment executionEnvironment(&hwInfo);
|
||||||
|
executionEnvironment.initGmm();
|
||||||
|
executionEnvironment.prepareRootDeviceEnvironments(1);
|
||||||
|
auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper();
|
||||||
|
|
||||||
|
MockGmm mockGmm(gmmHelper, nullptr, 100, 100, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true);
|
||||||
mockGmm.resourceParams.Flags.Info.NotLockable = true;
|
mockGmm.resourceParams.Flags.Info.NotLockable = true;
|
||||||
graphicsAllocation.setDefaultGmm(&mockGmm);
|
graphicsAllocation.setDefaultGmm(&mockGmm);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2021 Intel Corporation
|
* Copyright (C) 2018-2022 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@ -7,19 +7,14 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "shared/source/device/device.h"
|
|
||||||
#include "shared/test/common/test_macros/test.h"
|
#include "shared/test/common/test_macros/test.h"
|
||||||
|
|
||||||
#include "opencl/test/unit_test/fixtures/platform_fixture.h"
|
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
using namespace NEO;
|
using namespace NEO;
|
||||||
|
|
||||||
struct HwInfoConfigTest : public ::testing::Test,
|
struct HwInfoConfigTest : public ::testing::Test {
|
||||||
public PlatformFixture {
|
|
||||||
void SetUp() override;
|
void SetUp() override;
|
||||||
void TearDown() override;
|
|
||||||
|
|
||||||
HardwareInfo pInHwInfo;
|
HardwareInfo pInHwInfo;
|
||||||
HardwareInfo outHwInfo;
|
HardwareInfo outHwInfo;
|
||||||
|
Reference in New Issue
Block a user