Files
compute-runtime/shared/test/common/test_macros/test_checks_shared.cpp
Filip Hazubski 5b80bd4d7c performance: Memory handling improvements
By default prefer allocating memory first by KMD, instead of malloc first.

By default prefer not caching allocations on MTL devices. This results
in allocations being handled with non-coherent pat index.

For integrated devices when caching is not preferred do not allow
direct memory access in CPU domain. For map/unmap operations create
a dedicated memory allocation for CPU access, instead of accessing it
directly, reusing the same logic as when mapping/unmapping local memory.

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2023-07-19 19:21:44 +02:00

63 lines
2.3 KiB
C++

/*
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/test/common/test_macros/test_checks_shared.h"
#include "shared/source/device/device.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/gfx_core_helper.h"
#include "shared/test/common/test_macros/hw_test.h"
using namespace NEO;
bool TestChecks::supportsBlitter(const RootDeviceEnvironment &rootDeviceEnvironment) {
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
auto hwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
auto engines = gfxCoreHelper.getGpgpuEngineInstances(rootDeviceEnvironment);
for (const auto &engine : engines) {
if (engine.first == aub_stream::EngineType::ENGINE_BCS) {
return hwInfo->capabilityTable.blitterOperationsSupported;
}
}
return false;
}
bool TestChecks::fullySupportsBlitter(const RootDeviceEnvironment &rootDeviceEnvironment) {
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
auto hwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
auto engines = gfxCoreHelper.getGpgpuEngineInstances(rootDeviceEnvironment);
for (const auto &engine : engines) {
if (engine.first == aub_stream::EngineType::ENGINE_BCS) {
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
return productHelper.isBlitterFullySupported(*hwInfo);
}
}
return false;
}
bool TestChecks::supportsImages(const HardwareInfo &hardwareInfo) {
return hardwareInfo.capabilityTable.supportsImages;
}
bool TestChecks::supportsImages(const std::unique_ptr<HardwareInfo> &pHardwareInfo) {
return supportsImages(*pHardwareInfo);
}
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());
}
bool TestChecks::supportsCpuMemAccess(const RootDeviceEnvironment &rootDeviceEnvironment) {
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
return productHelper.isCachingOnCpuAvailable();
}