Provide smaller surface size for tests

Change-Id: I3f08b85c17ee89f710a449dea3d71c9ecba5b44e
This commit is contained in:
mplewka
2018-02-21 16:06:09 +01:00
committed by sys_ocldev
parent 0e3f2bf361
commit 8ace8f8256
12 changed files with 67 additions and 31 deletions

View File

@ -162,7 +162,7 @@ bool Device::createDeviceImpl(const HardwareInfo *pHwInfo,
outDevice.memoryManager->device = pDevice;
if (pDevice->preemptionMode == PreemptionMode::MidThread) {
size_t requiredSize = pHwInfo->pSysInfo->CsrSizeInMb * MemoryConstants::megaByte;
size_t requiredSize = pHwInfo->capabilityTable.requiredPreemptionSurfaceSize;
size_t alignment = 256 * MemoryConstants::kiloByte;
bool uncacheable = pDevice->getWaTable()->waCSRUncachable;
pDevice->preemptionAllocation = outDevice.memoryManager->allocateGraphicsMemory(requiredSize, alignment, false, uncacheable);

View File

@ -23,6 +23,7 @@
#include "hw_info.h"
#include "hw_cmds.h"
#include "runtime/helpers/engine_node.h"
#include "runtime/memory_manager/memory_constants.h"
namespace OCLRT {
@ -72,7 +73,8 @@ const RuntimeCapabilityTable BDW::capabilityTable{
false, // EnableKmdNotify
30000, // delayKmdNotifyMicroseconds
false, // ftr64KBpages
EngineType::ENGINE_RCS // defaultEngineType
EngineType::ENGINE_RCS, // defaultEngineType
MemoryConstants::pageSize //requiredPreemptionSurfaceSize
};
const HardwareInfo BDW_1x2x6::hwInfo = {

View File

@ -23,6 +23,7 @@
#include "hw_info_bxt.h"
#include "hw_cmds.h"
#include "runtime/helpers/engine_node.h"
#include "runtime/memory_manager/memory_constants.h"
namespace OCLRT {
@ -68,7 +69,8 @@ const RuntimeCapabilityTable BXT::capabilityTable{
false, // EnableKmdNotify
30000, // delayKmdNotifyMicroseconds
false, // ftr64KBpages
EngineType::ENGINE_RCS // defaultEngineType
EngineType::ENGINE_RCS, // defaultEngineType
MemoryConstants::pageSize //requiredPreemptionSurfaceSize
};
const HardwareInfo BXT_1x2x6::hwInfo = {

View File

@ -23,6 +23,7 @@
#include "hw_info_cfl.h"
#include "hw_cmds.h"
#include "runtime/helpers/engine_node.h"
#include "runtime/memory_manager/memory_constants.h"
namespace OCLRT {
@ -63,7 +64,8 @@ const RuntimeCapabilityTable CFL::capabilityTable{
false, // EnableKmdNotify
30000, // delayKmdNotifyMicroseconds
true, // ftr64KBpages
EngineType::ENGINE_RCS // defaultEngineType
EngineType::ENGINE_RCS, // defaultEngineType
MemoryConstants::pageSize //requiredPreemptionSurfaceSize
};
const HardwareInfo CFL_1x2x6::hwInfo = {

View File

@ -23,6 +23,7 @@
#include "hw_info_glk.h"
#include "hw_cmds.h"
#include "runtime/helpers/engine_node.h"
#include "runtime/memory_manager/memory_constants.h"
namespace OCLRT {
@ -63,7 +64,8 @@ const RuntimeCapabilityTable GLK::capabilityTable{
true, // EnableKmdNotify
30000, // delayKmdNotifyMicroseconds
false, // ftr64KBpages
EngineType::ENGINE_RCS // defaultEngineType
EngineType::ENGINE_RCS, // defaultEngineType
MemoryConstants::pageSize //requiredPreemptionSurfaceSize
};
const HardwareInfo GLK_1x3x6::hwInfo = {

View File

@ -23,6 +23,7 @@
#include "hw_info_kbl.h"
#include "hw_cmds.h"
#include "runtime/helpers/engine_node.h"
#include "runtime/memory_manager/memory_constants.h"
namespace OCLRT {
@ -63,7 +64,8 @@ const RuntimeCapabilityTable KBL::capabilityTable{
false, // EnableKmdNotify
30000, // delayKmdNotifyMicroseconds
true, // ftr64KBpages
EngineType::ENGINE_RCS // defaultEngineType
EngineType::ENGINE_RCS, // defaultEngineType
MemoryConstants::pageSize //requiredPreemptionSurfaceSize
};
const HardwareInfo KBL_1x2x6::hwInfo = {

View File

@ -23,6 +23,7 @@
#include "hw_info_skl.h"
#include "hw_cmds.h"
#include "runtime/helpers/engine_node.h"
#include "runtime/memory_manager/memory_constants.h"
namespace OCLRT {
@ -71,7 +72,8 @@ const RuntimeCapabilityTable SKL::capabilityTable{
false, // EnableKmdNotify
30000, // delayKmdNotifyMicroseconds
true, // ftr64KBpages
EngineType::ENGINE_RCS // defaultEngineType
EngineType::ENGINE_RCS, // defaultEngineType
MemoryConstants::pageSize //requiredPreemptionSurfaceSize
};
const HardwareInfo SKL_1x2x6::hwInfo = {

View File

@ -69,6 +69,8 @@ struct RuntimeCapabilityTable {
bool ftr64KBpages;
EngineType defaultEngineType;
size_t requiredPreemptionSurfaceSize;
};
struct HardwareCapabilities {

View File

@ -28,6 +28,7 @@
#include "runtime/os_interface/linux/os_interface.h"
#include "runtime/os_interface/debug_settings_manager.h"
#include "runtime/utilities/cpu_info.h"
#include "runtime/memory_manager/memory_constants.h"
#include <cstring>
@ -180,6 +181,7 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
static_cast<bool>(outHwInfo->pSkuTable->ftrGpGpuMidThreadLevelPreempt) && preemption,
static_cast<bool>(outHwInfo->pSkuTable->ftrGpGpuThreadGroupLevelPreempt) && preemption,
static_cast<bool>(outHwInfo->pSkuTable->ftrGpGpuMidBatchPreempt) && preemption);
outHwInfo->capabilityTable.requiredPreemptionSurfaceSize = outHwInfo->pSysInfo->CsrSizeInMb * MemoryConstants::megaByte;
outHwInfo->capabilityTable.enableKmdNotify = DebugManager.flags.OverrideEnableKmdNotify.get() >= 0
? !!DebugManager.flags.OverrideEnableKmdNotify.get()

View File

@ -30,6 +30,7 @@
#include "runtime/device/device.h"
#include "runtime/os_interface/debug_settings_manager.h"
#include "runtime/sku_info/operations/sku_info_receiver.h"
#include "runtime/memory_manager/memory_constants.h"
namespace OCLRT {
@ -82,6 +83,7 @@ bool DeviceFactory::getDevices(HardwareInfo **pHWInfos, size_t &numDevices) {
static_cast<bool>(adapterInfo->SkuTable.FtrGpGpuMidThreadLevelPreempt),
static_cast<bool>(adapterInfo->SkuTable.FtrGpGpuThreadGroupLevelPreempt),
static_cast<bool>(adapterInfo->SkuTable.FtrGpGpuMidBatchPreempt));
tempHwInfos->capabilityTable.requiredPreemptionSurfaceSize = tempHwInfos->pSysInfo->CsrSizeInMb * MemoryConstants::megaByte;
// Instrumentation
tempHwInfos[devNum].capabilityTable.instrumentationEnabled &= haveInstrumentation && (adapterInfo->Caps.InstrumentationIsEnabled != 0);

View File

@ -24,6 +24,7 @@
#include "runtime/helpers/options.h"
#include "runtime/os_interface/device_factory.h"
#include "runtime/os_interface/os_library.h"
#include "runtime/memory_manager/memory_constants.h"
#include "unit_tests/fixtures/memory_management_fixture.h"
#include "unit_tests/helpers/debug_manager_state_restore.h"
#include "gtest/gtest.h"
@ -132,3 +133,13 @@ TEST_F(DeviceFactoryTest, getEngineTypeDebugOverride) {
DeviceFactory::releaseDevices();
}
TEST_F(DeviceFactoryTest, givenPointerToHwInfoWhenGetDevicedCalledThenRequiedSurfaceSizeIsSettedProperly) {
HardwareInfo *hwInfo = nullptr;
size_t numDevices = 0;
bool success = DeviceFactory::getDevices(&hwInfo, numDevices);
ASSERT_TRUE(success);
EXPECT_EQ(hwInfo->pSysInfo->CsrSizeInMb * MemoryConstants::megaByte, hwInfo->capabilityTable.requiredPreemptionSurfaceSize);
DeviceFactory::releaseDevices();
}

View File

@ -352,3 +352,10 @@ TEST_F(HwInfoConfigTestLinuxDummy, givenPlatformEnabledFtrCompressionWhenInitial
EXPECT_EQ(0, ret);
EXPECT_FALSE(outHwInfo.capabilityTable.ftrCompression);
}
TEST_F(HwInfoConfigTestLinuxDummy, givenPointerToHwInfoWhenConfigureHwInfoCalledThenRequiedSurfaceSizeIsSettedProperly) {
EXPECT_EQ(MemoryConstants::pageSize, pInHwInfo->capabilityTable.requiredPreemptionSurfaceSize);
int ret = hwConfig.configureHwInfo(pInHwInfo, &outHwInfo, osInterface);
EXPECT_EQ(0, ret);
EXPECT_EQ(outHwInfo.pSysInfo->CsrSizeInMb * MemoryConstants::megaByte, outHwInfo.capabilityTable.requiredPreemptionSurfaceSize);
}