Correct xe_hpc_core ults

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-6738
This commit is contained in:
Kamil Kopryk
2022-03-21 13:53:57 +00:00
committed by Compute-Runtime-Automation
parent 9c06af79ad
commit bf559ed028
7 changed files with 144 additions and 138 deletions

View File

@@ -6,8 +6,6 @@
*/
#include "shared/source/command_container/command_encoder.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/os_interface/device_factory.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/test.h"
@@ -16,44 +14,7 @@ using namespace NEO;
using WalkerDispatchTestsXeHpcCore = ::testing::Test;
XE_HPC_CORETEST_F(WalkerDispatchTestsXeHpcCore, whenEncodeAdditionalWalkerFieldsThenPostSyncDataIsCorrectlySet) {
struct {
unsigned short revisionId;
int32_t programGlobalFenceAsPostSyncOperationInComputeWalker;
bool expectSystemMemoryFenceRequest;
} testInputs[] = {
{0x0, -1, false},
{0x3, -1, true},
{0x0, 0, false},
{0x3, 0, false},
{0x0, 1, true},
{0x3, 1, true},
};
DebugManagerStateRestore debugRestorer;
auto walkerCmd = FamilyType::cmdInitGpgpuWalker;
auto &postSyncData = walkerCmd.getPostSync();
auto hwInfo = *defaultHwInfo;
if (hwInfo.platform.eProductFamily != IGFX_PVC) {
GTEST_SKIP();
}
for (auto &testInput : testInputs) {
for (auto &deviceId : PVC_XL_IDS) {
hwInfo.platform.usDeviceID = deviceId;
hwInfo.platform.usRevId = testInput.revisionId;
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(
testInput.programGlobalFenceAsPostSyncOperationInComputeWalker);
postSyncData.setSystemMemoryFenceRequest(false);
EncodeDispatchKernel<FamilyType>::encodeAdditionalWalkerFields(hwInfo, walkerCmd, KernelExecutionType::Default);
EXPECT_EQ(testInput.expectSystemMemoryFenceRequest, postSyncData.getSystemMemoryFenceRequest());
}
}
}
XE_HPC_CORETEST_F(WalkerDispatchTestsXeHpcCore, givenPvcWhenEncodeAdditionalWalkerFieldsIsCalledThenComputeDispatchAllIsCorrectlySet) {
XE_HPC_CORETEST_F(WalkerDispatchTestsXeHpcCore, givenXeHpcWhenEncodeAdditionalWalkerFieldsIsCalledThenComputeDispatchAllIsCorrectlySet) {
using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER;
DebugManagerStateRestore debugRestorer;
auto walkerCmd = FamilyType::cmdInitGpgpuWalker;

View File

@@ -7,6 +7,7 @@
if(TESTS_PVC)
set(NEO_SHARED_TESTS_PVC
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/dispatch_walker_tests_pvc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_tests_pvc.cpp
)

View File

@@ -0,0 +1,50 @@
/*
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/command_container/command_encoder.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/os_interface/device_factory.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/test.h"
using namespace NEO;
using WalkerDispatchTestsPvc = ::testing::Test;
PVCTEST_F(WalkerDispatchTestsPvc, givenPvcWhenEncodeAdditionalWalkerFieldsThenPostSyncDataIsCorrectlySet) {
struct {
unsigned short revisionId;
int32_t programGlobalFenceAsPostSyncOperationInComputeWalker;
bool expectSystemMemoryFenceRequest;
} testInputs[] = {
{0x0, -1, false},
{0x3, -1, true},
{0x0, 0, false},
{0x3, 0, false},
{0x0, 1, true},
{0x3, 1, true},
};
DebugManagerStateRestore debugRestorer;
auto walkerCmd = FamilyType::cmdInitGpgpuWalker;
auto &postSyncData = walkerCmd.getPostSync();
auto hwInfo = *defaultHwInfo;
for (auto &testInput : testInputs) {
for (auto &deviceId : PVC_XL_IDS) {
hwInfo.platform.usDeviceID = deviceId;
hwInfo.platform.usRevId = testInput.revisionId;
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(
testInput.programGlobalFenceAsPostSyncOperationInComputeWalker);
postSyncData.setSystemMemoryFenceRequest(false);
EncodeDispatchKernel<FamilyType>::encodeAdditionalWalkerFields(hwInfo, walkerCmd, KernelExecutionType::Default);
EXPECT_EQ(testInput.expectSystemMemoryFenceRequest, postSyncData.getSystemMemoryFenceRequest());
}
}
}