-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bartosz Dunajski <[email protected]>
- Loading branch information
1 parent
b93fa8b
commit 0e75f43
Showing
7 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
opencl/test/unit_test/xe_hp_core/xehp/linux/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# Copyright (C) 2021 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
# | ||
|
||
set(IGDRCL_SRCS_tests_xe_hp_core_xehp_linux | ||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt | ||
) | ||
if(UNIX) | ||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_xe_hp_core_xehp_linux}) | ||
add_subdirectory(dll) | ||
endif() |
11 changes: 11 additions & 0 deletions
11
opencl/test/unit_test/xe_hp_core/xehp/linux/dll/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Copyright (C) 2021 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
# | ||
|
||
set(IGDRCL_SRCS_linux_dll_tests_xe_hp_core_xehp | ||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt | ||
${CMAKE_CURRENT_SOURCE_DIR}/device_id_tests_xehp.cpp | ||
) | ||
target_sources(igdrcl_linux_dll_tests PRIVATE ${IGDRCL_SRCS_linux_dll_tests_xe_hp_core_xehp}) |
32 changes: 32 additions & 0 deletions
32
opencl/test/unit_test/xe_hp_core/xehp/linux/dll/device_id_tests_xehp.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (C) 2021 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
*/ | ||
|
||
#include "shared/source/os_interface/linux/drm_neo.h" | ||
|
||
#include "test.h" | ||
|
||
using namespace NEO; | ||
|
||
TEST(XeHPDeviceIdTest, GivenSupportedDeviceIdThenConfigIsCorrect) { | ||
DeviceDescriptor expectedDescriptor = {0x0201, &XE_HP_SDV_CONFIG::hwInfo, &XE_HP_SDV_CONFIG::setupHardwareInfo, GTTYPE_GT4}; | ||
|
||
auto compareStructs = [](const DeviceDescriptor *first, const DeviceDescriptor *second) { | ||
return first->deviceId == second->deviceId && first->pHwInfo == second->pHwInfo && | ||
first->setupHardwareInfo == second->setupHardwareInfo && first->eGtType == second->eGtType; | ||
}; | ||
|
||
bool found = false; | ||
|
||
for (size_t i = 0; deviceDescriptorTable[i].deviceId != 0; i++) { | ||
if (compareStructs(&expectedDescriptor, &deviceDescriptorTable[i])) { | ||
found = true; | ||
break; | ||
} | ||
}; | ||
|
||
EXPECT_TRUE(found); | ||
} |
11 changes: 11 additions & 0 deletions
11
opencl/test/unit_test/xe_hpg_core/dg2/linux/dll/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Copyright (C) 2021 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
# | ||
|
||
set(IGDRCL_SRCS_linux_dll_tests_xe_hpg_core_dg2 | ||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt | ||
${CMAKE_CURRENT_SOURCE_DIR}/${BRANCH_DIR_SUFFIX}/device_id_tests_dg2.cpp | ||
) | ||
target_sources(igdrcl_linux_dll_tests PRIVATE ${IGDRCL_SRCS_linux_dll_tests_xe_hpg_core_dg2}) |
38 changes: 38 additions & 0 deletions
38
opencl/test/unit_test/xe_hpg_core/dg2/linux/dll/device_id_tests_dg2.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (C) 2021 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
*/ | ||
|
||
#include "shared/source/os_interface/linux/drm_neo.h" | ||
|
||
#include "test.h" | ||
|
||
#include <array> | ||
|
||
using namespace NEO; | ||
|
||
TEST(Dg2AdditionalDeviceIdTest, GivenSupportedDeviceIdThenDeviceDescriptorTableExists) { | ||
std::array<DeviceDescriptor, 2> expectedDescriptors = {{ | ||
{0x4F80, &DG2_CONFIG::hwInfo, &DG2_CONFIG::setupHardwareInfo, GTTYPE_GT4}, | ||
{0x4F87, &DG2_CONFIG::hwInfo, &DG2_CONFIG::setupHardwareInfo, GTTYPE_GT4}, | ||
}}; | ||
|
||
auto compareStructs = [](const DeviceDescriptor *first, const DeviceDescriptor *second) { | ||
return first->deviceId == second->deviceId && first->pHwInfo == second->pHwInfo && | ||
first->setupHardwareInfo == second->setupHardwareInfo && first->eGtType == second->eGtType; | ||
}; | ||
|
||
size_t startIndex = 0; | ||
while (!compareStructs(&expectedDescriptors[0], &deviceDescriptorTable[startIndex]) && | ||
deviceDescriptorTable[startIndex].deviceId != 0) { | ||
startIndex++; | ||
}; | ||
EXPECT_NE(0u, deviceDescriptorTable[startIndex].deviceId); | ||
|
||
for (auto &expected : expectedDescriptors) { | ||
EXPECT_TRUE(compareStructs(&expected, &deviceDescriptorTable[startIndex])); | ||
startIndex++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters