Use correct macros for enabling tests

Change-Id: I51f51464918a487001200337b97a542ab4e65f1a
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe 2019-12-18 11:06:41 +01:00 committed by sys_ocldev
parent 8a059e636a
commit ff30a66624
12 changed files with 154 additions and 149 deletions

View File

@ -9,5 +9,5 @@ set(NEO_CORE_DEBUG_SETTINGS_TESTS
${CMAKE_CURRENT_SOURCE_DIR}/debug_settings_manager_fixture.h
${CMAKE_CURRENT_SOURCE_DIR}/debug_settings_manager_tests.cpp
)
set_property(GLOBAL PROPERTY NEO_CORE_DEBUG_SETTINGS_TESTS ${NEO_CORE_DEBUG_SETTINGS_TESTS})

View File

@ -596,7 +596,7 @@ extern GFXCORE_FAMILY renderCoreFamily;
IGFX_GEN9_CORE, \
IGFX_COFFEELAKE)
#endif
#ifdef TESTS_GEN11
#ifdef TESTS_ICLLP
#define ICLLPTEST_F(test_fixture, test_name) \
FAMILYTEST_TEST_(test_fixture, test_name, test_fixture, \
::testing::internal::GetTypeId<test_fixture>(), \
@ -605,6 +605,8 @@ extern GFXCORE_FAMILY renderCoreFamily;
FAMILYTEST_TEST_P(test_suite_name, test_name, \
IGFX_GEN11_CORE, \
IGFX_ICELAKE_LP)
#endif
#ifdef TESTS_LKF
#define LKFTEST_F(test_fixture, test_name) \
FAMILYTEST_TEST_(test_fixture, test_name, test_fixture, \
::testing::internal::GetTypeId<test_fixture>(), \
@ -613,6 +615,8 @@ extern GFXCORE_FAMILY renderCoreFamily;
FAMILYTEST_TEST_P(test_suite_name, test_name, \
IGFX_GEN11_CORE, \
IGFX_LAKEFIELD)
#endif
#ifdef TESTS_EHL
#define EHLTEST_F(test_fixture, test_name) \
FAMILYTEST_TEST_(test_fixture, test_name, test_fixture, \
::testing::internal::GetTypeId<test_fixture>(), \
@ -622,7 +626,7 @@ extern GFXCORE_FAMILY renderCoreFamily;
IGFX_GEN11_CORE, \
IGFX_ELKHARTLAKE)
#endif
#ifdef TESTS_GEN12LP
#ifdef TESTS_TGLLP
#define TGLLPTEST_F(test_fixture, test_name) \
FAMILYTEST_TEST_(test_fixture, test_name, test_fixture, \
::testing::internal::GetTypeId<test_fixture>(), \

View File

@ -14,7 +14,6 @@ if(TESTS_GEN11)
${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests_gen11.cpp
${CMAKE_CURRENT_SOURCE_DIR}/image_tests_gen11.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel_tests_gen11.cpp
${CMAKE_CURRENT_SOURCE_DIR}/program_media_sampler_tests_gen11.cpp
${CMAKE_CURRENT_SOURCE_DIR}/sampler_tests_gen11.cpp
${CMAKE_CURRENT_SOURCE_DIR}/scheduler_source_tests_gen11.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tbx_command_stream_receiver_tests_gen11.cpp

View File

@ -153,50 +153,3 @@ GEN11TEST_F(MediaKernelTest, givenGen11CsrWhenEnqueueNonVmeKernelAfterVmeKernelT
EXPECT_TRUE(pCmd->getMediaSamplerDopClockGateEnable());
EXPECT_EQ(0u, pCmd->getMediaSamplerPowerClockGateDisable());
}
ICLLPTEST_F(MediaKernelTest, givenIcllpDefaultLastVmeSubsliceConfigIsFalse) {
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
EXPECT_FALSE(csr->lastVmeSubslicesConfig);
}
ICLLPTEST_F(MediaKernelTest, givenIcllpCSRWhenEnqueueVmeKernelThenVmeSubslicesConfigChangesToTrue) {
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
enqueueVmeKernel<FamilyType>();
EXPECT_TRUE(csr->lastVmeSubslicesConfig);
}
ICLLPTEST_F(MediaKernelTest, givenIcllpCSRWhenEnqueueRegularKernelAfterVmeKernelThenVmeSubslicesConfigChangesToFalse) {
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
enqueueVmeKernel<FamilyType>();
enqueueRegularKernel<FamilyType>();
EXPECT_FALSE(csr->lastVmeSubslicesConfig);
}
ICLLPTEST_F(MediaKernelTest, givenIcllpCSRWhenEnqueueRegularKernelThenVmeSubslicesConfigDoesntChangeToTrue) {
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
enqueueRegularKernel<FamilyType>();
EXPECT_FALSE(csr->lastVmeSubslicesConfig);
}
ICLLPTEST_F(MediaKernelTest, givenIcllpCSRWhenEnqueueRegularKernelAfterRegularKernelThenVmeSubslicesConfigDoesntChangeToTrue) {
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
enqueueRegularKernel<FamilyType>();
enqueueRegularKernel<FamilyType>();
EXPECT_FALSE(csr->lastVmeSubslicesConfig);
}
ICLLPTEST_F(MediaKernelTest, givenIcllpCSRWhenEnqueueVmeKernelAfterRegularKernelThenVmeSubslicesConfigChangesToTrue) {
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
enqueueRegularKernel<FamilyType>();
enqueueVmeKernel<FamilyType>();
EXPECT_TRUE(csr->lastVmeSubslicesConfig);
}
ICLLPTEST_F(MediaKernelTest, icllpCmdSizeForVme) {
typedef typename FamilyType::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM;
typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL;
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
size_t programVmeCmdSize = sizeof(MI_LOAD_REGISTER_IMM) + 2 * sizeof(PIPE_CONTROL);
EXPECT_EQ(0u, csr->getCmdSizeForMediaSampler(false));
EXPECT_EQ(programVmeCmdSize, csr->getCmdSizeForMediaSampler(true));
}

View File

@ -9,6 +9,8 @@ if(TESTS_ICLLP)
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_icllp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_icllp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_media_kernel_icllp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_program_media_sampler_icllp.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen11_icllp})
add_subdirectories()

View File

@ -19,3 +19,43 @@ ICLLPTEST_F(IcllpTest, givenIcllpWhenSlmSizeIsRequiredThenReturnCorrectValue) {
ICLLPTEST_F(IcllpTest, givenIclLpWhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
}
ICLLPTEST_F(IcllpTest, shouldPassOnIcllp) {
EXPECT_EQ(IGFX_ICELAKE_LP, pDevice->getHardwareInfo().platform.eProductFamily);
}
ICLLPTEST_F(IcllpTest, lpSkusDontSupportFP64) {
const auto &caps = pDevice->getDeviceInfo();
std::string extensionString = caps.deviceExtensions;
EXPECT_EQ(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
EXPECT_EQ(0u, caps.doubleFpConfig);
}
ICLLPTEST_F(IcllpTest, lpSkusDontSupportCorrectlyRoundedDivideSqrt) {
const auto &caps = pDevice->getDeviceInfo();
EXPECT_EQ(0u, caps.singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);
}
ICLLPTEST_F(IcllpTest, isSimulationCap) {
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

@ -0,0 +1,61 @@
/*
* Copyright (C) 2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "core/helpers/preamble.h"
#include "runtime/helpers/pipeline_select_helper.h"
#include "test.h"
#include "unit_tests/fixtures/media_kernel_fixture.h"
using namespace NEO;
typedef MediaKernelFixture<HelloWorldFixtureFactory> MediaKernelTest;
ICLLPTEST_F(MediaKernelTest, givenIcllpDefaultLastVmeSubsliceConfigIsFalse) {
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
EXPECT_FALSE(csr->lastVmeSubslicesConfig);
}
ICLLPTEST_F(MediaKernelTest, givenIcllpCSRWhenEnqueueVmeKernelThenVmeSubslicesConfigChangesToTrue) {
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
enqueueVmeKernel<FamilyType>();
EXPECT_TRUE(csr->lastVmeSubslicesConfig);
}
ICLLPTEST_F(MediaKernelTest, givenIcllpCSRWhenEnqueueRegularKernelAfterVmeKernelThenVmeSubslicesConfigChangesToFalse) {
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
enqueueVmeKernel<FamilyType>();
enqueueRegularKernel<FamilyType>();
EXPECT_FALSE(csr->lastVmeSubslicesConfig);
}
ICLLPTEST_F(MediaKernelTest, givenIcllpCSRWhenEnqueueRegularKernelThenVmeSubslicesConfigDoesntChangeToTrue) {
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
enqueueRegularKernel<FamilyType>();
EXPECT_FALSE(csr->lastVmeSubslicesConfig);
}
ICLLPTEST_F(MediaKernelTest, givenIcllpCSRWhenEnqueueRegularKernelAfterRegularKernelThenVmeSubslicesConfigDoesntChangeToTrue) {
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
enqueueRegularKernel<FamilyType>();
enqueueRegularKernel<FamilyType>();
EXPECT_FALSE(csr->lastVmeSubslicesConfig);
}
ICLLPTEST_F(MediaKernelTest, givenIcllpCSRWhenEnqueueVmeKernelAfterRegularKernelThenVmeSubslicesConfigChangesToTrue) {
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
enqueueRegularKernel<FamilyType>();
enqueueVmeKernel<FamilyType>();
EXPECT_TRUE(csr->lastVmeSubslicesConfig);
}
ICLLPTEST_F(MediaKernelTest, icllpCmdSizeForVme) {
typedef typename FamilyType::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM;
typedef typename FamilyType::PIPE_CONTROL PIPE_CONTROL;
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getGpgpuCommandStreamReceiver());
size_t programVmeCmdSize = sizeof(MI_LOAD_REGISTER_IMM) + 2 * sizeof(PIPE_CONTROL);
EXPECT_EQ(0u, csr->getCmdSizeForMediaSampler(false));
EXPECT_EQ(programVmeCmdSize, csr->getCmdSizeForMediaSampler(true));
}

View File

@ -15,3 +15,46 @@ using LkfTest = Test<DeviceFixture>;
LKFTEST_F(LkfTest, givenLkfWhenSlmSizeIsRequiredThenReturnCorrectValue) {
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
}
LKFTEST_F(LkfTest, givenLKFWhenCheckedOCLVersionThen21IsReported) {
const auto &caps = pDevice->getDeviceInfo();
EXPECT_STREQ("OpenCL 1.2 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 1.2 ", caps.clCVersion);
}
LKFTEST_F(LkfTest, givenLKFWhenCheckedSvmSupportThenNoSvmIsReported) {
const auto &caps = pDevice->getDeviceInfo();
EXPECT_EQ(caps.svmCapabilities, 0u);
}
LKFTEST_F(LkfTest, givenLkfWhenDoublePrecissionIsCheckedThenFalseIsReturned) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsFP64);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupports64BitMath);
}
LKFTEST_F(LkfTest, givenLkfWhenExtensionStringIsCheckedThenFP64IsNotReported) {
const auto &caps = pDevice->getDeviceInfo();
std::string extensionString = caps.deviceExtensions;
EXPECT_EQ(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
EXPECT_EQ(0u, caps.doubleFpConfig);
}
LKFTEST_F(LkfTest, isSimulationCap) {
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

@ -13,51 +13,6 @@ using namespace NEO;
typedef Test<DeviceFixture> Gen11DeviceCaps;
LKFTEST_F(Gen11DeviceCaps, givenLKFWhenCheckedOCLVersionThen21IsReported) {
const auto &caps = pDevice->getDeviceInfo();
EXPECT_STREQ("OpenCL 1.2 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 1.2 ", caps.clCVersion);
}
LKFTEST_F(Gen11DeviceCaps, givenLKFWhenCheckedSvmSupportThenNoSvmIsReported) {
const auto &caps = pDevice->getDeviceInfo();
EXPECT_EQ(caps.svmCapabilities, 0u);
}
LKFTEST_F(Gen11DeviceCaps, givenLkfWhenDoublePrecissionIsCheckedThenFalseIsReturned) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsFP64);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupports64BitMath);
}
LKFTEST_F(Gen11DeviceCaps, givenLkfWhenExtensionStringIsCheckedThenFP64IsNotReported) {
const auto &caps = pDevice->getDeviceInfo();
std::string extensionString = caps.deviceExtensions;
EXPECT_EQ(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
EXPECT_EQ(0u, caps.doubleFpConfig);
}
LKFTEST_F(Gen11DeviceCaps, givenLkfWhenSlmSizeIsRequiredThenReturnCorrectValue) {
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
}
ICLLPTEST_F(Gen11DeviceCaps, lpSkusDontSupportFP64) {
const auto &caps = pDevice->getDeviceInfo();
std::string extensionString = caps.deviceExtensions;
EXPECT_EQ(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
EXPECT_EQ(0u, caps.doubleFpConfig);
}
ICLLPTEST_F(Gen11DeviceCaps, lpSkusDontSupportCorrectlyRoundedDivideSqrt) {
const auto &caps = pDevice->getDeviceInfo();
EXPECT_EQ(0u, caps.singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);
}
ICLLPTEST_F(Gen11DeviceCaps, givenIclLpWhenSlmSizeIsRequiredThenReturnCorrectValue) {
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
}
GEN11TEST_F(Gen11DeviceCaps, defaultPreemptionMode) {
EXPECT_TRUE(PreemptionMode::MidThread == pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
}
@ -108,49 +63,3 @@ GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckBlitterOperationsSupportThenRetu
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingImageSupportThenReturnTrue) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsImages);
}
typedef Test<DeviceFixture> IclLpUsDeviceIdTest;
ICLLPTEST_F(IclLpUsDeviceIdTest, isSimulationCap) {
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(IclLpUsDeviceIdTest, GivenICLLPWhenCheckftr64KBpagesThenFalse) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
}
typedef Test<DeviceFixture> LkfUsDeviceIdTest;
LKFTEST_F(LkfUsDeviceIdTest, isSimulationCap) {
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

@ -21,7 +21,7 @@ struct Gen11PlatformCaps : public PlatformFixture, public ::testing::Test {
}
};
ICLLPTEST_F(Gen11PlatformCaps, lpSkusDontSupportFP64) {
GEN11TEST_F(Gen11PlatformCaps, lpSkusDontSupportFP64) {
const auto &caps = pPlatform->getPlatformInfo();
EXPECT_EQ(std::string::npos, caps.extensions.find(std::string("cl_khr_fp64")));

View File

@ -10,12 +10,6 @@
using namespace NEO;
typedef Test<DeviceFixture> IcelakeLpOnlyTest;
ICLLPTEST_F(IcelakeLpOnlyTest, shouldPassOnIcllp) {
EXPECT_EQ(IGFX_ICELAKE_LP, pDevice->getHardwareInfo().platform.eProductFamily);
}
typedef Test<DeviceFixture> Gen11OnlyTeset;
GEN11TEST_F(Gen11OnlyTeset, shouldPassOnGen11) {