Move API agnotic gen8 tests to shared
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
parent
38ace23f72
commit
eb9746987e
|
@ -6,10 +6,11 @@
|
|||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
|
||||
#include "opencl/test/unit_test/command_queue/enqueue_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/hello_world_fixture.h"
|
||||
#include "opencl/test/unit_test/helpers/cl_hw_parse.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
|
@ -57,7 +58,7 @@ struct MediaKernelFixture : public HelloWorldFixture<FactoryType>,
|
|||
}
|
||||
|
||||
void SetUp() override {
|
||||
skipVmeTest = !platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.supportsVme;
|
||||
skipVmeTest = !defaultHwInfo->capabilityTable.supportsVme;
|
||||
if (skipVmeTest) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
|
|
@ -7,17 +7,14 @@
|
|||
if(TESTS_GEN8)
|
||||
set(IGDRCL_SRCS_tests_gen8
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/coherency_tests_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_hw_tests_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cl_hw_helper_tests_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/enqueue_media_kernel_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/image_tests_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_tests_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sampler_tests_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cl_device_caps_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_platform_caps_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_preemption_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_sample_gen8.cpp
|
||||
)
|
||||
|
||||
get_property(NEO_CORE_TESTS_GEN8 GLOBAL PROPERTY NEO_CORE_TESTS_GEN8)
|
||||
|
|
|
@ -1,16 +1,10 @@
|
|||
#
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(TESTS_BDW)
|
||||
set(IGDRCL_SRCS_tests_gen8_bdw
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_bdw.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_bdw.cpp
|
||||
)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen8_bdw})
|
||||
add_subdirectories()
|
||||
neo_copy_test_files_with_revision(copy_test_files_bdw_0 bdw 0)
|
||||
add_dependencies(copy_test_files_per_product copy_test_files_bdw_0)
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/hw_helper.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> BdwDeviceCaps;
|
||||
|
||||
BDWTEST_F(BdwDeviceCaps, WhenCheckingExtensionStringThenFp64IsSupported) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
std::string extensionString = caps.deviceExtensions;
|
||||
|
||||
EXPECT_NE(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
|
||||
EXPECT_NE(0u, caps.doubleFpConfig);
|
||||
}
|
||||
|
||||
BDWTEST_F(BdwDeviceCaps, WhenGettingDeviceInfoThenCorrectlyRoundedDivideSqrtIsEnabled) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
EXPECT_NE(0u, caps.singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);
|
||||
}
|
||||
|
||||
BDWTEST_F(BdwDeviceCaps, GivenDefaultWhenCheckingPreemptionModeThenDisabledIsReported) {
|
||||
EXPECT_TRUE(PreemptionMode::Disabled == pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
|
||||
}
|
||||
|
||||
BDWTEST_F(BdwDeviceCaps, BdwProfilingTimerResolution) {
|
||||
const auto &caps = pDevice->getDeviceInfo();
|
||||
EXPECT_EQ(80u, caps.outProfilingTimerResolution);
|
||||
}
|
||||
|
||||
BDWTEST_F(BdwDeviceCaps, givenHwInfoWhenRequestedComputeUnitsUsedForScratchThenReturnValidValue) {
|
||||
const auto &hwInfo = pDevice->getHardwareInfo();
|
||||
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
|
||||
uint32_t expectedValue = hwInfo.gtSystemInfo.MaxSubSlicesSupported * hwInfo.gtSystemInfo.MaxEuPerSubSlice *
|
||||
hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount;
|
||||
|
||||
EXPECT_EQ(expectedValue, hwHelper.getComputeUnitsUsedForScratch(&hwInfo));
|
||||
EXPECT_EQ(expectedValue, pDevice->getDeviceInfo().computeUnitsUsedForScratch);
|
||||
}
|
||||
|
||||
BDWTEST_F(BdwDeviceCaps, givenHwInfoWhenRequestedMaxFrontEndThreadsThenReturnValidValue) {
|
||||
const auto &hwInfo = pDevice->getHardwareInfo();
|
||||
|
||||
EXPECT_EQ(HwHelper::getMaxThreadsForVfe(hwInfo), pDevice->getDeviceInfo().maxFrontEndThreads);
|
||||
}
|
||||
|
||||
typedef Test<ClDeviceFixture> BdwUsDeviceIdTest;
|
||||
|
||||
BDWTEST_F(BdwUsDeviceIdTest, WhenCheckingIsSimulationThenTrueReturnedOnlyForSimulationId) {
|
||||
unsigned short bdwSimulationIds[6] = {
|
||||
0x0BD0,
|
||||
0x0BD1,
|
||||
0x0BD2,
|
||||
0x0BD3,
|
||||
0x0BD4,
|
||||
0, // default, non-simulation
|
||||
};
|
||||
NEO::MockDevice *mockDevice = nullptr;
|
||||
|
||||
for (auto id : bdwSimulationIds) {
|
||||
mockDevice = createWithUsDeviceId(id);
|
||||
ASSERT_NE(mockDevice, nullptr);
|
||||
|
||||
if (id == 0)
|
||||
EXPECT_FALSE(mockDevice->isSimulation());
|
||||
else
|
||||
EXPECT_TRUE(mockDevice->isSimulation());
|
||||
delete mockDevice;
|
||||
}
|
||||
}
|
||||
|
||||
BDWTEST_F(BdwUsDeviceIdTest, GivenBdwWhenCheckftr64KBpagesThenFalse) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_tests_gen8_bdw_windows
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_bdw_windows.cpp
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen8_bdw_windows})
|
||||
endif()
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/hw_helper.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> BdwDeviceCaps;
|
||||
|
||||
BDWTEST_F(BdwDeviceCaps, WhenCheckingKmdNotifyPropertiesThenKmdNotifyIsEnabledCorrectly) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(50000, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
|
||||
EXPECT_EQ(5000, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits);
|
||||
EXPECT_EQ(200000, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds);
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "opencl/source/helpers/cl_hw_helper.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_hw_helper.h"
|
||||
|
||||
using namespace NEO;
|
||||
using ClHwHelperTestGen8 = ::testing::Test;
|
||||
|
||||
GEN8TEST_F(ClHwHelperTestGen8, WhenGettingDeviceIpVersionThenMakeCorrectDeviceIpVersion) {
|
||||
EXPECT_EQ(ClHwHelperMock::makeDeviceIpVersion(8, 0, 0), ClHwHelper::get(renderCoreFamily).getDeviceIpVersion(*defaultHwInfo));
|
||||
}
|
||||
|
||||
GEN8TEST_F(ClHwHelperTestGen8, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) {
|
||||
EXPECT_EQ(0u, ClHwHelper::get(renderCoreFamily).getSupportedDeviceFeatureCapabilities());
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using Gen8ClDeviceCaps = Test<ClDeviceFixture>;
|
||||
|
||||
GEN8TEST_F(Gen8ClDeviceCaps, WhenCheckingExtensionStringThenFp64IsSupported) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
std::string extensionString = caps.deviceExtensions;
|
||||
|
||||
EXPECT_NE(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
|
||||
EXPECT_NE(0u, caps.doubleFpConfig);
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8ClDeviceCaps, WhenGettingDeviceInfoThenCorrectlyRoundedDivideSqrtIsEnabled) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
EXPECT_NE(0u, caps.singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8ClDeviceCaps, givenGen8WhenCheckExtensionsThenDeviceProperlyReportsClKhrSubgroupsExtension) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
if (pClDevice->areOcl21FeaturesEnabled()) {
|
||||
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups")));
|
||||
} else {
|
||||
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(testing::HasSubstr(std::string("cl_khr_subgroups"))));
|
||||
}
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8ClDeviceCaps, givenGen8WhenCheckingCapsThenDeviceDoesProperlyReportsIndependentForwardProgress) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
|
||||
if (pClDevice->areOcl21FeaturesEnabled()) {
|
||||
EXPECT_TRUE(caps.independentForwardProgress != 0);
|
||||
} else {
|
||||
EXPECT_FALSE(caps.independentForwardProgress != 0);
|
||||
}
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8ClDeviceCaps, WhenCheckingImage3dDimensionsThenCapsAreSetCorrectly) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
EXPECT_EQ(2048u, caps.image3DMaxWidth);
|
||||
EXPECT_EQ(2048u, caps.image3DMaxHeight);
|
||||
}
|
|
@ -11,17 +11,9 @@
|
|||
|
||||
using namespace NEO;
|
||||
|
||||
struct Gen8PlatformCaps : public PlatformFixture, public ::testing::Test {
|
||||
void SetUp() override {
|
||||
PlatformFixture::SetUp();
|
||||
}
|
||||
using Gen8PlatformCaps = Test<PlatformFixture>;
|
||||
|
||||
void TearDown() override {
|
||||
PlatformFixture::TearDown();
|
||||
}
|
||||
};
|
||||
|
||||
BDWTEST_F(Gen8PlatformCaps, WhenCheckingExtensionStringThenFp64IsSupported) {
|
||||
GEN8TEST_F(Gen8PlatformCaps, WhenCheckingExtensionStringThenFp64IsSupported) {
|
||||
const auto &caps = pPlatform->getPlatformInfo();
|
||||
|
||||
EXPECT_NE(std::string::npos, caps.extensions.find(std::string("cl_khr_fp64")));
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_tests_gen8_windows
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gmm_callbacks_tests_gen8.cpp
|
||||
)
|
||||
if(WIN32)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen8_windows})
|
||||
endif()
|
|
@ -5,5 +5,13 @@
|
|||
#
|
||||
|
||||
if(TESTS_GEN8)
|
||||
target_sources(neo_shared_tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/coherency_tests_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sampler_tests_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_gen8.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_sample_gen8.cpp
|
||||
)
|
||||
add_subdirectories()
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(TESTS_BDW)
|
||||
target_sources(neo_shared_tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_bdw.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_bdw.cpp
|
||||
)
|
||||
add_subdirectories()
|
||||
endif()
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
using BdwUsDeviceIdTest = ::testing::Test;
|
||||
|
||||
BDWTEST_F(BdwUsDeviceIdTest, WhenCheckingIsSimulationThenTrueReturnedOnlyForSimulationId) {
|
||||
unsigned short bdwSimulationIds[6] = {
|
||||
0x0BD0,
|
||||
0x0BD1,
|
||||
0x0BD2,
|
||||
0x0BD3,
|
||||
0x0BD4,
|
||||
0, // default, non-simulation
|
||||
};
|
||||
|
||||
for (auto &id : bdwSimulationIds) {
|
||||
auto hardwareInfo = *defaultHwInfo;
|
||||
hardwareInfo.platform.usDeviceID = id;
|
||||
std::unique_ptr<MockDevice> mockDevice(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hardwareInfo, 0u /*rootDeviceIndex*/));
|
||||
ASSERT_NE(mockDevice.get(), nullptr);
|
||||
|
||||
if (id == 0)
|
||||
EXPECT_FALSE(mockDevice->isSimulation());
|
||||
else
|
||||
EXPECT_TRUE(mockDevice->isSimulation());
|
||||
}
|
||||
}
|
|
@ -9,17 +9,15 @@
|
|||
#include "shared/source/execution_environment/execution_environment.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/dispatch_flags_helper.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "opencl/source/platform/platform.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
typedef ::testing::Test Gen8CoherencyRequirements;
|
||||
using Gen8CoherencyRequirements = ::testing::Test;
|
||||
|
||||
GEN8TEST_F(Gen8CoherencyRequirements, WhenMemoryManagerIsInitializedThenNoCoherencyProgramming) {
|
||||
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
executionEnvironment->initializeMemoryManager();
|
||||
CommandStreamReceiverHw<BDWFamily> csr(*executionEnvironment, 0, 1);
|
||||
LinearStream stream;
|
|
@ -10,10 +10,6 @@
|
|||
#include "shared/test/common/helpers/hw_helper_tests.h"
|
||||
#include "shared/test/unit_test/helpers/get_gpgpu_engines_tests.inl"
|
||||
|
||||
#include "opencl/source/helpers/cl_hw_helper.h"
|
||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_hw_helper.h"
|
||||
|
||||
using HwHelperTestGen8 = HwHelperTest;
|
||||
|
||||
GEN8TEST_F(HwHelperTestGen8, WhenGettingMaxBarriersPerSliceThenCorrectSizeIsReturned) {
|
||||
|
@ -39,14 +35,6 @@ GEN8TEST_F(HwHelperTestGen8, whenGetGpgpuEnginesThenReturnThreeEngines) {
|
|||
EXPECT_EQ(3u, pDevice->allEngines.size());
|
||||
}
|
||||
|
||||
GEN8TEST_F(HwHelperTestGen8, WhenGettingDeviceIpVersionThenMakeCorrectDeviceIpVersion) {
|
||||
EXPECT_EQ(ClHwHelperMock::makeDeviceIpVersion(8, 0, 0), ClHwHelper::get(renderCoreFamily).getDeviceIpVersion(*defaultHwInfo));
|
||||
}
|
||||
|
||||
GEN8TEST_F(HwHelperTestGen8, WhenGettingSupportedDeviceFeatureCapabilitiesThenReturnCorrectValue) {
|
||||
EXPECT_EQ(0u, ClHwHelper::get(renderCoreFamily).getSupportedDeviceFeatureCapabilities());
|
||||
}
|
||||
|
||||
using MemorySynchronizatiopCommandsTestsGen8 = ::testing::Test;
|
||||
GEN8TEST_F(MemorySynchronizatiopCommandsTestsGen8, WhenProgrammingCacheFlushThenExpectConstantCacheFieldSet) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
|
@ -6,15 +6,14 @@
|
|||
*/
|
||||
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> Gen8SamplerTest;
|
||||
using Gen8SamplerTest = ::testing::Test;
|
||||
|
||||
GEN8TEST_F(Gen8SamplerTest, WhenAppendingSamplerStateParamsThenStateIsNotChanged) {
|
||||
typedef typename FamilyType::SAMPLER_STATE SAMPLER_STATE;
|
|
@ -6,35 +6,45 @@
|
|||
*/
|
||||
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.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> Gen8DeviceCaps;
|
||||
using Gen8DeviceCaps = Test<DeviceFixture>;
|
||||
|
||||
GEN8TEST_F(Gen8DeviceCaps, GivenDefaultSettingsWhenCheckingPreemptionModeThenPreemptionIsDisabled) {
|
||||
GEN8TEST_F(Gen8DeviceCaps, GivenDefaultWhenCheckingPreemptionModeThenDisabledIsReported) {
|
||||
EXPECT_TRUE(PreemptionMode::Disabled == pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckExtensionsThenDeviceProperlyReportsClKhrSubgroupsExtension) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
if (pClDevice->areOcl21FeaturesEnabled()) {
|
||||
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups")));
|
||||
} else {
|
||||
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(testing::HasSubstr(std::string("cl_khr_subgroups"))));
|
||||
}
|
||||
GEN8TEST_F(Gen8DeviceCaps, BdwProfilingTimerResolution) {
|
||||
const auto &caps = pDevice->getDeviceInfo();
|
||||
EXPECT_EQ(80u, caps.outProfilingTimerResolution);
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingCapsThenDeviceDoesProperlyReportsIndependentForwardProgress) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
GEN8TEST_F(Gen8DeviceCaps, givenHwInfoWhenRequestedComputeUnitsUsedForScratchThenReturnValidValue) {
|
||||
const auto &hwInfo = pDevice->getHardwareInfo();
|
||||
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
|
||||
if (pClDevice->areOcl21FeaturesEnabled()) {
|
||||
EXPECT_TRUE(caps.independentForwardProgress != 0);
|
||||
} else {
|
||||
EXPECT_FALSE(caps.independentForwardProgress != 0);
|
||||
}
|
||||
uint32_t expectedValue = hwInfo.gtSystemInfo.MaxSubSlicesSupported * hwInfo.gtSystemInfo.MaxEuPerSubSlice *
|
||||
hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount;
|
||||
|
||||
EXPECT_EQ(expectedValue, hwHelper.getComputeUnitsUsedForScratch(&hwInfo));
|
||||
EXPECT_EQ(expectedValue, pDevice->getDeviceInfo().computeUnitsUsedForScratch);
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8DeviceCaps, givenHwInfoWhenRequestedMaxFrontEndThreadsThenReturnValidValue) {
|
||||
const auto &hwInfo = pDevice->getHardwareInfo();
|
||||
|
||||
EXPECT_EQ(HwHelper::getMaxThreadsForVfe(hwInfo), pDevice->getDeviceInfo().maxFrontEndThreads);
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8DeviceCaps, GivenBdwWhenCheckftr64KBpagesThenFalse) {
|
||||
EXPECT_FALSE(defaultHwInfo->capabilityTable.ftr64KBpages);
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8DeviceCaps, GivenDefaultSettingsWhenCheckingPreemptionModeThenPreemptionIsDisabled) {
|
||||
EXPECT_TRUE(PreemptionMode::Disabled == pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8DeviceCaps, WhenCheckingKmdNotifyMechanismThenPropertiesAreSetCorrectly) {
|
||||
|
@ -54,11 +64,8 @@ GEN8TEST_F(Gen8DeviceCaps, WhenCheckingCompressionThenItIsDisabled) {
|
|||
}
|
||||
|
||||
GEN8TEST_F(Gen8DeviceCaps, WhenCheckingImage3dDimensionsThenCapsAreSetCorrectly) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
const auto &sharedCaps = pDevice->getDeviceInfo();
|
||||
EXPECT_EQ(2048u, caps.image3DMaxWidth);
|
||||
EXPECT_EQ(2048u, sharedCaps.image3DMaxDepth);
|
||||
EXPECT_EQ(2048u, caps.image3DMaxHeight);
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8DeviceCaps, givenHwInfoWhenSlmSizeIsRequiredThenReturnCorrectValue) {
|
||||
|
@ -86,4 +93,4 @@ GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingMediaBlockSupportThenReturnTrue)
|
|||
}
|
||||
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingDeviceEnqueueSupportThenReturnFalse) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsDeviceEnqueue);
|
||||
}
|
||||
}
|
|
@ -5,20 +5,19 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/helpers/default_hw_info.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> BroadwellOnlyTest;
|
||||
using BroadwellOnlyTest = ::testing::Test;
|
||||
|
||||
BDWTEST_F(BroadwellOnlyTest, WhenGettingProductFamilyThenBroadwellIsReturned) {
|
||||
EXPECT_EQ(IGFX_BROADWELL, pDevice->getHardwareInfo().platform.eProductFamily);
|
||||
EXPECT_EQ(IGFX_BROADWELL, defaultHwInfo->platform.eProductFamily);
|
||||
}
|
||||
|
||||
typedef Test<ClDeviceFixture> Gen8OnlyTest;
|
||||
using Gen8OnlyTest = ::testing::Test;
|
||||
|
||||
GEN8TEST_F(Gen8OnlyTest, WhenGettingRenderCoreFamilyThenGen8CoreIsReturned) {
|
||||
EXPECT_EQ(IGFX_GEN8_CORE, pDevice->getRenderCoreFamily());
|
||||
EXPECT_EQ(IGFX_GEN8_CORE, defaultHwInfo->platform.eRenderCoreFamily);
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(WIN32)
|
||||
target_sources(neo_shared_tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gmm_callbacks_tests_gen8.cpp
|
||||
)
|
||||
endif()
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
using namespace NEO;
|
||||
|
||||
typedef ::testing::Test Gen8GmmCallbacksTests;
|
||||
using Gen8GmmCallbacksTests = ::testing::Test;
|
||||
|
||||
GEN8TEST_F(Gen8GmmCallbacksTests, GivenDefaultWhenNotifyingAubCaptureThenDeviceCallbackIsNotSupported) {
|
||||
EXPECT_EQ(0, DeviceCallbacks<FamilyType>::notifyAubCapture(nullptr, 0, 0, false));
|
Loading…
Reference in New Issue