Skip to content

Commit

Permalink
Remove not used isSimulation functions
Browse files Browse the repository at this point in the history
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
  • Loading branch information
JablonskiMateusz authored and Compute-Runtime-Automation committed Sep 20, 2022
1 parent 17d87a4 commit cfe51ff
Show file tree
Hide file tree
Showing 35 changed files with 15 additions and 474 deletions.
72 changes: 0 additions & 72 deletions opencl/test/unit_test/device/device_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
23 changes: 2 additions & 21 deletions opencl/test/unit_test/gen11/ehl/test_device_caps_ehl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 0 additions & 19 deletions opencl/test/unit_test/gen11/icllp/test_device_caps_icllp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
19 changes: 0 additions & 19 deletions opencl/test/unit_test/gen11/lkf/test_device_caps_lkf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
22 changes: 2 additions & 20 deletions opencl/test/unit_test/gen12lp/adlp/test_device_caps_adlp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 0 additions & 15 deletions opencl/test/unit_test/gen12lp/adls/test_device_caps_adls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
25 changes: 2 additions & 23 deletions opencl/test/unit_test/gen12lp/test_device_caps_gen12lp.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
22 changes: 0 additions & 22 deletions opencl/test/unit_test/gen9/bxt/test_device_caps_bxt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
32 changes: 7 additions & 25 deletions opencl/test/unit_test/gen9/glk/test_device_caps_glk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}
29 changes: 2 additions & 27 deletions opencl/test/unit_test/gen9/skl/test_device_caps_skl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit cfe51ff

Please sign in to comment.