mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Remove HardwareCapabilities struct
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ec1e39bab8
commit
5856c283c5
@@ -810,12 +810,11 @@ TEST_F(DeviceTest, givenCallToDevicePropertiesThenMaximumMemoryToBeAllocatedIsCo
|
|||||||
deviceProperties.maxMemAllocSize = 0;
|
deviceProperties.maxMemAllocSize = 0;
|
||||||
device->getProperties(&deviceProperties);
|
device->getProperties(&deviceProperties);
|
||||||
EXPECT_EQ(deviceProperties.maxMemAllocSize, this->neoDevice->getDeviceInfo().maxMemAllocSize);
|
EXPECT_EQ(deviceProperties.maxMemAllocSize, this->neoDevice->getDeviceInfo().maxMemAllocSize);
|
||||||
HardwareCapabilities hwCaps = {0};
|
|
||||||
auto &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
|
auto &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
|
||||||
hwHelper.setupHardwareCapabilities(&hwCaps, *defaultHwInfo);
|
|
||||||
auto expectedSize = this->neoDevice->getDeviceInfo().globalMemSize;
|
auto expectedSize = this->neoDevice->getDeviceInfo().globalMemSize;
|
||||||
if (!this->neoDevice->getDeviceInfo().sharedSystemAllocationsSupport) {
|
if (!this->neoDevice->getDeviceInfo().sharedSystemAllocationsSupport) {
|
||||||
expectedSize = std::min(expectedSize, hwCaps.maxMemAllocSize);
|
expectedSize = std::min(expectedSize, hwHelper.getMaxMemAllocSize());
|
||||||
}
|
}
|
||||||
EXPECT_EQ(deviceProperties.maxMemAllocSize, expectedSize);
|
EXPECT_EQ(deviceProperties.maxMemAllocSize, expectedSize);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,7 +162,6 @@ Debugger *ClDevice::getDebugger() { return device.getDebugger(); }
|
|||||||
SourceLevelDebugger *ClDevice::getSourceLevelDebugger() { return device.getSourceLevelDebugger(); }
|
SourceLevelDebugger *ClDevice::getSourceLevelDebugger() { return device.getSourceLevelDebugger(); }
|
||||||
ExecutionEnvironment *ClDevice::getExecutionEnvironment() const { return device.getExecutionEnvironment(); }
|
ExecutionEnvironment *ClDevice::getExecutionEnvironment() const { return device.getExecutionEnvironment(); }
|
||||||
const RootDeviceEnvironment &ClDevice::getRootDeviceEnvironment() const { return device.getRootDeviceEnvironment(); }
|
const RootDeviceEnvironment &ClDevice::getRootDeviceEnvironment() const { return device.getRootDeviceEnvironment(); }
|
||||||
const HardwareCapabilities &ClDevice::getHardwareCapabilities() const { return device.getHardwareCapabilities(); }
|
|
||||||
bool ClDevice::isFullRangeSvm() const { return device.isFullRangeSvm(); }
|
bool ClDevice::isFullRangeSvm() const { return device.isFullRangeSvm(); }
|
||||||
bool ClDevice::areSharedSystemAllocationsAllowed() const { return device.areSharedSystemAllocationsAllowed(); }
|
bool ClDevice::areSharedSystemAllocationsAllowed() const { return device.areSharedSystemAllocationsAllowed(); }
|
||||||
uint32_t ClDevice::getRootDeviceIndex() const { return device.getRootDeviceIndex(); }
|
uint32_t ClDevice::getRootDeviceIndex() const { return device.getRootDeviceIndex(); }
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ class Platform;
|
|||||||
class SourceLevelDebugger;
|
class SourceLevelDebugger;
|
||||||
struct DeviceInfo;
|
struct DeviceInfo;
|
||||||
struct EngineControl;
|
struct EngineControl;
|
||||||
struct HardwareCapabilities;
|
|
||||||
struct HardwareInfo;
|
struct HardwareInfo;
|
||||||
struct RootDeviceEnvironment;
|
struct RootDeviceEnvironment;
|
||||||
struct SelectorCopyEngine;
|
struct SelectorCopyEngine;
|
||||||
@@ -85,7 +84,6 @@ class ClDevice : public BaseObject<_cl_device_id> {
|
|||||||
SourceLevelDebugger *getSourceLevelDebugger();
|
SourceLevelDebugger *getSourceLevelDebugger();
|
||||||
ExecutionEnvironment *getExecutionEnvironment() const;
|
ExecutionEnvironment *getExecutionEnvironment() const;
|
||||||
const RootDeviceEnvironment &getRootDeviceEnvironment() const;
|
const RootDeviceEnvironment &getRootDeviceEnvironment() const;
|
||||||
const HardwareCapabilities &getHardwareCapabilities() const;
|
|
||||||
bool isFullRangeSvm() const;
|
bool isFullRangeSvm() const;
|
||||||
bool areSharedSystemAllocationsAllowed() const;
|
bool areSharedSystemAllocationsAllowed() const;
|
||||||
uint32_t getRootDeviceIndex() const;
|
uint32_t getRootDeviceIndex() const;
|
||||||
|
|||||||
@@ -331,8 +331,8 @@ void ClDevice::initializeCaps() {
|
|||||||
|
|
||||||
deviceInfo.localMemType = CL_LOCAL;
|
deviceInfo.localMemType = CL_LOCAL;
|
||||||
|
|
||||||
deviceInfo.image3DMaxWidth = this->getHardwareCapabilities().image3DMaxWidth;
|
deviceInfo.image3DMaxWidth = hwHelper.getMax3dImageWidthOrHeight();
|
||||||
deviceInfo.image3DMaxHeight = this->getHardwareCapabilities().image3DMaxHeight;
|
deviceInfo.image3DMaxHeight = hwHelper.getMax3dImageWidthOrHeight();
|
||||||
|
|
||||||
// cl_khr_image2d_from_buffer
|
// cl_khr_image2d_from_buffer
|
||||||
deviceInfo.imagePitchAlignment = hwHelper.getPitchAlignmentForImage(&hwInfo);
|
deviceInfo.imagePitchAlignment = hwHelper.getPitchAlignmentForImage(&hwInfo);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ void Program::initInternalOptions(std::string &internalOptions) const {
|
|||||||
CompilerOptions::concatenateAppend(internalOptions, CompilerOptions::bindlessMode);
|
CompilerOptions::concatenateAppend(internalOptions, CompilerOptions::bindlessMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto enableStatelessToStatefullWithOffset = pClDevice->getHardwareCapabilities().isStatelesToStatefullWithOffsetSupported;
|
auto enableStatelessToStatefullWithOffset = HwHelper::get(pClDevice->getHardwareInfo().platform.eRenderCoreFamily).isStatelesToStatefullWithOffsetSupported();
|
||||||
if (DebugManager.flags.EnableStatelessToStatefulBufferOffsetOpt.get() != -1) {
|
if (DebugManager.flags.EnableStatelessToStatefulBufferOffsetOpt.get() != -1) {
|
||||||
enableStatelessToStatefullWithOffset = DebugManager.flags.EnableStatelessToStatefulBufferOffsetOpt.get() != 0;
|
enableStatelessToStatefullWithOffset = DebugManager.flags.EnableStatelessToStatefulBufferOffsetOpt.get() != 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ struct CommandQueueStateful : public CommandQueueHw<FamilyType> {
|
|||||||
auto &device = dispatchInfo.begin()->getClDevice();
|
auto &device = dispatchInfo.begin()->getClDevice();
|
||||||
if (!device.areSharedSystemAllocationsAllowed()) {
|
if (!device.areSharedSystemAllocationsAllowed()) {
|
||||||
EXPECT_FALSE(kernel->getKernelInfo().kernelDescriptor.kernelAttributes.supportsBuffersBiggerThan4Gb());
|
EXPECT_FALSE(kernel->getKernelInfo().kernelDescriptor.kernelAttributes.supportsBuffersBiggerThan4Gb());
|
||||||
if (device.getHardwareCapabilities().isStatelesToStatefullWithOffsetSupported) {
|
if (HwHelperHw<FamilyType>::get().isStatelesToStatefullWithOffsetSupported()) {
|
||||||
EXPECT_TRUE(kernel->allBufferArgsStateful);
|
EXPECT_TRUE(kernel->allBufferArgsStateful);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -504,18 +504,14 @@ TEST_F(DeviceGetCapsTest, givenDeviceCapsWhenLocalMemoryIsEnabledThenCalculateGl
|
|||||||
EXPECT_EQ(sharedCaps.globalMemSize, expectedSize);
|
EXPECT_EQ(sharedCaps.globalMemSize, expectedSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(DeviceGetCapsTest, givenGlobalMemSizeAndSharedSystemAllocationsNotSupportedWhenCalculatingMaxAllocSizeThenAdjustToHWCap) {
|
HWTEST_F(DeviceGetCapsTest, givenGlobalMemSizeAndSharedSystemAllocationsNotSupportedWhenCalculatingMaxAllocSizeThenAdjustToHWCap) {
|
||||||
DebugManagerStateRestore dbgRestorer;
|
DebugManagerStateRestore dbgRestorer;
|
||||||
DebugManager.flags.EnableSharedSystemUsmSupport.set(0);
|
DebugManager.flags.EnableSharedSystemUsmSupport.set(0);
|
||||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||||
const auto &caps = device->getSharedDeviceInfo();
|
const auto &caps = device->getSharedDeviceInfo();
|
||||||
|
|
||||||
HardwareCapabilities hwCaps = {0};
|
|
||||||
auto &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
|
|
||||||
hwHelper.setupHardwareCapabilities(&hwCaps, *defaultHwInfo);
|
|
||||||
|
|
||||||
uint64_t expectedSize = std::max((caps.globalMemSize / 2), static_cast<uint64_t>(128ULL * MemoryConstants::megaByte));
|
uint64_t expectedSize = std::max((caps.globalMemSize / 2), static_cast<uint64_t>(128ULL * MemoryConstants::megaByte));
|
||||||
expectedSize = std::min(expectedSize, hwCaps.maxMemAllocSize);
|
expectedSize = std::min(expectedSize, HwHelperHw<FamilyType>::get().getMaxMemAllocSize());
|
||||||
EXPECT_EQ(caps.maxMemAllocSize, expectedSize);
|
EXPECT_EQ(caps.maxMemAllocSize, expectedSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,13 +31,6 @@ GEN11TEST_F(HwHelperTestGen11, WhenAdjustingDefaultEngineTypeThenEngineTypeIsSet
|
|||||||
EXPECT_EQ(engineType, hardwareInfo.capabilityTable.defaultEngineType);
|
EXPECT_EQ(engineType, hardwareInfo.capabilityTable.defaultEngineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
GEN11TEST_F(HwHelperTestGen11, givenGen11PlatformWhenSetupHardwareCapabilitiesIsCalledThenDefaultImplementationIsUsed) {
|
|
||||||
auto &helper = HwHelper::get(renderCoreFamily);
|
|
||||||
|
|
||||||
// Test default method implementation
|
|
||||||
testDefaultImplementationOfSetupHardwareCapabilities(helper, hardwareInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
GEN11TEST_F(HwHelperTestGen11, whenGetGpgpuEnginesThenReturnThreeRcsEngines) {
|
GEN11TEST_F(HwHelperTestGen11, whenGetGpgpuEnginesThenReturnThreeRcsEngines) {
|
||||||
whenGetGpgpuEnginesThenReturnTwoRcsEngines<FamilyType>(pDevice->getHardwareInfo());
|
whenGetGpgpuEnginesThenReturnTwoRcsEngines<FamilyType>(pDevice->getHardwareInfo());
|
||||||
EXPECT_EQ(3u, pDevice->engines.size());
|
EXPECT_EQ(3u, pDevice->engines.size());
|
||||||
|
|||||||
@@ -14,18 +14,6 @@
|
|||||||
|
|
||||||
using HwHelperTestDg1 = HwHelperTest;
|
using HwHelperTestDg1 = HwHelperTest;
|
||||||
|
|
||||||
DG1TEST_F(HwHelperTestDg1, givenDg1PlatformWhenSetupHardwareCapabilitiesIsCalledThenThenSpecificImplementationIsUsed) {
|
|
||||||
hardwareInfo.featureTable.ftrLocalMemory = true;
|
|
||||||
|
|
||||||
HardwareCapabilities hwCaps = {0};
|
|
||||||
auto &helper = HwHelper::get(renderCoreFamily);
|
|
||||||
helper.setupHardwareCapabilities(&hwCaps, hardwareInfo);
|
|
||||||
|
|
||||||
EXPECT_EQ(2048u, hwCaps.image3DMaxHeight);
|
|
||||||
EXPECT_EQ(2048u, hwCaps.image3DMaxWidth);
|
|
||||||
EXPECT_TRUE(hwCaps.isStatelesToStatefullWithOffsetSupported);
|
|
||||||
}
|
|
||||||
|
|
||||||
DG1TEST_F(HwHelperTestDg1, givenDg1A0WhenAdjustDefaultEngineTypeCalledThenRcsIsReturned) {
|
DG1TEST_F(HwHelperTestDg1, givenDg1A0WhenAdjustDefaultEngineTypeCalledThenRcsIsReturned) {
|
||||||
auto &helper = HwHelper::get(renderCoreFamily);
|
auto &helper = HwHelper::get(renderCoreFamily);
|
||||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||||
|
|||||||
@@ -58,17 +58,6 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, WhenAdjustingDefaultEngineTypeThenRcsIsSet) {
|
|||||||
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
|
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
GEN12LPTEST_F(HwHelperTestGen12Lp, givenGen12LpPlatformWhenSetupHardwareCapabilitiesIsCalledThenShouldSetCorrectValues) {
|
|
||||||
HardwareCapabilities hwCaps = {0};
|
|
||||||
|
|
||||||
auto &hwHelper = HwHelper::get(renderCoreFamily);
|
|
||||||
hwHelper.setupHardwareCapabilities(&hwCaps, hardwareInfo);
|
|
||||||
|
|
||||||
EXPECT_EQ(2048u, hwCaps.image3DMaxHeight);
|
|
||||||
EXPECT_EQ(2048u, hwCaps.image3DMaxWidth);
|
|
||||||
EXPECT_TRUE(hwCaps.isStatelesToStatefullWithOffsetSupported);
|
|
||||||
}
|
|
||||||
|
|
||||||
GEN12LPTEST_F(HwHelperTestGen12Lp, givenDifferentSizesOfAllocationWhenCheckingCompressionPreferenceThenReturnCorrectValue) {
|
GEN12LPTEST_F(HwHelperTestGen12Lp, givenDifferentSizesOfAllocationWhenCheckingCompressionPreferenceThenReturnCorrectValue) {
|
||||||
auto &helper = HwHelper::get(renderCoreFamily);
|
auto &helper = HwHelper::get(renderCoreFamily);
|
||||||
|
|
||||||
|
|||||||
@@ -34,17 +34,6 @@ GEN8TEST_F(HwHelperTestGen8, WhenAdjustingDefaultEngineTypeThenEngineTypeIsSet)
|
|||||||
EXPECT_EQ(engineType, hardwareInfo.capabilityTable.defaultEngineType);
|
EXPECT_EQ(engineType, hardwareInfo.capabilityTable.defaultEngineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
GEN8TEST_F(HwHelperTestGen8, givenGen8PlatformWhenSetupHardwareCapabilitiesIsCalledThenSpecificImplementationIsUsed) {
|
|
||||||
auto &helper = HwHelper::get(renderCoreFamily);
|
|
||||||
HardwareCapabilities hwCaps = {0};
|
|
||||||
helper.setupHardwareCapabilities(&hwCaps, hardwareInfo);
|
|
||||||
|
|
||||||
EXPECT_EQ(2048u, hwCaps.image3DMaxHeight);
|
|
||||||
EXPECT_EQ(2048u, hwCaps.image3DMaxWidth);
|
|
||||||
EXPECT_EQ(2 * MemoryConstants::gigaByte - 8 * MemoryConstants::megaByte, hwCaps.maxMemAllocSize);
|
|
||||||
EXPECT_FALSE(hwCaps.isStatelesToStatefullWithOffsetSupported);
|
|
||||||
}
|
|
||||||
|
|
||||||
GEN8TEST_F(HwHelperTestGen8, whenGetGpgpuEnginesThenReturnThreeEngines) {
|
GEN8TEST_F(HwHelperTestGen8, whenGetGpgpuEnginesThenReturnThreeEngines) {
|
||||||
whenGetGpgpuEnginesThenReturnTwoRcsEngines<FamilyType>(pDevice->getHardwareInfo());
|
whenGetGpgpuEnginesThenReturnTwoRcsEngines<FamilyType>(pDevice->getHardwareInfo());
|
||||||
EXPECT_EQ(3u, pDevice->engines.size());
|
EXPECT_EQ(3u, pDevice->engines.size());
|
||||||
|
|||||||
@@ -36,13 +36,6 @@ GEN9TEST_F(HwHelperTestGen9, WhenAdjustingDefaultEngineTypeThenEngineTypeIsSet)
|
|||||||
EXPECT_EQ(engineType, hardwareInfo.capabilityTable.defaultEngineType);
|
EXPECT_EQ(engineType, hardwareInfo.capabilityTable.defaultEngineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
GEN9TEST_F(HwHelperTestGen9, givenGen9PlatformWhenSetupHardwareCapabilitiesIsCalledThenDefaultImplementationIsUsed) {
|
|
||||||
auto &helper = HwHelper::get(renderCoreFamily);
|
|
||||||
|
|
||||||
// Test default method implementation
|
|
||||||
testDefaultImplementationOfSetupHardwareCapabilities(helper, hardwareInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
GEN9TEST_F(HwHelperTestGen9, givenDebuggingActiveWhenSipKernelTypeIsQueriedThenDbgCsrLocalTypeIsReturned) {
|
GEN9TEST_F(HwHelperTestGen9, givenDebuggingActiveWhenSipKernelTypeIsQueriedThenDbgCsrLocalTypeIsReturned) {
|
||||||
auto &helper = HwHelper::get(renderCoreFamily);
|
auto &helper = HwHelper::get(renderCoreFamily);
|
||||||
|
|
||||||
|
|||||||
@@ -9,16 +9,6 @@
|
|||||||
|
|
||||||
#include "opencl/test/unit_test/helpers/hw_helper_tests.h"
|
#include "opencl/test/unit_test/helpers/hw_helper_tests.h"
|
||||||
|
|
||||||
void testDefaultImplementationOfSetupHardwareCapabilities(HwHelper &hwHelper, const HardwareInfo &hwInfo) {
|
|
||||||
HardwareCapabilities hwCaps = {0};
|
|
||||||
|
|
||||||
hwHelper.setupHardwareCapabilities(&hwCaps, hwInfo);
|
|
||||||
|
|
||||||
EXPECT_EQ(16384u, hwCaps.image3DMaxHeight);
|
|
||||||
EXPECT_EQ(16384u, hwCaps.image3DMaxWidth);
|
|
||||||
EXPECT_TRUE(hwCaps.isStatelesToStatefullWithOffsetSupported);
|
|
||||||
}
|
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, givenHwHelperWhenAskedForHvAlign4RequiredThenReturnTrue) {
|
HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, givenHwHelperWhenAskedForHvAlign4RequiredThenReturnTrue) {
|
||||||
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
|
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
|
||||||
EXPECT_TRUE(hwHelper.hvAlign4Required());
|
EXPECT_TRUE(hwHelper.hvAlign4Required());
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ using namespace NEO;
|
|||||||
|
|
||||||
using HwHelperTest = Test<ClDeviceFixture>;
|
using HwHelperTest = Test<ClDeviceFixture>;
|
||||||
|
|
||||||
void testDefaultImplementationOfSetupHardwareCapabilities(HwHelper &hwHelper, const HardwareInfo &hwInfo);
|
|
||||||
|
|
||||||
struct ComputeSlmTestInput {
|
struct ComputeSlmTestInput {
|
||||||
uint32_t expected;
|
uint32_t expected;
|
||||||
uint32_t slmSize;
|
uint32_t slmSize;
|
||||||
|
|||||||
@@ -57,18 +57,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, HwHelperTestXeHPAndLater, GiveCcsNodeThenDefaultEng
|
|||||||
EXPECT_EQ(aub_stream::ENGINE_CCS, hardwareInfo.capabilityTable.defaultEngineType);
|
EXPECT_EQ(aub_stream::ENGINE_CCS, hardwareInfo.capabilityTable.defaultEngineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_XE_HP_CORE, HwHelperTestXeHPAndLater, givenXeHPAndLaterPlatformWhenSetupHardwareCapabilitiesIsCalledThenThenSpecificImplementationIsUsed) {
|
|
||||||
hardwareInfo.featureTable.ftrLocalMemory = true;
|
|
||||||
|
|
||||||
HardwareCapabilities hwCaps = {0};
|
|
||||||
auto &helper = HwHelper::get(renderCoreFamily);
|
|
||||||
helper.setupHardwareCapabilities(&hwCaps, hardwareInfo);
|
|
||||||
|
|
||||||
EXPECT_EQ(16384u, hwCaps.image3DMaxHeight);
|
|
||||||
EXPECT_EQ(16384u, hwCaps.image3DMaxWidth);
|
|
||||||
EXPECT_TRUE(hwCaps.isStatelesToStatefullWithOffsetSupported);
|
|
||||||
}
|
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_XE_HP_CORE, HwHelperTestXeHPAndLater, givenXeHPAndLaterPlatformWithLocalMemoryFeatureWhenIsLocalMemoryEnabledIsCalledThenTrueIsReturned) {
|
HWCMDTEST_F(IGFX_XE_HP_CORE, HwHelperTestXeHPAndLater, givenXeHPAndLaterPlatformWithLocalMemoryFeatureWhenIsLocalMemoryEnabledIsCalledThenTrueIsReturned) {
|
||||||
hardwareInfo.featureTable.ftrLocalMemory = true;
|
hardwareInfo.featureTable.ftrLocalMemory = true;
|
||||||
|
|
||||||
|
|||||||
@@ -2210,13 +2210,11 @@ TEST_F(Program32BitTests, givenDeviceWithForce32BitAddressingOnWhenProgramIsCrea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ProgramTests, givenNewProgramThenStatelessToStatefulBufferOffsetOptimizationIsMatchingThePlatformEnablingStatus) {
|
HWTEST_F(ProgramTests, givenNewProgramThenStatelessToStatefulBufferOffsetOptimizationIsMatchingThePlatformEnablingStatus) {
|
||||||
MockProgram program(pContext, false, toClDeviceVector(*pClDevice));
|
MockProgram program(pContext, false, toClDeviceVector(*pClDevice));
|
||||||
auto internalOptions = program.getInitInternalOptions();
|
auto internalOptions = program.getInitInternalOptions();
|
||||||
|
|
||||||
HardwareCapabilities hwCaps = {0};
|
if (HwHelperHw<FamilyType>::get().isStatelesToStatefullWithOffsetSupported()) {
|
||||||
HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily).setupHardwareCapabilities(&hwCaps, pDevice->getHardwareInfo());
|
|
||||||
if (hwCaps.isStatelesToStatefullWithOffsetSupported) {
|
|
||||||
EXPECT_TRUE(CompilerOptions::contains(internalOptions, CompilerOptions::hasBufferOffsetArg));
|
EXPECT_TRUE(CompilerOptions::contains(internalOptions, CompilerOptions::hasBufferOffsetArg));
|
||||||
} else {
|
} else {
|
||||||
EXPECT_FALSE(CompilerOptions::contains(internalOptions, CompilerOptions::hasBufferOffsetArg));
|
EXPECT_FALSE(CompilerOptions::contains(internalOptions, CompilerOptions::hasBufferOffsetArg));
|
||||||
|
|||||||
@@ -204,8 +204,6 @@ bool Device::createDeviceImpl() {
|
|||||||
auto &hwInfo = getHardwareInfo();
|
auto &hwInfo = getHardwareInfo();
|
||||||
preemptionMode = PreemptionHelper::getDefaultPreemptionMode(hwInfo);
|
preemptionMode = PreemptionHelper::getDefaultPreemptionMode(hwInfo);
|
||||||
|
|
||||||
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
|
||||||
hwHelper.setupHardwareCapabilities(&this->hardwareCapabilities, hwInfo);
|
|
||||||
executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->initGmm();
|
executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->initGmm();
|
||||||
|
|
||||||
if (!getDebugger()) {
|
if (!getDebugger()) {
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ class Device : public ReferenceTrackedObject<Device> {
|
|||||||
ExecutionEnvironment *getExecutionEnvironment() const { return executionEnvironment; }
|
ExecutionEnvironment *getExecutionEnvironment() const { return executionEnvironment; }
|
||||||
const RootDeviceEnvironment &getRootDeviceEnvironment() const { return *executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]; }
|
const RootDeviceEnvironment &getRootDeviceEnvironment() const { return *executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]; }
|
||||||
RootDeviceEnvironment &getRootDeviceEnvironmentRef() const { return *executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]; }
|
RootDeviceEnvironment &getRootDeviceEnvironmentRef() const { return *executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]; }
|
||||||
const HardwareCapabilities &getHardwareCapabilities() const { return hardwareCapabilities; }
|
|
||||||
bool isFullRangeSvm() const {
|
bool isFullRangeSvm() const {
|
||||||
return getRootDeviceEnvironment().isFullRangeSvm();
|
return getRootDeviceEnvironment().isFullRangeSvm();
|
||||||
}
|
}
|
||||||
@@ -161,7 +160,6 @@ class Device : public ReferenceTrackedObject<Device> {
|
|||||||
|
|
||||||
DeviceInfo deviceInfo = {};
|
DeviceInfo deviceInfo = {};
|
||||||
|
|
||||||
HardwareCapabilities hardwareCapabilities = {};
|
|
||||||
std::unique_ptr<PerformanceCounters> performanceCounters;
|
std::unique_ptr<PerformanceCounters> performanceCounters;
|
||||||
std::vector<std::unique_ptr<CommandStreamReceiver>> commandStreamReceivers;
|
std::vector<std::unique_ptr<CommandStreamReceiver>> commandStreamReceivers;
|
||||||
std::vector<EngineControl> engines;
|
std::vector<EngineControl> engines;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ void Device::initializeCaps() {
|
|||||||
|
|
||||||
if (!deviceInfo.sharedSystemAllocationsSupport) {
|
if (!deviceInfo.sharedSystemAllocationsSupport) {
|
||||||
deviceInfo.maxMemAllocSize = ApiSpecificConfig::getReducedMaxAllocSize(deviceInfo.maxMemAllocSize);
|
deviceInfo.maxMemAllocSize = ApiSpecificConfig::getReducedMaxAllocSize(deviceInfo.maxMemAllocSize);
|
||||||
deviceInfo.maxMemAllocSize = std::min(deviceInfo.maxMemAllocSize, this->hardwareCapabilities.maxMemAllocSize);
|
deviceInfo.maxMemAllocSize = std::min(deviceInfo.maxMemAllocSize, hwHelper.getMaxMemAllocSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some specific driver model configurations may impose additional limitations
|
// Some specific driver model configurations may impose additional limitations
|
||||||
|
|||||||
@@ -21,13 +21,8 @@ using Family = NEO::TGLLPFamily;
|
|||||||
namespace NEO {
|
namespace NEO {
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) {
|
size_t HwHelperHw<Family>::getMax3dImageWidthOrHeight() const {
|
||||||
caps->image3DMaxHeight = 2048;
|
return 2048;
|
||||||
caps->image3DMaxWidth = 2048;
|
|
||||||
//With statefull messages we have an allocation cap of 4GB
|
|
||||||
//Reason to subtract 8KB is that driver may pad the buffer with addition pages for over fetching..
|
|
||||||
caps->maxMemAllocSize = (4ULL * MemoryConstants::gigaByte) - (8ULL * MemoryConstants::kiloByte);
|
|
||||||
caps->isStatelesToStatefullWithOffsetSupported = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
|||||||
@@ -42,11 +42,18 @@ size_t HwHelperHw<Family>::getMaxBarrierRegisterPerSlice() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) {
|
size_t HwHelperHw<Family>::getMax3dImageWidthOrHeight() const {
|
||||||
caps->image3DMaxHeight = 2048;
|
return 2048;
|
||||||
caps->image3DMaxWidth = 2048;
|
}
|
||||||
caps->maxMemAllocSize = 2 * MemoryConstants::gigaByte - 8 * MemoryConstants::megaByte;
|
|
||||||
caps->isStatelesToStatefullWithOffsetSupported = false;
|
template <>
|
||||||
|
uint64_t HwHelperHw<Family>::getMaxMemAllocSize() const {
|
||||||
|
return (2 * MemoryConstants::gigaByte) - (8 * MemoryConstants::kiloByte);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
bool HwHelperHw<Family>::isStatelesToStatefullWithOffsetSupported() const {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ class Gmm;
|
|||||||
struct AllocationData;
|
struct AllocationData;
|
||||||
struct AllocationProperties;
|
struct AllocationProperties;
|
||||||
struct EngineControl;
|
struct EngineControl;
|
||||||
struct HardwareCapabilities;
|
|
||||||
struct RootDeviceEnvironment;
|
struct RootDeviceEnvironment;
|
||||||
struct PipeControlArgs;
|
struct PipeControlArgs;
|
||||||
|
|
||||||
@@ -49,7 +48,6 @@ class HwHelper {
|
|||||||
virtual uint32_t getPitchAlignmentForImage(const HardwareInfo *hwInfo) const = 0;
|
virtual uint32_t getPitchAlignmentForImage(const HardwareInfo *hwInfo) const = 0;
|
||||||
virtual uint32_t getMaxNumSamplers() const = 0;
|
virtual uint32_t getMaxNumSamplers() const = 0;
|
||||||
virtual void adjustDefaultEngineType(HardwareInfo *pHwInfo) = 0;
|
virtual void adjustDefaultEngineType(HardwareInfo *pHwInfo) = 0;
|
||||||
virtual void setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) = 0;
|
|
||||||
virtual bool isL3Configurable(const HardwareInfo &hwInfo) = 0;
|
virtual bool isL3Configurable(const HardwareInfo &hwInfo) = 0;
|
||||||
virtual SipKernelType getSipKernelType(bool debuggingActive) const = 0;
|
virtual SipKernelType getSipKernelType(bool debuggingActive) const = 0;
|
||||||
virtual bool isLocalMemoryEnabled(const HardwareInfo &hwInfo) const = 0;
|
virtual bool isLocalMemoryEnabled(const HardwareInfo &hwInfo) const = 0;
|
||||||
@@ -147,6 +145,9 @@ class HwHelper {
|
|||||||
|
|
||||||
virtual bool isScratchSpaceSurfaceStateAccessible() const = 0;
|
virtual bool isScratchSpaceSurfaceStateAccessible() const = 0;
|
||||||
virtual uint64_t getRenderSurfaceStateBaseAddress(void *renderSurfaceState) const = 0;
|
virtual uint64_t getRenderSurfaceStateBaseAddress(void *renderSurfaceState) const = 0;
|
||||||
|
virtual size_t getMax3dImageWidthOrHeight() const = 0;
|
||||||
|
virtual uint64_t getMaxMemAllocSize() const = 0;
|
||||||
|
virtual bool isStatelesToStatefullWithOffsetSupported() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
HwHelper() = default;
|
HwHelper() = default;
|
||||||
@@ -213,8 +214,6 @@ class HwHelperHw : public HwHelper {
|
|||||||
|
|
||||||
void adjustDefaultEngineType(HardwareInfo *pHwInfo) override;
|
void adjustDefaultEngineType(HardwareInfo *pHwInfo) override;
|
||||||
|
|
||||||
void setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) override;
|
|
||||||
|
|
||||||
bool isL3Configurable(const HardwareInfo &hwInfo) override;
|
bool isL3Configurable(const HardwareInfo &hwInfo) override;
|
||||||
|
|
||||||
SipKernelType getSipKernelType(bool debuggingActive) const override;
|
SipKernelType getSipKernelType(bool debuggingActive) const override;
|
||||||
@@ -370,6 +369,10 @@ class HwHelperHw : public HwHelper {
|
|||||||
bool isScratchSpaceSurfaceStateAccessible() const override;
|
bool isScratchSpaceSurfaceStateAccessible() const override;
|
||||||
uint64_t getRenderSurfaceStateBaseAddress(void *renderSurfaceState) const override;
|
uint64_t getRenderSurfaceStateBaseAddress(void *renderSurfaceState) const override;
|
||||||
|
|
||||||
|
size_t getMax3dImageWidthOrHeight() const override;
|
||||||
|
uint64_t getMaxMemAllocSize() const override;
|
||||||
|
bool isStatelesToStatefullWithOffsetSupported() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static const AuxTranslationMode defaultAuxTranslationMode;
|
static const AuxTranslationMode defaultAuxTranslationMode;
|
||||||
HwHelperHw() = default;
|
HwHelperHw() = default;
|
||||||
|
|||||||
@@ -38,13 +38,20 @@ bool HwHelperHw<Family>::isBufferSizeSuitableForRenderCompression(const size_t s
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Family>
|
template <typename Family>
|
||||||
void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps, const HardwareInfo &hwInfo) {
|
size_t HwHelperHw<Family>::getMax3dImageWidthOrHeight() const {
|
||||||
caps->image3DMaxHeight = 16384;
|
return 16384;
|
||||||
caps->image3DMaxWidth = 16384;
|
}
|
||||||
|
|
||||||
|
template <typename Family>
|
||||||
|
uint64_t HwHelperHw<Family>::getMaxMemAllocSize() const {
|
||||||
//With statefull messages we have an allocation cap of 4GB
|
//With statefull messages we have an allocation cap of 4GB
|
||||||
//Reason to subtract 8KB is that driver may pad the buffer with addition pages for over fetching..
|
//Reason to subtract 8KB is that driver may pad the buffer with addition pages for over fetching..
|
||||||
caps->maxMemAllocSize = (4ULL * MemoryConstants::gigaByte) - (8ULL * MemoryConstants::kiloByte);
|
return (4ULL * MemoryConstants::gigaByte) - (8ULL * MemoryConstants::kiloByte);
|
||||||
caps->isStatelesToStatefullWithOffsetSupported = true;
|
}
|
||||||
|
|
||||||
|
template <typename Family>
|
||||||
|
bool HwHelperHw<Family>::isStatelesToStatefullWithOffsetSupported() const {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Family>
|
template <typename Family>
|
||||||
|
|||||||
@@ -68,13 +68,6 @@ struct RuntimeCapabilityTable {
|
|||||||
bool fusedEuEnabled;
|
bool fusedEuEnabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HardwareCapabilities {
|
|
||||||
size_t image3DMaxWidth;
|
|
||||||
size_t image3DMaxHeight;
|
|
||||||
uint64_t maxMemAllocSize;
|
|
||||||
bool isStatelesToStatefullWithOffsetSupported;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct HardwareInfo {
|
struct HardwareInfo {
|
||||||
HardwareInfo() = default;
|
HardwareInfo() = default;
|
||||||
HardwareInfo(const PLATFORM *platform, const FeatureTable *featureTable, const WorkaroundTable *workaroundTable,
|
HardwareInfo(const PLATFORM *platform, const FeatureTable *featureTable, const WorkaroundTable *workaroundTable,
|
||||||
|
|||||||
Reference in New Issue
Block a user