Remove not used isSimulation functions

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-09-19 15:09:07 +02:00
committed by Compute-Runtime-Automation
parent 17d87a4c69
commit cfe51ff2ba
35 changed files with 15 additions and 474 deletions

View File

@ -197,24 +197,6 @@ TEST_F(DeviceTest, givenDeviceWithThreadsPerEUConfigsWhenQueryingEuThreadCountsT
EXPECT_EQ(456U, euThreadCounts[1]);
}
HWTEST_F(DeviceTest, givenNoHwCsrTypeAndModifiedDefaultEngineIndexWhenIsSimulationIsCalledThenTrueIsReturned) {
EXPECT_FALSE(pDevice->isSimulation());
auto csr = TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, 0, 1);
pDevice->defaultEngineIndex = 1;
pDevice->resetCommandStreamReceiver(csr);
EXPECT_TRUE(pDevice->isSimulation());
std::array<CommandStreamReceiverType, 3> exptectedEngineTypes = {CommandStreamReceiverType::CSR_HW,
CommandStreamReceiverType::CSR_TBX,
CommandStreamReceiverType::CSR_HW};
for (uint32_t i = 0u; i < 3u; ++i) {
auto engineType = pDevice->allEngines[i].commandStreamReceiver->getType();
EXPECT_EQ(exptectedEngineTypes[i], engineType);
}
}
TEST_F(DeviceTest, givenRootDeviceWithSubDevicesWhenCreatingThenRootDeviceContextIsInitialized) {
DebugManagerStateRestore restore{};
DebugManager.flags.DeferOsContextInitialization.set(1);
@ -281,49 +263,6 @@ TEST(DeviceCreation, GiveNonExistingFclWhenCreatingDeviceThenCompilerInterfaceIs
ASSERT_EQ(nullptr, compilerInterface);
}
TEST(DeviceCreation, givenSelectedAubCsrInDebugVarsWhenDeviceIsCreatedThenIsSimulationReturnsTrue) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_AUB);
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useHwCsr = true;
auto mockDevice = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(nullptr));
EXPECT_TRUE(mockDevice->isSimulation());
}
TEST(DeviceCreation, givenSelectedTbxCsrInDebugVarsWhenDeviceIsCreatedThenIsSimulationReturnsTrue) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_TBX);
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useHwCsr = true;
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(nullptr));
EXPECT_TRUE(device->isSimulation());
}
TEST(DeviceCreation, givenSelectedTbxWithAubCsrInDebugVarsWhenDeviceIsCreatedThenIsSimulationReturnsTrue) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_TBX_WITH_AUB);
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useHwCsr = true;
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(nullptr));
EXPECT_TRUE(device->isSimulation());
}
TEST(DeviceCreation, givenHwWithAubCsrInDebugVarsWhenDeviceIsCreatedThenIsSimulationReturnsFalse) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_HW_WITH_AUB);
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(nullptr));
EXPECT_FALSE(device->isSimulation());
}
TEST(DeviceCreation, givenDefaultHwCsrInDebugVarsWhenDeviceIsCreatedThenIsSimulationReturnsFalse) {
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(nullptr));
EXPECT_FALSE(device->isSimulation());
}
TEST(DeviceCreation, givenDeviceWhenItIsCreatedThenOsContextIsRegistredInMemoryManager) {
auto hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.blitterOperationsSupported = true;
@ -509,17 +448,6 @@ HWTEST_F(DeviceTest, givenDebugFlagWhenCreatingRootDeviceWithoutSubDevicesThenWo
}
}
TEST(DeviceCreation, givenFtrSimulationModeFlagTrueWhenNoOtherSimulationFlagsArePresentThenIsSimulationReturnsTrue) {
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.featureTable.flags.ftrSimulationMode = true;
bool simulationFromDeviceId = hwInfo.capabilityTable.isSimulation(hwInfo.platform.usDeviceID);
EXPECT_FALSE(simulationFromDeviceId);
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(&hwInfo));
EXPECT_TRUE(device->isSimulation());
}
TEST(DeviceCreation, givenDeviceWhenCheckingGpgpuEnginesCountThenNumberGreaterThanZeroIsReturned) {
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(nullptr));
auto &hwHelper = HwHelper::get(renderCoreFamily);

