Skip to content

Commit c77fe0b

Browse files
Add xe_hpg common tests
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
1 parent cd39302 commit c77fe0b

20 files changed

+592
-0
lines changed

shared/test/common/helpers/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ if(TESTS_XEHP_AND_LATER)
4444
)
4545
endif()
4646

47+
if(TESTS_DG2_AND_LATER)
48+
list(APPEND NEO_CORE_HELPERS_TESTS
49+
${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests_dg2_and_later.cpp
50+
)
51+
endif()
52+
4753
add_subdirectories()
4854

4955
target_sources(${TARGET_NAME} PRIVATE
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (C) 2021 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "shared/source/helpers/hw_helper.h"
9+
#include "shared/test/common/fixtures/device_fixture.h"
10+
11+
#include "test.h"
12+
13+
using namespace NEO;
14+
15+
using HwHelperDg2AndLaterTest = Test<DeviceFixture>;
16+
17+
HWTEST2_F(HwHelperDg2AndLaterTest, GivenUseL1CacheAsTrueWhenCallSetL1CachePolicyThenL1CachePolicyL1CacheControlIsSetProperly, IsAtLeastXeHpgCore) {
18+
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
19+
using SURFACE_TYPE = typename RENDER_SURFACE_STATE::SURFACE_TYPE;
20+
21+
auto &helper = reinterpret_cast<HwHelperHw<FamilyType> &>(HwHelperHw<FamilyType>::get());
22+
23+
RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState;
24+
bool useL1Cache = true;
25+
helper.setL1CachePolicy(useL1Cache, &surfaceState, defaultHwInfo.get());
26+
EXPECT_EQ(RENDER_SURFACE_STATE::L1_CACHE_POLICY_WB, surfaceState.getL1CachePolicyL1CacheControl());
27+
}
28+
HWTEST2_F(HwHelperDg2AndLaterTest, GivenUseL1CacheAsFalseWhenCallSetL1CachePolicyThenL1CachePolicyL1CacheControlIsNotSet, IsAtLeastXeHpgCore) {
29+
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
30+
using SURFACE_TYPE = typename RENDER_SURFACE_STATE::SURFACE_TYPE;
31+
32+
auto &helper = reinterpret_cast<HwHelperHw<FamilyType> &>(HwHelperHw<FamilyType>::get());
33+
RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState;
34+
bool useL1Cache = false;
35+
helper.setL1CachePolicy(useL1Cache, &surfaceState, defaultHwInfo.get());
36+
EXPECT_NE(RENDER_SURFACE_STATE::L1_CACHE_POLICY_WB, surfaceState.getL1CachePolicyL1CacheControl());
37+
}

shared/test/common/helpers/includes/test_traits_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
#include "shared/test/common/gen8/test_traits_gen8.h"
1212
#include "shared/test/common/gen9/test_traits_gen9.h"
1313
#include "shared/test/common/xe_hp_core/test_traits_xe_hp_core.h"
14+
#include "shared/test/common/xe_hpg_core/test_traits_xe_hpg_core.h"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright (C) 2021 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "shared/source/helpers/populate_factory.h"
9+
#include "shared/test/common/libult/ult_command_stream_receiver.h"
10+
11+
namespace NEO {
12+
13+
typedef XE_HPG_COREFamily Family;
14+
15+
static auto gfxCore = IGFX_XE_HPG_CORE;
16+
17+
extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE];
18+
19+
template <>
20+
void populateFactoryTable<UltCommandStreamReceiver<Family>>() {
21+
commandStreamReceiverFactory[IGFX_MAX_CORE + gfxCore] = UltCommandStreamReceiver<Family>::create;
22+
}
23+
24+
struct enableXeHpgCore {
25+
enableXeHpgCore() {
26+
populateFactoryTable<UltCommandStreamReceiver<Family>>();
27+
}
28+
};
29+
30+
static enableXeHpgCore enable;
31+
32+
template class UltCommandStreamReceiver<XE_HPG_COREFamily>;
33+
} // namespace NEO
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# Copyright (C) 2021 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
if(TESTS_XE_HPG_CORE)
8+
set(NEO_SHARED_aub_tests_configurations
9+
${NEO_SHARED_aub_tests_configurations}
10+
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
11+
${CMAKE_CURRENT_SOURCE_DIR}/aub_tests_configuration_xe_hpg_core.cpp
12+
)
13+
14+
set(NEO_SHARED_aub_tests_configurations ${NEO_SHARED_aub_tests_configurations} PARENT_SCOPE)
15+
endif()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (C) 2021 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "shared/test/common/test_configuration/aub_tests/aub_tests_configuration.h"
9+
10+
#include "hw_cmds.h"
11+
12+
using namespace NEO;
13+
14+
template <>
15+
AubTestsConfig GetAubTestsConfig<XE_HPG_COREFamily>() {
16+
AubTestsConfig aubTestsConfig;
17+
aubTestsConfig.testCanonicalAddress = true;
18+
return aubTestsConfig;
19+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
# Copyright (C) 2021 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
if(TESTS_XE_HPG_CORE)
8+
9+
set(NEO_CORE_TESTS_XE_HPG_CORE
10+
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
11+
${CMAKE_CURRENT_SOURCE_DIR}/simd_helper_tests_xe_hpg_core.cpp
12+
${CMAKE_CURRENT_SOURCE_DIR}/test_traits_xe_hpg_core.h
13+
)
14+
set_property(GLOBAL PROPERTY NEO_CORE_TESTS_XE_HPG_CORE ${NEO_CORE_TESTS_XE_HPG_CORE})
15+
add_subdirectories()
16+
17+
set(IGDRCL_SRCS_tests_xe_hpg_core_excludes
18+
${CMAKE_CURRENT_SOURCE_DIR}/excludes_xe_hpg_core.cpp
19+
)
20+
set_property(GLOBAL APPEND PROPERTY IGDRCL_SRCS_tests_excludes ${IGDRCL_SRCS_tests_xe_hpg_core_excludes})
21+
22+
target_sources(${TARGET_NAME} PRIVATE
23+
${IGDRCL_SRCS_tests_xe_hpg_core_excludes}
24+
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
25+
${CMAKE_CURRENT_SOURCE_DIR}/image_surface_state_tests_xe_hpg_core.cpp
26+
${CMAKE_CURRENT_SOURCE_DIR}/test_preemption_xe_hpg_core.cpp
27+
${COMPUTE_RUNTIME_ULT_XE_HPG_CORE}
28+
)
29+
30+
endif()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (C) 2021 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "shared/source/xe_hpg_core/hw_cmds.h"
9+
using GenStruct = NEO::XE_HPG_CORE;
10+
using GenGfxFamily = NEO::XE_HPG_COREFamily;
11+
#include "shared/test/common/cmd_parse/cmd_parse_xehp_and_later.inl"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Copyright (C) 2021 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
if(TESTS_DG2)
8+
set(IGDRCL_SRCS_tests_xe_hpg_core_dg2_excludes
9+
${CMAKE_CURRENT_SOURCE_DIR}/excludes_dg2.cpp
10+
)
11+
set_property(GLOBAL APPEND PROPERTY IGDRCL_SRCS_tests_excludes ${IGDRCL_SRCS_tests_xe_hpg_core_dg2_excludes})
12+
13+
set(NEO_CORE_TESTS_XE_HPG_CORE_DG2
14+
${IGDRCL_SRCS_tests_xe_hpg_core_dg2_excludes}
15+
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
16+
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_dispatch_kernel_dg2.cpp
17+
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_dg2.cpp
18+
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_helper_dg2.cpp
19+
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_dg2.cpp
20+
)
21+
22+
target_sources(${TARGET_NAME} PRIVATE ${NEO_CORE_TESTS_XE_HPG_CORE_DG2})
23+
endif()
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (C) 2021 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "test.h"
9+
10+
HWTEST_EXCLUDE_PRODUCT(CommandEncodeStatesTest, givenSlmTotalSizeEqualZeroWhenDispatchingKernelThenSharedMemorySizeIsSetCorrectly, IGFX_DG2);

0 commit comments

Comments
 (0)