Add timestamp WA for DG2+WSL2

Related-To: NEO-6391
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:
Kamil Diedrich
2022-02-02 08:40:39 +01:00
committed by Compute-Runtime-Automation
parent 65255ea38f
commit 8540aaff1c
6 changed files with 15 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -160,4 +160,9 @@ uint32_t HwInfoConfigHw<gfxProduct>::computeMaxNeededSubSliceSpace(const Hardwar
UNRECOVERABLE_IF(true);
}
return maxSubSlice;
}
template <>
void HwInfoConfigHw<gfxProduct>::convertTimestampsFromOaToCsDomain(uint64_t &timestampData) {
timestampData >>= 1;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -31,10 +31,5 @@ int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OS
return 0;
}
template <>
void HwInfoConfigHw<gfxProduct>::convertTimestampsFromOaToCsDomain(uint64_t &timestampData) {
timestampData >>= 1;
}
template class HwInfoConfigHw<gfxProduct>;
} // namespace NEO

View File

@@ -8,6 +8,7 @@ if(TESTS_DG2)
target_sources(neo_shared_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests_dg2.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_tests_dg2.cpp
)
endif()

View File

@@ -0,0 +1,24 @@
/*
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#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"
using namespace NEO;
using HwInfoConfigTestDg2 = ::testing::Test;
DG2TEST_F(HwInfoConfigTestDg2, whenConvertingTimestampsToCsDomainThenGpuTicksAreShifted) {
auto hwInfoConfig = HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
uint64_t gpuTicks = 0x12345u;
auto expectedGpuTicks = gpuTicks >> 1;
hwInfoConfig->convertTimestampsFromOaToCsDomain(gpuTicks);
EXPECT_EQ(expectedGpuTicks, gpuTicks);
}