View File

@ -6,32 +6,13 @@
*/
#include "shared/source/gen11/hw_cmds_ehl.h"
#include "shared/test/common/fixtures/device_fixture.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
using namespace NEO;
using EhlTest = Test<ClDeviceFixture>;
EHLTEST_F(EhlTest, givenDeviceIdWhenAskingForSimulationThenReturnValidValue) {
unsigned short ehlSimulationIds[2] = {
IEHL_1x4x8_SUPERSKU_DEVICE_A0_ID,
0, // default, non-simulation
};
for (auto id : ehlSimulationIds) {
auto mockDevice = std::unique_ptr<MockDevice>(createWithUsDeviceId(id));
EXPECT_NE(nullptr, mockDevice);
if (id == 0) {
EXPECT_FALSE(mockDevice->isSimulation());
} else {
EXPECT_TRUE(mockDevice->isSimulation());
}
}
}
using EhlTest = Test<DeviceFixture>;
EHLTEST_F(EhlTest, givenEhlWhenSlmSizeIsRequiredThenReturnCorrectValue) {
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);

View File

@ -40,25 +40,6 @@ ICLLPTEST_F(IcllpTest, WhenCheckingCapsThenCorrectlyRoundedDivideSqrtIsNotSuppor
EXPECT_EQ(0u, caps.singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);
}
ICLLPTEST_F(IcllpTest, WhenCheckingSimulationCapThenResultIsCorrect) {
unsigned short iclLpSimulationIds[2] = {
IICL_LP_GT1_MOB_DEVICE_F0_ID,
0, // default, non-simulation
};
NEO::MockDevice *mockDevice = nullptr;
for (auto id : iclLpSimulationIds) {
mockDevice = createWithUsDeviceId(id);
ASSERT_NE(mockDevice, nullptr);
if (id == 0)
EXPECT_FALSE(mockDevice->isSimulation());
else
EXPECT_TRUE(mockDevice->isSimulation());
delete mockDevice;
}
}
ICLLPTEST_F(IcllpTest, GivenICLLPWhenCheckftr64KBpagesThenFalse) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
}

View File

