2020-03-24 19:17:13 +08:00
|
|
|
/*
|
2022-06-30 03:17:47 +08:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2020-03-24 19:17:13 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-01-21 20:10:13 +08:00
|
|
|
#include "shared/test/common/test_macros/test_checks_shared.h"
|
2020-03-24 19:17:13 +08:00
|
|
|
|
|
|
|
#include "shared/source/device/device.h"
|
2020-09-30 22:58:20 +08:00
|
|
|
#include "shared/source/helpers/hw_helper.h"
|
2021-10-28 04:22:31 +08:00
|
|
|
#include "shared/source/os_interface/hw_info_config.h"
|
2021-01-21 20:10:13 +08:00
|
|
|
#include "shared/test/common/helpers/default_hw_info.h"
|
2022-06-30 03:17:47 +08:00
|
|
|
#include "shared/test/common/test_macros/hw_test.h"
|
2020-03-24 19:17:13 +08:00
|
|
|
|
|
|
|
using namespace NEO;
|
|
|
|
|
2020-11-25 22:11:11 +08:00
|
|
|
bool TestChecks::supportsBlitter(const HardwareInfo *pHardwareInfo) {
|
2020-09-30 22:58:20 +08:00
|
|
|
auto engines = HwHelper::get(::renderCoreFamily).getGpgpuEngineInstances(*pHardwareInfo);
|
|
|
|
for (const auto &engine : engines) {
|
|
|
|
if (engine.first == aub_stream::EngineType::ENGINE_BCS) {
|
2021-07-29 19:25:06 +08:00
|
|
|
return pHardwareInfo->capabilityTable.blitterOperationsSupported;
|
2020-09-30 22:58:20 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2021-10-28 04:22:31 +08:00
|
|
|
bool TestChecks::fullySupportsBlitter(const HardwareInfo *pHardwareInfo) {
|
|
|
|
auto engines = HwHelper::get(::renderCoreFamily).getGpgpuEngineInstances(*pHardwareInfo);
|
|
|
|
for (const auto &engine : engines) {
|
|
|
|
if (engine.first == aub_stream::EngineType::ENGINE_BCS) {
|
|
|
|
return HwInfoConfig::get(pHardwareInfo->platform.eProductFamily)->isBlitterFullySupported(*pHardwareInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-11-25 22:11:11 +08:00
|
|
|
bool TestChecks::supportsImages(const HardwareInfo &hardwareInfo) {
|
|
|
|
return hardwareInfo.capabilityTable.supportsImages;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TestChecks::supportsImages(const std::unique_ptr<HardwareInfo> &pHardwareInfo) {
|
|
|
|
return supportsImages(*pHardwareInfo);
|
|
|
|
}
|
|
|
|
|
2020-03-24 19:17:13 +08:00
|
|
|
bool TestChecks::supportsSvm(const HardwareInfo *pHardwareInfo) {
|
|
|
|
return pHardwareInfo->capabilityTable.ftrSvm;
|
|
|
|
}
|
|
|
|
bool TestChecks::supportsSvm(const std::unique_ptr<HardwareInfo> &pHardwareInfo) {
|
|
|
|
return supportsSvm(pHardwareInfo.get());
|
|
|
|
}
|
|
|
|
bool TestChecks::supportsSvm(const Device *pDevice) {
|
|
|
|
return supportsSvm(&pDevice->getHardwareInfo());
|
|
|
|
}
|
2020-05-22 20:38:08 +08:00
|
|
|
|
|
|
|
class TestMacrosIfNotMatchTearDownCall : public ::testing::Test {
|
|
|
|
public:
|
|
|
|
void expectCorrectPlatform() {
|
2020-11-25 22:11:11 +08:00
|
|
|
EXPECT_EQ(IGFX_SKYLAKE, defaultHwInfo->platform.eProductFamily);
|
2020-05-22 20:38:08 +08:00
|
|
|
}
|
|
|
|
void SetUp() override {
|
|
|
|
expectCorrectPlatform();
|
|
|
|
}
|
|
|
|
void TearDown() override {
|
|
|
|
expectCorrectPlatform();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
HWTEST2_F(TestMacrosIfNotMatchTearDownCall, givenNotMatchPlatformWhenUseHwTest2FThenSetUpAndTearDownAreNotCalled, IsSKL) {
|
|
|
|
expectCorrectPlatform();
|
|
|
|
}
|
|
|
|
class TestMacrosWithParamIfNotMatchTearDownCall : public TestMacrosIfNotMatchTearDownCall, public ::testing::WithParamInterface<int> {};
|
|
|
|
HWTEST2_P(TestMacrosWithParamIfNotMatchTearDownCall, givenNotMatchPlatformWhenUseHwTest2PThenSetUpAndTearDownAreNotCalled, IsSKL) {
|
|
|
|
expectCorrectPlatform();
|
|
|
|
}
|
|
|
|
INSTANTIATE_TEST_CASE_P(givenNotMatchPlatformWhenUseHwTest2PThenSetUpAndTearDownAreNotCalled,
|
|
|
|
TestMacrosWithParamIfNotMatchTearDownCall,
|
2020-09-30 22:58:20 +08:00
|
|
|
::testing::Values(0));
|