ULT: Move product specific tests to shared (gen9-gen12lp)

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-10-28 13:51:20 +00:00
committed by Compute-Runtime-Automation
parent 0772d32a76
commit 0f8489b5f8
56 changed files with 490 additions and 500 deletions

View File

@ -14,7 +14,6 @@ if(TESTS_GEN12LP)
${IGDRCL_SRCS_tests_gen12lp_excludes}
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/buffer_tests_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/coherency_tests_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_hw_tests_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/enqueue_media_kernel_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/gen12lp_tests_wrapper.cpp
@ -24,11 +23,8 @@ if(TESTS_GEN12LP)
${CMAKE_CURRENT_SOURCE_DIR}/image_tests_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/kernel_tests_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/profiling_tests_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/sampler_tests_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/tbx_command_stream_receiver_tests_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/test_cl_device_caps_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/test_platform_caps_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/test_sample_gen12lp.inl
)
get_property(NEO_CORE_TESTS_GEN12LP GLOBAL PROPERTY NEO_CORE_TESTS_GEN12LP)

View File

@ -13,7 +13,6 @@ if(TESTS_ADLP)
set(IGDRCL_SRCS_tests_gen12lp_adlp
${IGDRCL_SRCS_tests_gen12lp_adlp_excludes}
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_adlp.cpp
)
get_property(NEO_CORE_TESTS_GEN12LP_ADLP GLOBAL PROPERTY NEO_CORE_TESTS_GEN12LP_ADLP)

View File

