2020-03-24 19:17:13 +08:00
|
|
|
/*
|
2023-01-09 21:30:43 +08:00
|
|
|
* Copyright (C) 2020-2023 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"
|
2023-01-09 21:30:43 +08:00
|
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
2023-02-02 00:23:01 +08:00
|
|
|
#include "shared/source/helpers/gfx_core_helper.h"
|
2023-07-28 16:34:22 +08:00
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2020-03-24 19:17:13 +08:00
|
|
|
|
|
|
|
using namespace NEO;
|
|
|
|
|
2023-01-09 21:30:43 +08:00
|
|
|
bool TestChecks::supportsBlitter(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
|
|
|
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
|
|
|
|
auto hwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
|
2023-01-26 00:13:28 +08:00
|
|
|
auto engines = gfxCoreHelper.getGpgpuEngineInstances(rootDeviceEnvironment);
|
2020-09-30 22:58:20 +08:00
|
|
|
for (const auto &engine : engines) {
|
|
|
|
if (engine.first == aub_stream::EngineType::ENGINE_BCS) {
|
2023-01-09 21:30:43 +08:00
|
|
|
return hwInfo->capabilityTable.blitterOperationsSupported;
|
2020-09-30 22:58:20 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-01-09 21:30:43 +08:00
|
|
|
bool TestChecks::fullySupportsBlitter(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
|
|
|
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
|
|
|
|
auto hwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
|
2023-01-26 00:13:28 +08:00
|
|
|
auto engines = gfxCoreHelper.getGpgpuEngineInstances(rootDeviceEnvironment);
|
2021-10-28 04:22:31 +08:00
|
|
|
for (const auto &engine : engines) {
|
|
|
|
if (engine.first == aub_stream::EngineType::ENGINE_BCS) {
|
2023-01-09 21:30:43 +08:00
|
|
|
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
|
|
|
return productHelper.isBlitterFullySupported(*hwInfo);
|
2021-10-28 04:22:31 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
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());
|
2023-07-28 16:34:22 +08:00
|
|
|
}
|