mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Provide smaller surface size for tests
Change-Id: I3f08b85c17ee89f710a449dea3d71c9ecba5b44e
This commit is contained in:
@ -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);
|
||||
|
@ -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 {
|
||||
|
||||
@ -68,11 +69,12 @@ const RuntimeCapabilityTable BDW::capabilityTable{
|
||||
{false, false},
|
||||
&isSimulationBDW,
|
||||
true,
|
||||
true, // forceStatelessCompilationFor32Bit
|
||||
false, // EnableKmdNotify
|
||||
30000, // delayKmdNotifyMicroseconds
|
||||
false, // ftr64KBpages
|
||||
EngineType::ENGINE_RCS // defaultEngineType
|
||||
true, // forceStatelessCompilationFor32Bit
|
||||
false, // EnableKmdNotify
|
||||
30000, // delayKmdNotifyMicroseconds
|
||||
false, // ftr64KBpages
|
||||
EngineType::ENGINE_RCS, // defaultEngineType
|
||||
MemoryConstants::pageSize //requiredPreemptionSurfaceSize
|
||||
};
|
||||
|
||||
const HardwareInfo BDW_1x2x6::hwInfo = {
|
||||
|
@ -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 {
|
||||
|
||||
@ -64,11 +65,12 @@ const RuntimeCapabilityTable BXT::capabilityTable{
|
||||
{true, false},
|
||||
&isSimulationBXT,
|
||||
true,
|
||||
false, // forceStatelessCompilationFor32Bit
|
||||
false, // EnableKmdNotify
|
||||
30000, // delayKmdNotifyMicroseconds
|
||||
false, // ftr64KBpages
|
||||
EngineType::ENGINE_RCS // defaultEngineType
|
||||
false, // forceStatelessCompilationFor32Bit
|
||||
false, // EnableKmdNotify
|
||||
30000, // delayKmdNotifyMicroseconds
|
||||
false, // ftr64KBpages
|
||||
EngineType::ENGINE_RCS, // defaultEngineType
|
||||
MemoryConstants::pageSize //requiredPreemptionSurfaceSize
|
||||
};
|
||||
|
||||
const HardwareInfo BXT_1x2x6::hwInfo = {
|
||||
|
@ -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 {
|
||||
|
||||
@ -59,11 +60,12 @@ const RuntimeCapabilityTable CFL::capabilityTable{
|
||||
{true, false},
|
||||
&isSimulationCFL,
|
||||
true,
|
||||
true, // forceStatelessCompilationFor32Bit
|
||||
false, // EnableKmdNotify
|
||||
30000, // delayKmdNotifyMicroseconds
|
||||
true, // ftr64KBpages
|
||||
EngineType::ENGINE_RCS // defaultEngineType
|
||||
true, // forceStatelessCompilationFor32Bit
|
||||
false, // EnableKmdNotify
|
||||
30000, // delayKmdNotifyMicroseconds
|
||||
true, // ftr64KBpages
|
||||
EngineType::ENGINE_RCS, // defaultEngineType
|
||||
MemoryConstants::pageSize //requiredPreemptionSurfaceSize
|
||||
};
|
||||
|
||||
const HardwareInfo CFL_1x2x6::hwInfo = {
|
||||
|
@ -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 {
|
||||
|
||||
@ -59,11 +60,12 @@ const RuntimeCapabilityTable GLK::capabilityTable{
|
||||
{true, false},
|
||||
&isSimulationGLK,
|
||||
true,
|
||||
false, // forceStatelessCompilationFor32Bit
|
||||
true, // EnableKmdNotify
|
||||
30000, // delayKmdNotifyMicroseconds
|
||||
false, // ftr64KBpages
|
||||
EngineType::ENGINE_RCS // defaultEngineType
|
||||
false, // forceStatelessCompilationFor32Bit
|
||||
true, // EnableKmdNotify
|
||||
30000, // delayKmdNotifyMicroseconds
|
||||
false, // ftr64KBpages
|
||||
EngineType::ENGINE_RCS, // defaultEngineType
|
||||
MemoryConstants::pageSize //requiredPreemptionSurfaceSize
|
||||
};
|
||||
|
||||
const HardwareInfo GLK_1x3x6::hwInfo = {
|
||||
|
@ -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 {
|
||||
|
||||
@ -59,11 +60,12 @@ const RuntimeCapabilityTable KBL::capabilityTable{
|
||||
{true, false},
|
||||
&isSimulationKBL,
|
||||
true,
|
||||
true, // forceStatelessCompilationFor32Bit
|
||||
false, // EnableKmdNotify
|
||||
30000, // delayKmdNotifyMicroseconds
|
||||
true, // ftr64KBpages
|
||||
EngineType::ENGINE_RCS // defaultEngineType
|
||||
true, // forceStatelessCompilationFor32Bit
|
||||
false, // EnableKmdNotify
|
||||
30000, // delayKmdNotifyMicroseconds
|
||||
true, // ftr64KBpages
|
||||
EngineType::ENGINE_RCS, // defaultEngineType
|
||||
MemoryConstants::pageSize //requiredPreemptionSurfaceSize
|
||||
};
|
||||
|
||||
const HardwareInfo KBL_1x2x6::hwInfo = {
|
||||
|
@ -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 {
|
||||
|
||||
@ -67,11 +68,12 @@ const RuntimeCapabilityTable SKL::capabilityTable{
|
||||
{true, false},
|
||||
&isSimulationSKL,
|
||||
true,
|
||||
true, // forceStatelessCompilationFor32Bit
|
||||
false, // EnableKmdNotify
|
||||
30000, // delayKmdNotifyMicroseconds
|
||||
true, // ftr64KBpages
|
||||
EngineType::ENGINE_RCS // defaultEngineType
|
||||
true, // forceStatelessCompilationFor32Bit
|
||||
false, // EnableKmdNotify
|
||||
30000, // delayKmdNotifyMicroseconds
|
||||
true, // ftr64KBpages
|
||||
EngineType::ENGINE_RCS, // defaultEngineType
|
||||
MemoryConstants::pageSize //requiredPreemptionSurfaceSize
|
||||
};
|
||||
|
||||
const HardwareInfo SKL_1x2x6::hwInfo = {
|
||||
|
@ -69,6 +69,8 @@ struct RuntimeCapabilityTable {
|
||||
bool ftr64KBpages;
|
||||
|
||||
EngineType defaultEngineType;
|
||||
|
||||
size_t requiredPreemptionSurfaceSize;
|
||||
};
|
||||
|
||||
struct HardwareCapabilities {
|
||||
|
@ -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()
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
}
|
@ -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);
|
||||
}
|
Reference in New Issue
Block a user