@ -1,25 +0,0 @@
/*
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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"
using namespace NEO;
using AdlpUsDeviceIdTest = Test<DeviceFixture>;
ADLPTEST_F(AdlpUsDeviceIdTest, givenADLPWhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
}
ADLPTEST_F(AdlpUsDeviceIdTest, givenAdlpWhenRequestedVmeFlagsThenReturnFalse) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsVme);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsVmeAvcTextureSampler);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsVmeAvcPreemption);
}

View File

@ -7,7 +7,6 @@
if(TESTS_ADLS)
set(IGDRCL_SRCS_tests_gen12lp_adls
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_adls.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen12lp_adls})
add_subdirectories()

View File

@ -1,26 +0,0 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen12lp/hw_cmds_adls.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 AdlsUsDeviceIdTest = Test<ClDeviceFixture>;
ADLSTEST_F(AdlsUsDeviceIdTest, givenAdlsWhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
}
ADLSTEST_F(AdlsUsDeviceIdTest, givenAdlsWhenRequestedVmeFlagsThenReturnFalse) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsVme);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsVmeAvcTextureSampler);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsVmeAvcPreemption);
}

View File

@ -1,334 +0,0 @@
/*
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/command_stream/command_stream_receiver_hw.h"
#include "shared/source/helpers/ptr_math.h"
#include "shared/test/common/cmd_parse/hw_parse.h"
#include "shared/test/common/helpers/dispatch_flags_helper.h"
#include "shared/test/common/libult/gen12lp/special_ult_helper_gen12lp.h"
#include "shared/test/common/mocks/mock_allocation_properties.h"
#include "shared/test/common/mocks/mock_device.h"
#include "shared/test/common/test_macros/test.h"
using namespace NEO;
struct Gen12LpCoherencyRequirements : public ::testing::Test {
using STATE_COMPUTE_MODE = typename Gen12LpFamily::STATE_COMPUTE_MODE;
using PIPE_CONTROL = typename Gen12LpFamily::PIPE_CONTROL;
using PIPELINE_SELECT = typename Gen12LpFamily::PIPELINE_SELECT;
struct myCsr : public CommandStreamReceiverHw<Gen12LpFamily> {
using CommandStreamReceiver::commandStream;
using CommandStreamReceiver::streamProperties;
myCsr(ExecutionEnvironment &executionEnvironment) : CommandStreamReceiverHw<Gen12LpFamily>(executionEnvironment, 0, 1){};
CsrSizeRequestFlags *getCsrRequestFlags() { return &csrSizeRequestFlags; }
};
void makeResidentSharedAlloc() {
csr->getResidencyAllocations().push_back(alloc);
}
void overrideCoherencyRequest(bool reqestChanged, bool requireCoherency, bool hasSharedHandles) {
csr->getCsrRequestFlags()->hasSharedHandles = hasSharedHandles;
flags.requiresCoherency = requireCoherency;
csr->streamProperties.stateComputeMode.isCoherencyRequired.value = requireCoherency;
csr->streamProperties.stateComputeMode.isCoherencyRequired.isDirty = reqestChanged;
if (hasSharedHandles) {
makeResidentSharedAlloc();
}
}
void SetUp() override {
device.reset(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
csr = new myCsr(*device->executionEnvironment);
device->resetCommandStreamReceiver(csr);
AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {});
alloc = device->getMemoryManager()->createGraphicsAllocationFromSharedHandle(static_cast<osHandle>(123), properties, false, false);
}
void TearDown() override {
device->getMemoryManager()->freeGraphicsMemory(alloc);
}
myCsr *csr = nullptr;
std::unique_ptr<MockDevice> device;
DispatchFlags flags = DispatchFlagsHelper::createDefaultDispatchFlags();
GraphicsAllocation *alloc = nullptr;
};
GEN12LPTEST_F(Gen12LpCoherencyRequirements, GivenNoSharedHandlesWhenGettingCmdSizeThenSizeIsCorrect) {
auto cmdsSize = sizeof(STATE_COMPUTE_MODE);
const auto &hwInfoConfig = *HwInfoConfig::get(device->getHardwareInfo().platform.eProductFamily);
if (hwInfoConfig.is3DPipelineSelectWARequired()) {
cmdsSize += 2 * sizeof(PIPELINE_SELECT);
if (SpecialUltHelperGen12lp::isPipeControlWArequired(device->getHardwareInfo().platform.eProductFamily)) {
cmdsSize += 2 * sizeof(PIPE_CONTROL);
}
}
overrideCoherencyRequest(false, false, false);
EXPECT_FALSE(csr->streamProperties.stateComputeMode.isDirty());
overrideCoherencyRequest(false, true, false);
EXPECT_FALSE(csr->streamProperties.stateComputeMode.isDirty());
overrideCoherencyRequest(true, true, false);
auto retSize = csr->getCmdSizeForComputeMode();
EXPECT_TRUE(csr->streamProperties.stateComputeMode.isDirty());
EXPECT_EQ(cmdsSize, retSize);
overrideCoherencyRequest(true, false, false);
retSize = csr->getCmdSizeForComputeMode();
EXPECT_TRUE(csr->streamProperties.stateComputeMode.isDirty());
EXPECT_EQ(cmdsSize, retSize);
}
GEN12LPTEST_F(Gen12LpCoherencyRequirements, GivenSharedHandlesWhenGettingCmdSizeThenSizeIsCorrect) {
auto cmdsSize = sizeof(STATE_COMPUTE_MODE) + sizeof(PIPE_CONTROL);
const auto &hwInfoConfig = *HwInfoConfig::get(device->getHardwareInfo().platform.eProductFamily);
if (hwInfoConfig.is3DPipelineSelectWARequired()) {
cmdsSize += 2 * sizeof(PIPELINE_SELECT);
if (SpecialUltHelperGen12lp::isPipeControlWArequired(device->getHardwareInfo().platform.eProductFamily)) {
cmdsSize += 2 * sizeof(PIPE_CONTROL);
}
}
overrideCoherencyRequest(false, false, true);
EXPECT_FALSE(csr->streamProperties.stateComputeMode.isDirty());
overrideCoherencyRequest(false, true, true);
EXPECT_FALSE(csr->streamProperties.stateComputeMode.isDirty());
overrideCoherencyRequest(true, true, true);
auto retSize = csr->getCmdSizeForComputeMode();
EXPECT_TRUE(csr->streamProperties.stateComputeMode.isDirty());
EXPECT_EQ(cmdsSize, retSize);
overrideCoherencyRequest(true, false, true);
retSize = csr->getCmdSizeForComputeMode();
EXPECT_TRUE(csr->streamProperties.stateComputeMode.isDirty());
EXPECT_EQ(cmdsSize, retSize);
}
GEN12LPTEST_F(Gen12LpCoherencyRequirements, GivenNoSharedHandlesThenCoherencyCmdValuesAreCorrect) {
auto cmdsSize = sizeof(STATE_COMPUTE_MODE);
auto cmdsSizeWABeginOffset = 0;
const auto &hwInfoConfig = *HwInfoConfig::get(device->getHardwareInfo().platform.eProductFamily);
if (hwInfoConfig.is3DPipelineSelectWARequired()) {
cmdsSizeWABeginOffset += sizeof(PIPELINE_SELECT);
cmdsSize += sizeof(PIPELINE_SELECT);
if (SpecialUltHelperGen12lp::isPipeControlWArequired(device->getHardwareInfo().platform.eProductFamily)) {
cmdsSizeWABeginOffset += sizeof(PIPE_CONTROL);
cmdsSize += sizeof(PIPE_CONTROL);
}
}
cmdsSize += cmdsSizeWABeginOffset;
char buff[1024];
LinearStream stream(buff, 1024);
auto expectedScmCmd = FamilyType::cmdInitStateComputeMode;
expectedScmCmd.setForceNonCoherent(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT);
expectedScmCmd.setMaskBits(FamilyType::stateComputeModeForceNonCoherentMask);
overrideCoherencyRequest(true, false, false);
csr->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
auto scmCmd = reinterpret_cast<char *>(stream.getCpuBase());
EXPECT_TRUE(memcmp(&expectedScmCmd, scmCmd + cmdsSizeWABeginOffset, sizeof(STATE_COMPUTE_MODE)) == 0);
auto startOffset = stream.getUsed();
overrideCoherencyRequest(true, true, false);
csr->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize * 2, stream.getUsed());
expectedScmCmd.setForceNonCoherent(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_DISABLED);
expectedScmCmd.setMaskBits(FamilyType::stateComputeModeForceNonCoherentMask);
scmCmd = reinterpret_cast<char *>(ptrOffset(stream.getCpuBase(), startOffset));
EXPECT_TRUE(memcmp(&expectedScmCmd, scmCmd + cmdsSizeWABeginOffset, sizeof(STATE_COMPUTE_MODE)) == 0);
}
GEN12LPTEST_F(Gen12LpCoherencyRequirements, GivenSharedHandlesThenCoherencyCmdValuesAreCorrect) {
auto cmdsSize = sizeof(STATE_COMPUTE_MODE) + sizeof(PIPE_CONTROL);
auto cmdsSizeWABeginOffset = 0;
const auto &hwInfoConfig = *HwInfoConfig::get(device->getHardwareInfo().platform.eProductFamily);
if (hwInfoConfig.is3DPipelineSelectWARequired()) {
cmdsSizeWABeginOffset += sizeof(PIPELINE_SELECT);
cmdsSize += sizeof(PIPELINE_SELECT);
if (SpecialUltHelperGen12lp::isPipeControlWArequired(device->getHardwareInfo().platform.eProductFamily)) {
cmdsSizeWABeginOffset += sizeof(PIPE_CONTROL);
cmdsSize += sizeof(PIPE_CONTROL);
}
}
cmdsSize += cmdsSizeWABeginOffset;
char buff[1024];
LinearStream stream(buff, 1024);
auto expectedScmCmd = FamilyType::cmdInitStateComputeMode;
expectedScmCmd.setForceNonCoherent(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT);
expectedScmCmd.setMaskBits(FamilyType::stateComputeModeForceNonCoherentMask);
auto expectedPcCmd = FamilyType::cmdInitPipeControl;
overrideCoherencyRequest(true, false, true);
csr->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize, stream.getUsed());
auto scmCmd = reinterpret_cast<char *>(stream.getCpuBase());
EXPECT_TRUE(memcmp(&expectedScmCmd, scmCmd + cmdsSizeWABeginOffset, sizeof(STATE_COMPUTE_MODE)) == 0);
auto pcCmd = reinterpret_cast<char *>(ptrOffset(stream.getCpuBase(), sizeof(STATE_COMPUTE_MODE)));
EXPECT_TRUE(memcmp(&expectedPcCmd, pcCmd + cmdsSizeWABeginOffset, sizeof(PIPE_CONTROL)) == 0);
auto startOffset = stream.getUsed();
overrideCoherencyRequest(true, true, true);
csr->programComputeMode(stream, flags, *defaultHwInfo);
EXPECT_EQ(cmdsSize * 2, stream.getUsed());
expectedScmCmd.setForceNonCoherent(STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_DISABLED);
expectedScmCmd.setMaskBits(FamilyType::stateComputeModeForceNonCoherentMask);
scmCmd = reinterpret_cast<char *>(ptrOffset(stream.getCpuBase(), startOffset));
EXPECT_TRUE(memcmp(&expectedScmCmd, scmCmd + cmdsSizeWABeginOffset, sizeof(STATE_COMPUTE_MODE)) == 0);
pcCmd = reinterpret_cast<char *>(ptrOffset(stream.getCpuBase(), startOffset + sizeof(STATE_COMPUTE_MODE)));
EXPECT_TRUE(memcmp(&expectedPcCmd, pcCmd + cmdsSizeWABeginOffset, sizeof(PIPE_CONTROL)) == 0);
}
GEN12LPTEST_F(Gen12LpCoherencyRequirements, givenCoherencyRequirementWithoutSharedHandlesWhenFlushTaskCalledThenProgramCmdOnlyIfChanged) {
auto startOffset = csr->commandStream.getUsed();
auto graphicAlloc = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize});
IndirectHeap stream(graphicAlloc);
auto flushTask = [&](bool coherencyRequired) {
flags.requiresCoherency = coherencyRequired;
startOffset = csr->commandStream.getUsed();
csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device);
};
auto findCmd = [&](bool expectToBeProgrammed, bool expectCoherent, bool expectPipeControl) {
HardwareParse hwParser;
hwParser.parseCommands<FamilyType>(csr->commandStream, startOffset);
bool foundOne = false;
STATE_COMPUTE_MODE::FORCE_NON_COHERENT expectedCoherentValue = STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT;
uint32_t expectedCoherentMask = FamilyType::stateComputeModeForceNonCoherentMask;
for (auto it = hwParser.cmdList.begin(); it != hwParser.cmdList.end(); it++) {
auto cmd = genCmdCast<STATE_COMPUTE_MODE *>(*it);
if (cmd) {
EXPECT_EQ(expectedCoherentValue, cmd->getForceNonCoherent());
EXPECT_EQ(expectedCoherentMask, cmd->getMaskBits());
EXPECT_FALSE(foundOne);
foundOne = true;
auto pc = genCmdCast<PIPE_CONTROL *>(*(++it));
if (!expectPipeControl && !SpecialUltHelperGen12lp::isPipeControlWArequired(device->getHardwareInfo().platform.eProductFamily)) {
EXPECT_EQ(nullptr, pc);
} else {
EXPECT_NE(nullptr, pc);
}
}
}
EXPECT_EQ(expectToBeProgrammed, foundOne);
};
auto hwInfo = device->getHardwareInfo();
flushTask(false);
if (MemorySynchronizationCommands<FamilyType>::isBarrierlPriorToPipelineSelectWaRequired(hwInfo)) {
findCmd(true, false, true); // first time
} else {
findCmd(true, false, false); // first time
}
flushTask(false);
findCmd(false, false, false); // not changed
csr->getMemoryManager()->freeGraphicsMemory(graphicAlloc);
}
GEN12LPTEST_F(Gen12LpCoherencyRequirements, givenSharedHandlesWhenFlushTaskCalledThenProgramPipeControlWhenNeeded) {
auto startOffset = csr->commandStream.getUsed();
auto graphicsAlloc = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize});
IndirectHeap stream(graphicsAlloc);
auto flushTask = [&](bool coherencyRequired) {
flags.requiresCoherency = coherencyRequired;
makeResidentSharedAlloc();
startOffset = csr->commandStream.getUsed();
csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device);
};
auto flushTaskAndFindCmds = [&](bool expectCoherent, bool valueChanged) {
flushTask(expectCoherent);
HardwareParse hwParser;
hwParser.parseCommands<FamilyType>(csr->commandStream, startOffset);
bool foundOne = false;
STATE_COMPUTE_MODE::FORCE_NON_COHERENT expectedCoherentValue = STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT;
uint32_t expectedCoherentMask = FamilyType::stateComputeModeForceNonCoherentMask;
for (auto it = hwParser.cmdList.begin(); it != hwParser.cmdList.end(); it++) {
auto cmd = genCmdCast<STATE_COMPUTE_MODE *>(*it);
if (cmd) {
EXPECT_EQ(expectedCoherentValue, cmd->getForceNonCoherent());
EXPECT_EQ(expectedCoherentMask, cmd->getMaskBits());
EXPECT_FALSE(foundOne);
foundOne = true;
auto pc = genCmdCast<PIPE_CONTROL *>(*(++it));
EXPECT_NE(nullptr, pc);
}
}
EXPECT_EQ(valueChanged, foundOne);
};
flushTaskAndFindCmds(false, true); // first time
flushTaskAndFindCmds(false, false); // not changed
csr->getMemoryManager()->freeGraphicsMemory(graphicsAlloc);
}
GEN12LPTEST_F(Gen12LpCoherencyRequirements, givenFlushWithoutSharedHandlesWhenPreviouslyUsedThenProgramPcAndSCM) {
auto graphicAlloc = csr->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize});
IndirectHeap stream(graphicAlloc);
makeResidentSharedAlloc();
csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device);
EXPECT_TRUE(csr->getCsrRequestFlags()->hasSharedHandles);
auto startOffset = csr->commandStream.getUsed();
csr->streamProperties.stateComputeMode.isCoherencyRequired.set(true);
csr->flushTask(stream, 0, &stream, &stream, &stream, 0, flags, *device);
EXPECT_TRUE(csr->getCsrRequestFlags()->hasSharedHandles);
HardwareParse hwParser;
hwParser.parseCommands<FamilyType>(csr->commandStream, startOffset);
STATE_COMPUTE_MODE::FORCE_NON_COHERENT expectedCoherentValue = STATE_COMPUTE_MODE::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT;
uint32_t expectedCoherentMask = FamilyType::stateComputeModeForceNonCoherentMask;
bool foundOne = false;
for (auto it = hwParser.cmdList.begin(); it != hwParser.cmdList.end(); it++) {
auto cmd = genCmdCast<STATE_COMPUTE_MODE *>(*it);
if (cmd) {
EXPECT_EQ(expectedCoherentValue, cmd->getForceNonCoherent());
EXPECT_EQ(expectedCoherentMask, cmd->getMaskBits());
EXPECT_FALSE(foundOne);
foundOne = true;
auto pc = genCmdCast<PIPE_CONTROL *>(*(++it));
EXPECT_NE(nullptr, pc);
}
}
EXPECT_TRUE(foundOne);
csr->getMemoryManager()->freeGraphicsMemory(graphicAlloc);
}

View File

@ -13,10 +13,7 @@ if(TESTS_DG1)
set(IGDRCL_SRCS_tests_dg1
${IGDRCL_SRCS_tests_gen12lp_dg1_excludes}
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests_dg1.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_tests_dg1.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_dg1.cpp
${CMAKE_CURRENT_SOURCE_DIR}/execution_environment_tests_dg1.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_cl_device_caps_dg1.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_dg1})
add_subdirectories()

View File

@ -1,36 +0,0 @@
/*
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/ail/ail_configuration.h"
#include "shared/test/common/helpers/variable_backup.h"
#include "shared/test/common/mocks/mock_execution_environment.h"
#include "shared/test/common/test_macros/hw_test.h"
#include "shared/test/common/utilities/destructor_counted.h"
namespace NEO {
using RootDeviceEnvironmentTests = ::testing::Test;
HWTEST2_F(RootDeviceEnvironmentTests, givenRootDeviceEnvironmentWhenAILInitProcessExecutableNameReturnsFailedThenInitAilConfigurationReturnsFail, IsDG1) {
MockExecutionEnvironment executionEnvironment;
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[0].get());
class AILDG1 : public AILConfigurationHw<productFamily> {
public:
bool initProcessExecutableName() override {
return false;
}
};
VariableBackup<AILConfiguration *> ailConfiguration(&ailConfigurationTable[productFamily]);
AILDG1 ailDg1;
ailConfigurationTable[productFamily] = &ailDg1;
EXPECT_EQ(false, rootDeviceEnvironment->initAilConfiguration());
}
} // namespace NEO

View File

@ -1,80 +0,0 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen12lp/hw_cmds_dg1.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/hw_helper_tests.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "opencl/source/helpers/cl_hw_helper.h"
using HwHelperTestDg1 = HwHelperTest;
DG1TEST_F(HwHelperTestDg1, givenDg1SteppingA0WhenAdjustDefaultEngineTypeCalledThenRcsIsReturned) {
auto &helper = HwHelper::get(renderCoreFamily);
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
helper.adjustDefaultEngineType(&hardwareInfo);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
}
DG1TEST_F(HwHelperTestDg1, givenDg1SteppingBWhenAdjustDefaultEngineTypeCalledThenRcsIsReturned) {
auto &helper = HwHelper::get(renderCoreFamily);
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hardwareInfo);
helper.adjustDefaultEngineType(&hardwareInfo);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
}
DG1TEST_F(HwHelperTestDg1, givenDg1AndVariousSteppingsWhenGettingIsWorkaroundRequiredThenCorrectValueIsReturned) {
const auto &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
const auto &hwInfoConfig = *HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
uint32_t steppings[] = {
REVISION_A0,
REVISION_B,
CommonConstants::invalidStepping};
for (auto stepping : steppings) {
hardwareInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(stepping, hardwareInfo);
switch (stepping) {
case REVISION_A0:
EXPECT_TRUE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, hardwareInfo));
[[fallthrough]];
default:
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_B, REVISION_A0, hardwareInfo));
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_D, hardwareInfo));
}
}
}
DG1TEST_F(HwHelperTestDg1, givenBufferAllocationTypeWhenSetExtraAllocationDataIsCalledThenIsLockableIsSet) {
auto &hwHelper = HwHelper::get(renderCoreFamily);
AllocationData allocData{};
allocData.flags.useSystemMemory = true;
AllocationProperties allocProperties(0, 1, AllocationType::BUFFER, {});
allocData.storageInfo.isLockable = false;
allocProperties.flags.shareable = false;
hwHelper.setExtraAllocationData(allocData, allocProperties, *defaultHwInfo);
EXPECT_TRUE(allocData.storageInfo.isLockable);
}
DG1TEST_F(HwHelperTestDg1, givenBufferAllocationTypeWhenSetExtraAllocationDataIsCalledWithShareableSetThenIsLockableIsFalse) {
auto &hwHelper = HwHelper::get(renderCoreFamily);
AllocationData allocData{};
allocData.flags.useSystemMemory = true;
AllocationProperties allocProperties(0, 1, AllocationType::BUFFER, {});
allocData.storageInfo.isLockable = false;
allocProperties.flags.shareable = true;
hwHelper.setExtraAllocationData(allocData, allocProperties, *defaultHwInfo);
EXPECT_FALSE(allocData.storageInfo.isLockable);
}

View File

@ -1,30 +0,0 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/hw_info.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/helpers/gtest_helpers.h"
#include "shared/test/common/test_macros/hw_test.h"
using namespace NEO;
template <typename T>
class Dg1HwInfoTests : public ::testing::Test {};
typedef ::testing::Types<Dg1HwConfig> dg1TestTypes;
TYPED_TEST_CASE(Dg1HwInfoTests, dg1TestTypes);
TYPED_TEST(Dg1HwInfoTests, WhenSetupHardwareInfoWithSetupFeatureTableFlagTrueOrFalseIsCalledThenFeatureTableHasCorrectValueOfLocalMemoryFeature) {
HardwareInfo hwInfo = *defaultHwInfo;
FeatureTable &featureTable = hwInfo.featureTable;
EXPECT_FALSE(featureTable.flags.ftrLocalMemory);
TypeParam::setupHardwareInfo(&hwInfo, false);
EXPECT_FALSE(featureTable.flags.ftrLocalMemory);
TypeParam::setupHardwareInfo(&hwInfo, true);
EXPECT_TRUE(featureTable.flags.ftrLocalMemory);
}

View File

@ -0,0 +1,32 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen12lp/hw_cmds_dg1.h"
#include "shared/source/os_interface/driver_info.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 Dg1ClDeviceCaps = Test<ClDeviceFixture>;
DG1TEST_F(Dg1ClDeviceCaps, givenDg1hpWhenInitializeCapsThenVmeIsNotSupported) {
pClDevice->driverInfo.reset();
pClDevice->name.clear();
pClDevice->initializeCaps();
cl_uint expectedVmeAvcVersion = CL_AVC_ME_VERSION_0_INTEL;
cl_uint expectedVmeVersion = CL_ME_VERSION_LEGACY_INTEL;
EXPECT_EQ(expectedVmeVersion, pClDevice->getDeviceInfo().vmeVersion);
EXPECT_EQ(expectedVmeAvcVersion, pClDevice->getDeviceInfo().vmeAvcVersion);
EXPECT_FALSE(pClDevice->getDeviceInfo().vmeAvcSupportsTextureSampler);
EXPECT_FALSE(pDevice->getDeviceInfo().vmeAvcSupportsPreemption);
}

View File

@ -1,54 +0,0 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen12lp/hw_cmds_dg1.h"
#include "shared/source/os_interface/driver_info.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 Dg1DeviceCaps = Test<ClDeviceFixture>;
DG1TEST_F(Dg1DeviceCaps, givenDg1WhenCheckSupportCacheFlushAfterWalkerThenFalse) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportCacheFlushAfterWalker);
}
DG1TEST_F(Dg1DeviceCaps, givenDG1WhenCheckftr64KBpagesThenTrue) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
}
DG1TEST_F(Dg1DeviceCaps, givenDG1WhenRequestedVmeFlagsThenReturnFalse) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsVme);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsVmeAvcTextureSampler);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsVmeAvcPreemption);
}
DG1TEST_F(Dg1DeviceCaps, givenDg1hpWhenInitializeCapsThenVmeIsNotSupported) {
pClDevice->driverInfo.reset();
pClDevice->name.clear();
pClDevice->initializeCaps();
cl_uint expectedVmeAvcVersion = CL_AVC_ME_VERSION_0_INTEL;
cl_uint expectedVmeVersion = CL_ME_VERSION_LEGACY_INTEL;
EXPECT_EQ(expectedVmeVersion, pClDevice->getDeviceInfo().vmeVersion);
EXPECT_EQ(expectedVmeAvcVersion, pClDevice->getDeviceInfo().vmeAvcVersion);
EXPECT_FALSE(pClDevice->getDeviceInfo().vmeAvcSupportsTextureSampler);
EXPECT_FALSE(pDevice->getDeviceInfo().vmeAvcSupportsPreemption);
}
DG1TEST_F(Dg1DeviceCaps, givenDg1WhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
}
DG1TEST_F(Dg1DeviceCaps, givenDg1WhenCheckGpuAdressSpaceThenReturn47bits) {
EXPECT_EQ(MemoryConstants::max64BitAppAddress, pDevice->getHardwareInfo().capabilityTable.gpuAddressSpace);
}

View File

@ -6,7 +6,6 @@
*/
#include "opencl/test/unit_test/gen12lp/buffer_tests_gen12lp.inl"
#include "opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl"
#include "opencl/test/unit_test/gen12lp/command_stream_receiver_hw_tests_gen12lp.inl"
#include "opencl/test/unit_test/gen12lp/enqueue_media_kernel_gen12lp.inl"
#include "opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl"
@ -14,8 +13,5 @@
#include "opencl/test/unit_test/gen12lp/image_tests_gen12lp.inl"
#include "opencl/test/unit_test/gen12lp/kernel_tests_gen12lp.inl"
#include "opencl/test/unit_test/gen12lp/profiling_tests_gen12lp.inl"
#include "opencl/test/unit_test/gen12lp/sampler_tests_gen12lp.inl"
#include "opencl/test/unit_test/gen12lp/tbx_command_stream_receiver_tests_gen12lp.inl"
#include "opencl/test/unit_test/gen12lp/test_device_caps_gen12lp.inl"
#include "opencl/test/unit_test/gen12lp/test_cl_device_caps_gen12lp.inl"
#include "opencl/test/unit_test/gen12lp/test_platform_caps_gen12lp.inl"
#include "opencl/test/unit_test/gen12lp/test_sample_gen12lp.inl"