@ -36,22 +36,3 @@ LKFTEST_F(LkfTest, givenLkfWhenExtensionStringIsCheckedThenFP64IsNotReported) {
EXPECT_EQ(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
EXPECT_EQ(0u, caps.doubleFpConfig);
}
LKFTEST_F(LkfTest, WhenCheckingIsSimulationThenTrueReturnedOnlyForSimulationId) {
unsigned short lkfSimulationIds[2] = {
ILKF_1x8x8_DESK_DEVICE_F0_ID,
0, // default, non-simulation
};
NEO::MockDevice *mockDevice = nullptr;
for (auto id : lkfSimulationIds) {
mockDevice = createWithUsDeviceId(id);
ASSERT_NE(mockDevice, nullptr);
if (id == 0)
EXPECT_FALSE(mockDevice->isSimulation());
else
EXPECT_TRUE(mockDevice->isSimulation());
delete mockDevice;
}
}

View File

@ -6,31 +6,13 @@
*/
#include "shared/source/gen12lp/hw_cmds_adlp.h"
#include "shared/test/common/fixtures/device_fixture.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
using namespace NEO;
using AdlpUsDeviceIdTest = Test<ClDeviceFixture>;
ADLPTEST_F(AdlpUsDeviceIdTest, GivenNonZeroIdThenIsSimulationIsTrue) {
unsigned short simulationIds[] = {
0, // default, non-simulation
};
for (auto id : simulationIds) {
auto mockDevice = std::unique_ptr<MockDevice>(createWithUsDeviceId(id));
ASSERT_NE(mockDevice.get(), nullptr);
if (id == 0) {
EXPECT_FALSE(mockDevice->isSimulation());
} else {
EXPECT_TRUE(mockDevice->isSimulation());
}
}
}
using AdlpUsDeviceIdTest = Test<DeviceFixture>;
ADLPTEST_F(AdlpUsDeviceIdTest, givenADLPWhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);

View File

@ -15,21 +15,6 @@ using namespace NEO;
using AdlsUsDeviceIdTest = Test<ClDeviceFixture>;
ADLSTEST_F(AdlsUsDeviceIdTest, WhenCheckingIsSimulationThenTrueReturnedOnlyForSimulationId) {
unsigned short adlsSimulationIds[1] = {
0, // default, non-simulation
};
NEO::MockDevice *mockDevice = nullptr;
for (auto id : adlsSimulationIds) {
mockDevice = createWithUsDeviceId(id);
ASSERT_NE(mockDevice, nullptr);
EXPECT_FALSE(mockDevice->isSimulation());
delete mockDevice;
}
}
ADLSTEST_F(AdlsUsDeviceIdTest, givenAdlsWhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
}

View File

@ -113,31 +113,10 @@ GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpDeviceWhenCheckingPipesSupportThenF
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsPipes);
}
using TglLpUsDeviceIdTest = Test<ClDeviceFixture>;
HWTEST2_F(TglLpUsDeviceIdTest, WhenCheckingSimulationCapThenResultIsCorrect, IsTGLLP) {
unsigned short tglLpSimulationIds[2] = {
0xFF20,
0, // default, non-simulation
};
NEO::MockDevice *mockDevice = nullptr;
for (auto id : tglLpSimulationIds) {
mockDevice = createWithUsDeviceId(id);
ASSERT_NE(mockDevice, nullptr);
if (id == 0)
EXPECT_FALSE(mockDevice->isSimulation());
else
EXPECT_TRUE(mockDevice->isSimulation());
delete mockDevice;
}
}
HWTEST2_F(TglLpUsDeviceIdTest, GivenTGLLPWhenCheckftr64KBpagesThenTrue, IsTGLLP) {
HWTEST2_F(Gen12LpDeviceCaps, GivenTGLLPWhenCheckftr64KBpagesThenTrue, IsTGLLP) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
}
HWTEST2_F(TglLpUsDeviceIdTest, givenGen12lpWhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue, IsTGLLP) {
HWTEST2_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue, IsTGLLP) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
}

View File