View File

@ -10,12 +10,5 @@ if(TESTS_RKL)
)
set_property(GLOBAL APPEND PROPERTY IGDRCL_SRCS_tests_excludes ${IGDRCL_SRCS_tests_gen12lp_rkl_excludes})
set(IGDRCL_SRCS_tests_gen12lp_rkl
${IGDRCL_SRCS_tests_gen12lp_rkl_excludes}
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_helper_rkl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_rkl.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen12lp_rkl})
add_subdirectories()
endif()

View File

@ -1,39 +0,0 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen12lp/hw_cmds_rkl.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/hw_helper_tests.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
using HwHelperTestRkl = HwHelperTest;
RKLTEST_F(HwHelperTestRkl, givenRklSteppingA0WhenAdjustDefaultEngineTypeCalledThenRcsIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
auto &helper = HwHelper::get(renderCoreFamily);
helper.adjustDefaultEngineType(&hardwareInfo);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
}
RKLTEST_F(HwHelperTestRkl, givenRklSteppingBWhenAdjustDefaultEngineTypeCalledThenRcsIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hardwareInfo);
auto &helper = HwHelper::get(renderCoreFamily);
helper.adjustDefaultEngineType(&hardwareInfo);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
}
RKLTEST_F(HwHelperTestRkl, givenRklWhenRequestedVmeFlagsThenReturnFalse) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsVme);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsVmeAvcTextureSampler);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsVmeAvcPreemption);
}

View File

@ -1,46 +0,0 @@
/*
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen12lp/hw_cmds_rkl.h"
#include "shared/source/helpers/compiler_hw_info_config.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
#include <array>
using namespace NEO;
using RklHwInfoConfig = ::testing::Test;
RKLTEST_F(RklHwInfoConfig, givenA0OrBSteppingAndRklPlatformWhenAskingIfWAIsRequiredThenReturnTrue) {
auto hwInfoConfig = HwInfoConfig::get(productFamily);
std::array<std::pair<uint32_t, bool>, 3> revisions = {
{{REVISION_A0, true},
{REVISION_B, true},
{REVISION_C, false}}};
for (const auto &[revision, paramBool] : revisions) {
auto hwInfo = *defaultHwInfo;
hwInfo.platform.usRevId = hwInfoConfig->getHwRevIdFromStepping(revision, hwInfo);
hwInfoConfig->configureHardwareCustom(&hwInfo, nullptr);
EXPECT_EQ(paramBool, hwInfoConfig->isForceEmuInt32DivRemSPWARequired(hwInfo));
}
}
RKLTEST_F(RklHwInfoConfig, givenHwInfoConfigWhenAskedIf3DPipelineSelectWAIsRequiredThenTrueIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_TRUE(hwInfoConfig.is3DPipelineSelectWARequired());
}
using CompilerHwInfoConfigHelperTestsRkl = ::testing::Test;
RKLTEST_F(CompilerHwInfoConfigHelperTestsRkl, givenRklWhenIsForceEmuInt32DivRemSPRequiredIsCalledThenReturnsTrue) {
EXPECT_TRUE(CompilerHwInfoConfig::get(productFamily)->isForceEmuInt32DivRemSPRequired());
}

View File

@ -1,53 +0,0 @@
/*
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/debug_manager_state_restore.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> Gen12LpSamplerTest;
HWTEST2_F(Gen12LpSamplerTest, givenTglLpSamplerWhenUsingDefaultFilteringAndAppendSamplerStateParamsThenDisableLowQualityFilter, IsTGLLP) {
EXPECT_FALSE(DebugManager.flags.ForceSamplerLowFilteringPrecision.get());
typedef typename FamilyType::SAMPLER_STATE SAMPLER_STATE;
auto state = FamilyType::cmdInitSamplerState;
EXPECT_EQ(SAMPLER_STATE::LOW_QUALITY_FILTER_DISABLE, state.getLowQualityFilter());
HwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->adjustSamplerState(&state, *defaultHwInfo);
EXPECT_EQ(SAMPLER_STATE::LOW_QUALITY_FILTER_DISABLE, state.getLowQualityFilter());
}
HWTEST2_F(Gen12LpSamplerTest, givenTglLpSamplerWhenForcingLowQualityFilteringAndAppendSamplerStateParamsThenEnableLowQualityFilter, IsTGLLP) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.ForceSamplerLowFilteringPrecision.set(true);
EXPECT_TRUE(DebugManager.flags.ForceSamplerLowFilteringPrecision.get());
typedef typename FamilyType::SAMPLER_STATE SAMPLER_STATE;
auto state = FamilyType::cmdInitSamplerState;
EXPECT_EQ(SAMPLER_STATE::LOW_QUALITY_FILTER_DISABLE, state.getLowQualityFilter());
HwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->adjustSamplerState(&state, *defaultHwInfo);
EXPECT_EQ(SAMPLER_STATE::LOW_QUALITY_FILTER_ENABLE, state.getLowQualityFilter());
}
GEN12LPTEST_F(Gen12LpSamplerTest, GivenDefaultWhenGettingLowLowQualityFilterStateThenItIsDisabled) {
typedef typename FamilyType::SAMPLER_STATE SAMPLER_STATE;
auto state = FamilyType::cmdInitSamplerState;
EXPECT_EQ(SAMPLER_STATE::LOW_QUALITY_FILTER_DISABLE, state.getLowQualityFilter());
}
GEN12LPTEST_F(Gen12LpSamplerTest, givenGen12LpSamplerWhenProgrammingLowQualityCubeCornerModeThenTheModeChangesAppropriately) {
typedef typename FamilyType::SAMPLER_STATE SAMPLER_STATE;
auto state = FamilyType::cmdInitSamplerState;
EXPECT_EQ(SAMPLER_STATE::LOW_QUALITY_CUBE_CORNER_MODE_ENABLE, state.getLowQualityCubeCornerMode());
state.setLowQualityCubeCornerMode(SAMPLER_STATE::LOW_QUALITY_CUBE_CORNER_MODE_DISABLE);
EXPECT_EQ(SAMPLER_STATE::LOW_QUALITY_CUBE_CORNER_MODE_DISABLE, state.getLowQualityCubeCornerMode());
}

View File

@ -1,50 +0,0 @@
/*
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/aub_mem_dump/page_table_entry_bits.h"
#include "shared/source/command_stream/tbx_command_stream_receiver_hw.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"
#include "shared/test/common/test_macros/test.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
using namespace NEO;
using Gen12LPTbxCommandStreamReceiverTests = Test<ClDeviceFixture>;
GEN12LPTEST_F(Gen12LPTbxCommandStreamReceiverTests, givenNullPtrGraphicsAlloctionWhenGetPPGTTAdditionalBitsIsCalledThenAppropriateValueIsReturned) {
auto tbxCsr = std::make_unique<TbxCommandStreamReceiverHw<FamilyType>>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
GraphicsAllocation *allocation = nullptr;
auto bits = tbxCsr->getPPGTTAdditionalBits(allocation);
constexpr uint64_t expectedBits = BIT(PageTableEntry::presentBit) | BIT(PageTableEntry::writableBit);
EXPECT_EQ(expectedBits, bits);
}
GEN12LPTEST_F(Gen12LPTbxCommandStreamReceiverTests, givenGraphicsAlloctionWithLocalMemoryPoolWhenGetPPGTTAdditionalBitsIsCalledThenAppropriateValueIsReturned) {
auto tbxCsr = std::make_unique<TbxCommandStreamReceiverHw<FamilyType>>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
MockGraphicsAllocation allocation(nullptr, 0);
allocation.overrideMemoryPool(MemoryPool::LocalMemory);
auto bits = tbxCsr->getPPGTTAdditionalBits(&allocation);
constexpr uint64_t expectedBits = BIT(PageTableEntry::presentBit) | BIT(PageTableEntry::writableBit) | BIT(PageTableEntry::localMemoryBit);
EXPECT_EQ(expectedBits, bits);
}
GEN12LPTEST_F(Gen12LPTbxCommandStreamReceiverTests, whenAskedForPollForCompletionParametersThenReturnCorrectValues) {
class MyMockTbxHw : public TbxCommandStreamReceiverHw<FamilyType> {
public:
MyMockTbxHw(ExecutionEnvironment &executionEnvironment)
: TbxCommandStreamReceiverHw<FamilyType>(executionEnvironment, 0, 1) {}
using TbxCommandStreamReceiverHw<FamilyType>::getpollNotEqualValueForPollForCompletion;
using TbxCommandStreamReceiverHw<FamilyType>::getMaskAndValueForPollForCompletion;
};
MyMockTbxHw myMockTbxHw(*pDevice->executionEnvironment);
EXPECT_EQ(0x80u, myMockTbxHw.getMaskAndValueForPollForCompletion());
EXPECT_TRUE(myMockTbxHw.getpollNotEqualValueForPollForCompletion());
}

View File

@ -0,0 +1,52 @@
/*
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/hw_helper.h"
#include "shared/test/common/helpers/gtest_helpers.h"
#include "shared/test/common/test_macros/test.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
using namespace NEO;
using Gen12LpClDeviceCaps = Test<ClDeviceFixture>;
HWTEST2_F(Gen12LpClDeviceCaps, WhenCheckingExtensionStringThenFp64IsNotSupported, IsTGLLP) {
const auto &caps = pClDevice->getDeviceInfo();
std::string extensionString = caps.deviceExtensions;
EXPECT_EQ(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
EXPECT_EQ(0u, caps.doubleFpConfig);
}
HWTEST2_F(Gen12LpClDeviceCaps, givenGen12lpWhenCheckExtensionsThenSubgroupLocalBlockIOIsSupported, IsTGLLP) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_TRUE(hasSubstr(caps.deviceExtensions, std::string("cl_intel_subgroup_local_block_io")));
}
HWTEST2_F(Gen12LpClDeviceCaps, givenGen12lpWhenCheckExtensionsThenDeviceDoesNotReportClKhrSubgroupsExtension, IsTGLLP) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_FALSE(hasSubstr(caps.deviceExtensions, std::string("cl_khr_subgroups")));
}
HWTEST2_F(Gen12LpClDeviceCaps, givenGen12lpWhenCheckingCapsThenDeviceDoesNotSupportIndependentForwardProgress, IsTGLLP) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_FALSE(caps.independentForwardProgress);
}
HWTEST2_F(Gen12LpClDeviceCaps, WhenCheckingCapsThenCorrectlyRoundedDivideSqrtIsNotSupported, IsTGLLP) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_EQ(0u, caps.singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);
}
GEN12LPTEST_F(Gen12LpClDeviceCaps, WhenCheckingCapsThenProfilingTimerResolutionIs83) {
const auto &caps = pClDevice->getSharedDeviceInfo();
EXPECT_EQ(83u, caps.outProfilingTimerResolution);
}

View File

@ -1,122 +0,0 @@
/*
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/hw_helper.h"
#include "shared/test/common/helpers/gtest_helpers.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> Gen12LpDeviceCaps;
HWTEST2_F(Gen12LpDeviceCaps, WhenCheckingExtensionStringThenFp64IsNotSupported, IsTGLLP) {
const auto &caps = pClDevice->getDeviceInfo();
std::string extensionString = caps.deviceExtensions;
EXPECT_EQ(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
EXPECT_EQ(0u, caps.doubleFpConfig);
}
HWTEST2_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckExtensionsThenSubgroupLocalBlockIOIsSupported, IsTGLLP) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_TRUE(hasSubstr(caps.deviceExtensions, std::string("cl_intel_subgroup_local_block_io")));
}
HWTEST2_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckExtensionsThenDeviceDoesNotReportClKhrSubgroupsExtension, IsTGLLP) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_FALSE(hasSubstr(caps.deviceExtensions, std::string("cl_khr_subgroups")));
}
HWTEST2_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckingCapsThenDeviceDoesNotSupportIndependentForwardProgress, IsTGLLP) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_FALSE(caps.independentForwardProgress);
}
HWTEST2_F(Gen12LpDeviceCaps, WhenCheckingCapsThenCorrectlyRoundedDivideSqrtIsNotSupported, IsTGLLP) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_EQ(0u, caps.singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);
}
GEN12LPTEST_F(Gen12LpDeviceCaps, GivenDefaultWhenCheckingPreemptionModeThenMidThreadIsReported) {
EXPECT_EQ(PreemptionMode::MidThread, pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
}
GEN12LPTEST_F(Gen12LpDeviceCaps, WhenCheckingCapsThenProfilingTimerResolutionIs83) {
const auto &caps = pClDevice->getSharedDeviceInfo();
EXPECT_EQ(83u, caps.outProfilingTimerResolution);
}
GEN12LPTEST_F(Gen12LpDeviceCaps, WhenCheckingCapsThenKmdNotifyMechanismIsCorrectlyReported) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits);
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission);
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds);
}
GEN12LPTEST_F(Gen12LpDeviceCaps, WhenCheckingCapsThenCompressionIsDisabled) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedBuffers);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedImages);
}
GEN12LPTEST_F(Gen12LpDeviceCaps, givenHwInfoWhenRequestedComputeUnitsUsedForScratchThenReturnValidValue) {
const auto &hwInfo = pDevice->getHardwareInfo();
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
uint32_t expectedValue = hwInfo.gtSystemInfo.MaxSubSlicesSupported * hwInfo.gtSystemInfo.MaxEuPerSubSlice * 8;
EXPECT_EQ(expectedValue, hwHelper.getComputeUnitsUsedForScratch(&hwInfo));
EXPECT_EQ(expectedValue, pDevice->getDeviceInfo().computeUnitsUsedForScratch);
}
GEN12LPTEST_F(Gen12LpDeviceCaps, givenHwInfoWhenSlmSizeIsRequiredThenReturnCorrectValue) {
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
}
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpWhenCheckBlitterOperationsSupportThenReturnFalse) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.blitterOperationsSupported);
}
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpWhenCheckingImageSupportThenReturnTrue) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsImages);
}
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpWhenCheckingMediaBlockSupportThenReturnTrue) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsMediaBlock);
}
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpWhenCheckingCoherencySupportThenReturnFalse) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsCoherency);
}
HWTEST2_F(Gen12LpDeviceCaps, givenTglLpWhenCheckSupportCacheFlushAfterWalkerThenFalse, IsTGLLP) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportCacheFlushAfterWalker);
}
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpDeviceWhenCheckingDeviceEnqueueSupportThenFalseIsReturned) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsDeviceEnqueue);
}
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpDeviceWhenCheckingPipesSupportThenFalseIsReturned) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsPipes);
}
HWTEST2_F(Gen12LpDeviceCaps, GivenTGLLPWhenCheckftr64KBpagesThenTrue, IsTGLLP) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
}
HWTEST2_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue, IsTGLLP) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
}

View File

@ -1,26 +0,0 @@
/*
* Copyright (C) 2019-2022 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;
typedef Test<ClDeviceFixture> TigerlakeLpOnlyTest;
HWTEST2_F(TigerlakeLpOnlyTest, WhenGettingHardwareInfoThenProductFamilyIsTigerlakeLp, IsTGLLP) {
EXPECT_EQ(IGFX_TIGERLAKE_LP, pDevice->getHardwareInfo().platform.eProductFamily);
}
typedef Test<ClDeviceFixture> Gen12LpOnlyTeset;
GEN12LPTEST_F(Gen12LpOnlyTeset, WhenGettingRenderCoreFamilyThenGen12lpCoreIsReturned) {
EXPECT_NE(IGFX_GEN9_CORE, pDevice->getRenderCoreFamily());
EXPECT_NE(IGFX_GEN11_CORE, pDevice->getRenderCoreFamily());
EXPECT_EQ(IGFX_GEN12LP_CORE, pDevice->getRenderCoreFamily());
}

View File

@ -14,8 +14,6 @@ if(TESTS_TGLLP)
${IGDRCL_SRCS_tests_gen12lp_tgllp_excludes}
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/kernel_tests_tgllp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_helper_tgllp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_tgllp.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen12lp_tgllp})
add_subdirectories()

View File

@ -1,70 +0,0 @@
/*
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen12lp/hw_cmds_tgllp.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/hw_helper_tests.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
using HwHelperTestGen12Lp = HwHelperTest;
TGLLPTEST_F(HwHelperTestGen12Lp, givenTgllpSteppingA0WhenAdjustDefaultEngineTypeCalledThenRcsIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
auto &helper = HwHelper::get(renderCoreFamily);
helper.adjustDefaultEngineType(&hardwareInfo);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
}
TGLLPTEST_F(HwHelperTestGen12Lp, givenTgllpSteppingBWhenAdjustDefaultEngineTypeCalledThenRcsIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A1, hardwareInfo);
auto &helper = HwHelper::get(renderCoreFamily);
helper.adjustDefaultEngineType(&hardwareInfo);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
}
TGLLPTEST_F(HwHelperTestGen12Lp, givenTgllWhenWaForDefaultEngineIsNotAppliedThenCcsIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
hardwareInfo.featureTable.flags.ftrCCSNode = true;
hardwareInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
hardwareInfo.platform.eProductFamily = IGFX_UNKNOWN;
auto &helper = HwHelper::get(renderCoreFamily);
helper.adjustDefaultEngineType(&hardwareInfo);
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
}
TGLLPTEST_F(HwHelperTestGen12Lp, givenTgllpAndVariousSteppingsWhenGettingIsWorkaroundRequiredThenCorrectValueIsReturned) {
auto &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
const auto &hwInfoConfig = *HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
uint32_t steppings[] = {
REVISION_A0,
REVISION_B,
REVISION_C,
CommonConstants::invalidStepping};
for (auto stepping : steppings) {
hardwareInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(stepping, hardwareInfo);
switch (stepping) {
case REVISION_A0:
EXPECT_TRUE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, hardwareInfo));
[[fallthrough]];
case REVISION_B:
EXPECT_TRUE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_C, hardwareInfo));
[[fallthrough]];
default:
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_D, hardwareInfo));
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_B, REVISION_A0, hardwareInfo));
}
}
}

View File

@ -1,200 +0,0 @@
/*
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen12lp/hw_cmds_tgllp.h"
#include "shared/source/os_interface/device_factory.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/mocks/mock_execution_environment.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
#include "platforms.h"
using namespace NEO;
using TgllpHwInfoConfig = ::testing::Test;
TGLLPTEST_F(TgllpHwInfoConfig, givenHwInfoErrorneousConfigStringThenThrow) {
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
gtSystemInfo = {0};
EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config));
EXPECT_EQ(0u, gtSystemInfo.SliceCount);
EXPECT_EQ(0u, gtSystemInfo.SubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.EUCount);
}
TGLLPTEST_F(TgllpHwInfoConfig, whenUsingCorrectConfigValueThenCorrectHwInfoIsReturned) {
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0x100060010;
gtSystemInfo = {0};
hardwareInfoSetup[productFamily](&hwInfo, false, config);
EXPECT_EQ(1u, gtSystemInfo.SliceCount);
EXPECT_EQ(6u, gtSystemInfo.DualSubSliceCount);
config = 0x100020010;
gtSystemInfo = {0};
hardwareInfoSetup[productFamily](&hwInfo, false, config);
EXPECT_EQ(1u, gtSystemInfo.SliceCount);
EXPECT_EQ(2u, gtSystemInfo.DualSubSliceCount);
}
TGLLPTEST_F(TgllpHwInfoConfig, givenA0SteppingAndTgllpPlatformWhenAskingIfWAIsRequiredThenReturnTrue) {
auto hwInfoConfig = HwInfoConfig::get(productFamily);
std::array<std::pair<uint32_t, bool>, 3> revisions = {
{{REVISION_A0, true},
{REVISION_B, false},
{REVISION_C, false}}};
for (const auto &[revision, paramBool] : revisions) {
auto hwInfo = *defaultHwInfo;
hwInfo.platform.usRevId = hwInfoConfig->getHwRevIdFromStepping(revision, hwInfo);
hwInfoConfig->configureHardwareCustom(&hwInfo, nullptr);
EXPECT_EQ(paramBool, hwInfoConfig->pipeControlWARequired(hwInfo));
EXPECT_EQ(paramBool, hwInfoConfig->imagePitchAlignmentWARequired(hwInfo));
EXPECT_EQ(paramBool, hwInfoConfig->isForceEmuInt32DivRemSPWARequired(hwInfo));
}
}
TGLLPTEST_F(TgllpHwInfoConfig, givenHwInfoConfigWhenAskedIf3DPipelineSelectWAIsRequiredThenTrueIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_TRUE(hwInfoConfig.is3DPipelineSelectWARequired());
}
using TgllpHwInfo = ::testing::Test;
TGLLPTEST_F(TgllpHwInfo, givenBoolWhenCallTgllpHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
static bool boolValue[]{
true, false};
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
uint64_t configs[] = {
0x100060010,
0x100020010};
for (auto &config : configs) {
for (auto setParamBool : boolValue) {
gtSystemInfo = {0};
featureTable = {};
workaroundTable = {};
hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config);
EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT);
EXPECT_EQ(setParamBool, featureTable.flags.ftrSVM);
EXPECT_EQ(setParamBool, featureTable.flags.ftrIA32eGfxPTEs);
EXPECT_EQ(setParamBool, featureTable.flags.ftrStandardMipTailFormat);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTranslationTable);
EXPECT_EQ(setParamBool, featureTable.flags.ftrUserModeTranslationTable);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTileMappedResource);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbc);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTileY);
EXPECT_EQ(setParamBool, featureTable.flags.ftrAstcHdr2D);
EXPECT_EQ(setParamBool, featureTable.flags.ftrAstcLdr2D);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt);
EXPECT_EQ(setParamBool, workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface);
EXPECT_EQ(setParamBool, workaroundTable.flags.waUntypedBufferCompression);
}
}
}
TGLLPTEST_F(TgllpHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled) {
HardwareInfo hwInfo = *defaultHwInfo;
uint64_t config = 0x100060010;
hardwareInfoSetup[productFamily](&hwInfo, false, config);
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler);
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption);
EXPECT_FALSE(hwInfo.capabilityTable.supportsVme);
}
TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeForTgllpProductFamilyWhenPrepareDeviceEnvironmentsForProductFamilyOverrideIsCalledThenAubCenterIsInitializedCorrectly) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.SetCommandStreamReceiver.set(1);
DebugManager.flags.ProductFamilyOverride.set("tgllp");
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
bool success = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment);
ASSERT_TRUE(success);
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[0].get());
EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled);
EXPECT_FALSE(rootDeviceEnvironment->localMemoryEnabledReceived);
}
TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeWithOverrideGpuAddressSpaceWhenPrepareDeviceEnvironmentsForProductFamilyOverrideIsCalledThenAubManagerIsInitializedWithCorrectGpuAddressSpace) {
DebugManagerStateRestore stateRestore;
DebugManager.flags.SetCommandStreamReceiver.set(1);
DebugManager.flags.ProductFamilyOverride.set("tgllp");
DebugManager.flags.OverrideGpuAddressSpace.set(48);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
bool success = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment);
ASSERT_TRUE(success);
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[0].get());
auto mockAubManager = static_cast<MockAubManager *>(rootDeviceEnvironment->aubCenter->getAubManager());
EXPECT_EQ(MemoryConstants::max48BitAddress, mockAubManager->mockAubManagerParams.gpuAddressSpace);
}
TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeWhenPrepareDeviceEnvironmentsForProductFamilyOverrideIsCalledThenAllRootDeviceEnvironmentMembersAreInitialized) {
DebugManagerStateRestore stateRestore;
auto requiredDeviceCount = 2u;
DebugManager.flags.CreateMultipleRootDevices.set(requiredDeviceCount);
DebugManager.flags.SetCommandStreamReceiver.set(1);
DebugManager.flags.ProductFamilyOverride.set("tgllp");
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get(), true, requiredDeviceCount);
bool success = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment);
ASSERT_TRUE(success);
std::set<MemoryOperationsHandler *> memoryOperationHandlers;
for (auto rootDeviceIndex = 0u; rootDeviceIndex < requiredDeviceCount; rootDeviceIndex++) {
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[rootDeviceIndex].get());
EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled);
EXPECT_FALSE(rootDeviceEnvironment->localMemoryEnabledReceived);
auto memoryOperationInterface = rootDeviceEnvironment->memoryOperationsInterface.get();
EXPECT_NE(nullptr, memoryOperationInterface);
EXPECT_EQ(memoryOperationHandlers.end(), memoryOperationHandlers.find(memoryOperationInterface));
memoryOperationHandlers.insert(memoryOperationInterface);
}
}
TGLLPTEST_F(TgllpHwInfo, givenTgllpWhenObtainingBlitterPreferenceThenReturnFalse) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
const auto &hardwareInfo = *defaultHwInfo;
EXPECT_FALSE(hwInfoConfig.obtainBlitterPreference(hardwareInfo));
}
TGLLPTEST_F(TgllpHwInfo, givenHwInfoConfigWhenGetProductConfigThenCorrectMatchIsFound) {
HardwareInfo hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
EXPECT_EQ(hwInfoConfig.getProductConfigFromHwInfo(hwInfo), AOT::TGL);
}