@ -44,25 +44,3 @@ BXTTEST_F(BxtDeviceCaps, WhenCheckftr64KBpagesThenFalse) {
BXTTEST_F(BxtDeviceCaps, WhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
}
typedef Test<ClDeviceFixture> BxtUsDeviceIdTest;
BXTTEST_F(BxtUsDeviceIdTest, WhenCheckingIsSimulationThenTrueReturnedOnlyForSimulationId) {
unsigned short bxtSimulationIds[3] = {
0x9906,
0x9907,
0, // default, non-simulation
};
NEO::MockDevice *mockDevice = nullptr;
for (auto id : bxtSimulationIds) {
mockDevice = createWithUsDeviceId(id);
ASSERT_NE(mockDevice, nullptr);
if (id == 0)
EXPECT_FALSE(mockDevice->isSimulation());
else
EXPECT_TRUE(mockDevice->isSimulation());
delete mockDevice;
}
}

View File

@ -6,25 +6,24 @@
*/
#include "shared/source/gen9/hw_cmds_glk.h"
#include "shared/test/common/fixtures/device_fixture.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
using namespace NEO;
typedef Test<ClDeviceFixture> Gen9DeviceCaps;
using GlkDeviceCaps = Test<DeviceFixture>;
GLKTEST_F(Gen9DeviceCaps, WhenCheckingProfilingTimerResolutionThenCorrectResolutionIsReturned) {
GLKTEST_F(GlkDeviceCaps, WhenCheckingProfilingTimerResolutionThenCorrectResolutionIsReturned) {
const auto &caps = pDevice->getDeviceInfo();
EXPECT_EQ(52u, caps.outProfilingTimerResolution);
}
GLKTEST_F(Gen9DeviceCaps, givenGlkDeviceWhenAskedForDoubleSupportThenTrueIsReturned) {
GLKTEST_F(GlkDeviceCaps, givenGlkDeviceWhenAskedForDoubleSupportThenTrueIsReturned) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsFP64);
}
GLKTEST_F(Gen9DeviceCaps, GlkIs32BitOsAllocatorAvailable) {
GLKTEST_F(GlkDeviceCaps, GlkIs32BitOsAllocatorAvailable) {
const auto &caps = pDevice->getDeviceInfo();
auto memoryManager = pDevice->getMemoryManager();
if constexpr (is64bit) {
@ -36,27 +35,10 @@ GLKTEST_F(Gen9DeviceCaps, GlkIs32BitOsAllocatorAvailable) {
}
}
typedef Test<ClDeviceFixture> GlkUsDeviceIdTest;
GLKTEST_F(GlkUsDeviceIdTest, WhenCheckingIsSimulationThenTrueReturnedOnlyForSimulationId) {
unsigned short glkSimulationIds[3] = {
0x3184,
0x3185,
0, // default, non-simulation
};
NEO::MockDevice *mockDevice = nullptr;
for (auto id : glkSimulationIds) {
mockDevice = createWithUsDeviceId(id);
ASSERT_NE(mockDevice, nullptr);
EXPECT_FALSE(mockDevice->isSimulation());
delete mockDevice;
}
}
GLKTEST_F(GlkUsDeviceIdTest, GivenGLKWhenCheckftr64KBpagesThenFalse) {
GLKTEST_F(GlkDeviceCaps, GivenGLKWhenCheckftr64KBpagesThenFalse) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
}
GLKTEST_F(GlkUsDeviceIdTest, givenGlkWhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
GLKTEST_F(GlkDeviceCaps, givenGlkWhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
}

View File

@ -35,35 +35,10 @@ SKLTEST_F(SklDeviceCaps, WhenCheckingCapabilitiesThenSvmIsEnabled) {
EXPECT_EQ(expectedCaps, caps.svmCapabilities);
}
typedef Test<ClDeviceFixture> SklUsDeviceIdTest;
SKLTEST_F(SklUsDeviceIdTest, WhenCheckingIsSimulationThenTrueReturnedOnlyForSimulationId) {
unsigned short sklSimulationIds[6] = {
0x0900,
0x0901,
0x0902,
0x0903,
0x0904,
0, // default, non-simulation
};
NEO::MockDevice *mockDevice = nullptr;
for (auto id : sklSimulationIds) {
mockDevice = createWithUsDeviceId(id);
ASSERT_NE(mockDevice, nullptr);
if (id == 0)
EXPECT_FALSE(mockDevice->isSimulation());
else
EXPECT_TRUE(mockDevice->isSimulation());
delete mockDevice;
}
}
SKLTEST_F(SklUsDeviceIdTest, GivenSKLWhenCheckftr64KBpagesThenTrue) {
SKLTEST_F(SklDeviceCaps, GivenSKLWhenCheckftr64KBpagesThenTrue) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
}
SKLTEST_F(SklUsDeviceIdTest, givenSklWhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue) {
SKLTEST_F(SklDeviceCaps, givenSklWhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
}

View File

@ -24,10 +24,6 @@ XEHPTEST_F(XeHPUsDeviceIdTest, givenXeHPWhenCheckftr64KBpagesThenTrue) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
}
XEHPTEST_F(XeHPUsDeviceIdTest, WheCheckingIsSimulationThenFalseIsReturned) {
EXPECT_FALSE(pDevice->isSimulation());
}
XEHPTEST_F(XeHPUsDeviceIdTest, givenXeHPSkusThenItSupportCorrectlyRoundedDivSqrtBit) {
EXPECT_TRUE(pClDevice->getHardwareInfo().capabilityTable.ftrSupports64BitMath);
cl_device_fp_config actual = pClDevice->getDeviceInfo().singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT;