mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
devices.m separation for Linux
Change-Id: Ia8e430db4dfcefc1b19e23e9cd7113bf87f0a7af
This commit is contained in:

committed by
sys_ocldev

parent
6ef0581a02
commit
bdee42ca16
@ -170,6 +170,7 @@ foreach(GEN_NUM RANGE 0 ${MAX_GEN} 1)
|
||||
if(NOT MSVC)
|
||||
list (APPEND IGDRCL_SRCS_tests ${IGDRCL_SRCS_tests_gen${GEN_NUM}_linux})
|
||||
source_group("gen${GEN_NUM}\\linux" FILES ${IGDRCL_SRCS_tests_gen${GEN_NUM}_linux})
|
||||
list (APPEND IGDRCL_SRCS_linux_dll_tests ${IGDRCL_SRCS_linux_dll_tests_gen${GEN_NUM}})
|
||||
else(NOT MSVC)
|
||||
list (APPEND IGDRCL_SRCS_tests ${IGDRCL_SRCS_tests_gen${GEN_NUM}_windows})
|
||||
source_group("gen${GEN_NUM}\\windows" FILES ${IGDRCL_SRCS_tests_gen${GEN_NUM}_windows})
|
||||
@ -266,6 +267,7 @@ else()
|
||||
${KHRONOS_HEADERS_DIR}
|
||||
${IGDRCL__IGC_INCLUDE_DIR}
|
||||
${THIRD_PARTY_DIR}
|
||||
${IGDRCL_SOURCE_DIR}/runtime/dll/linux/devices${BRANCH_DIR_SUFFIX}
|
||||
)
|
||||
target_include_directories(igdrcl_linux_dll_tests PRIVATE
|
||||
${GTEST_INCLUDE_DIR}
|
||||
@ -276,6 +278,7 @@ else()
|
||||
${KHRONOS_HEADERS_DIR}
|
||||
${IGDRCL__IGC_INCLUDE_DIR}
|
||||
${THIRD_PARTY_DIR}
|
||||
${IGDRCL_SOURCE_DIR}/runtime/dll/linux/devices${BRANCH_DIR_SUFFIX}
|
||||
)
|
||||
endif(MSVC)
|
||||
|
||||
|
@ -44,6 +44,10 @@ if(NOT MSVC)
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/linux/drm_mapper_tests.cpp"
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
list(APPEND IGDRCL_SRCS_linux_dll_tests_gen8
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/linux/dll/device_id_tests.cpp
|
||||
)
|
||||
endif(NOT MSVC)
|
||||
|
||||
if(MSVC)
|
||||
@ -51,4 +55,9 @@ if(MSVC)
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/windows/wddm_mapper_tests.cpp"
|
||||
PARENT_SCOPE
|
||||
)
|
||||
else()
|
||||
set(IGDRCL_SRCS_linux_dll_tests_gen8
|
||||
${IGDRCL_SRCS_linux_dll_tests_gen8}
|
||||
PARENT_SCOPE
|
||||
)
|
||||
endif(MSVC)
|
||||
|
60
unit_tests/gen8/linux/dll/device_id_tests.cpp
Normal file
60
unit_tests/gen8/linux/dll/device_id_tests.cpp
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hw_cmds.h"
|
||||
#include "runtime/os_interface/linux/drm_neo.h"
|
||||
#include "test.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
TEST(BdwDeviceIdTest, supportedDeviceId) {
|
||||
std::array<DeviceDescriptor, 9> expectedDescriptors = {{
|
||||
{IBDW_GT1_HALO_MOBL_DEVICE_F0_ID, &BDW_1x2x6::hwInfo, &BDW_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{IBDW_GT1_ULT_MOBL_DEVICE_F0_ID, &BDW_1x2x6::hwInfo, &BDW_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{IBDW_GT2_HALO_MOBL_DEVICE_F0_ID, &BDW_1x3x8::hwInfo, &BDW_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{IBDW_GT2_ULT_MOBL_DEVICE_F0_ID, &BDW_1x3x8::hwInfo, &BDW_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{IBDW_GT2_ULX_DEVICE_F0_ID, &BDW_1x3x8::hwInfo, &BDW_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{IBDW_GT3_HALO_MOBL_DEVICE_F0_ID, &BDW_2x3x8::hwInfo, &BDW_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{IBDW_GT3_ULT_MOBL_DEVICE_F0_ID, &BDW_2x3x8::hwInfo, &BDW_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{IBDW_GT3_SERV_DEVICE_F0_ID, &BDW_2x3x8::hwInfo, &BDW_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{IBDW_GT3_ULT25W_MOBL_DEVICE_F0_ID, &BDW_2x3x8::hwInfo, &BDW_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
}};
|
||||
|
||||
auto compareStructs = [](const DeviceDescriptor *first, const DeviceDescriptor *second) {
|
||||
return first->deviceId == second->deviceId && first->pHwInfo == second->pHwInfo &&
|
||||
first->setupGtSystemInfo == second->setupGtSystemInfo && 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++;
|
||||
}
|
||||
}
|
@ -57,6 +57,10 @@ if(TESTS_SKL)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/skl/linux/hw_info_config_tests.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
list(APPEND IGDRCL_SRCS_linux_dll_tests_gen9
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/skl/linux/dll/device_id_tests.cpp
|
||||
)
|
||||
endif(NOT MSVC)
|
||||
endif()
|
||||
|
||||
@ -83,6 +87,10 @@ if(TESTS_CFL)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cfl/linux/hw_info_config_tests.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
list(APPEND IGDRCL_SRCS_linux_dll_tests_gen9
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cfl/linux/dll/device_id_tests.cpp
|
||||
)
|
||||
endif(NOT MSVC)
|
||||
endif()
|
||||
|
||||
@ -97,6 +105,10 @@ if(TESTS_BXT)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/bxt/linux/hw_info_config_tests.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
list(APPEND IGDRCL_SRCS_linux_dll_tests_gen9
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/bxt/linux/dll/device_id_tests.cpp
|
||||
)
|
||||
endif(NOT MSVC)
|
||||
endif()
|
||||
|
||||
@ -111,6 +123,10 @@ if(TESTS_KBL)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kbl/linux/hw_info_config_tests.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
list(APPEND IGDRCL_SRCS_linux_dll_tests_gen9
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kbl/linux/dll/device_id_tests.cpp
|
||||
)
|
||||
endif(NOT MSVC)
|
||||
endif()
|
||||
|
||||
@ -120,4 +136,9 @@ if(MSVC)
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/windows/os_interface_tests.cpp"
|
||||
PARENT_SCOPE
|
||||
)
|
||||
else()
|
||||
set(IGDRCL_SRCS_linux_dll_tests_gen9
|
||||
${IGDRCL_SRCS_linux_dll_tests_gen9}
|
||||
PARENT_SCOPE
|
||||
)
|
||||
endif(MSVC)
|
||||
|
53
unit_tests/gen9/bxt/linux/dll/device_id_tests.cpp
Normal file
53
unit_tests/gen9/bxt/linux/dll/device_id_tests.cpp
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hw_cmds.h"
|
||||
#include "runtime/os_interface/linux/drm_neo.h"
|
||||
#include "test.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
TEST(BxtDeviceIdTest, supportedDeviceId) {
|
||||
std::array<DeviceDescriptor, 2> expectedDescriptors = {{
|
||||
{IBXT_P_3x6_DEVICE_ID, &BXT_1x3x6::hwInfo, &BXT_1x3x6::setupGtSystemInfo, GTTYPE_GTA},
|
||||
{IBXT_P_12EU_3x6_DEVICE_ID, &BXT_1x2x6::hwInfo, &BXT_1x2x6::setupGtSystemInfo, GTTYPE_GTA},
|
||||
}};
|
||||
|
||||
auto compareStructs = [](const DeviceDescriptor *first, const DeviceDescriptor *second) {
|
||||
return first->deviceId == second->deviceId && first->pHwInfo == second->pHwInfo &&
|
||||
first->setupGtSystemInfo == second->setupGtSystemInfo && 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++;
|
||||
}
|
||||
}
|
63
unit_tests/gen9/cfl/linux/dll/device_id_tests.cpp
Normal file
63
unit_tests/gen9/cfl/linux/dll/device_id_tests.cpp
Normal file
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hw_cmds.h"
|
||||
#include "runtime/os_interface/linux/drm_neo.h"
|
||||
#include "test.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
TEST(CflDeviceIdTest, supportedDeviceId) {
|
||||
std::array<DeviceDescriptor, 12> expectedDescriptors = {{
|
||||
{ICFL_GT1_DT_DEVICE_F0_ID, &CFL_1x2x6::hwInfo, &CFL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{ICFL_GT1_S61_DT_DEVICE_F0_ID, &CFL_1x2x6::hwInfo, &CFL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{ICFL_GT1_S41_DT_DEVICE_F0_ID, &CFL_1x2x6::hwInfo, &CFL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{ICFL_GT2_DT_DEVICE_F0_ID, &CFL_1x3x6::hwInfo, &CFL_1x3x6::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ICFL_GT2_S62_DT_DEVICE_F0_ID, &CFL_1x3x6::hwInfo, &CFL_1x3x6::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ICFL_GT2_HALO_DEVICE_F0_ID, &CFL_1x3x6::hwInfo, &CFL_1x3x6::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ICFL_GT2_SERV_DEVICE_F0_ID, &CFL_1x3x6::hwInfo, &CFL_1x3x6::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ICFL_GT2_HALO_WS_DEVICE_F0_ID, &CFL_1x3x6::hwInfo, &CFL_1x3x6::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ICFL_GT2_S42_DT_DEVICE_F0_ID, &CFL_1x3x6::hwInfo, &CFL_1x3x6::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ICFL_GT3_ULT_15W_DEVICE_F0_ID, &CFL_2x3x8::hwInfo, &CFL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{ICFL_GT3_ULT_15W_42EU_DEVICE_F0_ID, &CFL_2x3x8::hwInfo, &CFL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{ICFL_GT3_ULT_DEVICE_F0_ID, &CFL_2x3x8::hwInfo, &CFL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
}};
|
||||
|
||||
auto compareStructs = [](const DeviceDescriptor *first, const DeviceDescriptor *second) {
|
||||
return first->deviceId == second->deviceId && first->pHwInfo == second->pHwInfo &&
|
||||
first->setupGtSystemInfo == second->setupGtSystemInfo && 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++;
|
||||
}
|
||||
}
|
76
unit_tests/gen9/kbl/linux/dll/device_id_tests.cpp
Normal file
76
unit_tests/gen9/kbl/linux/dll/device_id_tests.cpp
Normal file
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hw_cmds.h"
|
||||
#include "runtime/os_interface/linux/drm_neo.h"
|
||||
#include "test.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
TEST(KblDeviceIdTest, supportedDeviceId) {
|
||||
std::array<DeviceDescriptor, 25> expectedDescriptors = {{
|
||||
{IKBL_GT1_ULT_DEVICE_F0_ID, &KBL_1x2x6::hwInfo, &KBL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{IKBL_GT1_5_ULT_DEVICE_F0_ID, &KBL_1x3x6::hwInfo, &KBL_1x3x6::setupGtSystemInfo, GTTYPE_GT1_5},
|
||||
{IKBL_GT2_ULT_DEVICE_F0_ID, &KBL_1x3x8::hwInfo, &KBL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{IKBL_GT2F_ULT_DEVICE_F0_ID, &KBL_1x3x8::hwInfo, &KBL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{IKBL_GT3_15W_ULT_DEVICE_F0_ID, &KBL_2x3x8::hwInfo, &KBL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{IKBL_GT1_ULX_DEVICE_F0_ID, &KBL_1x3x6::hwInfo, &KBL_1x3x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{IKBL_GT1_5_ULX_DEVICE_F0_ID, &KBL_1x2x6::hwInfo, &KBL_1x2x6::setupGtSystemInfo, GTTYPE_GT1_5},
|
||||
{IKBL_GT2_ULX_DEVICE_F0_ID, &KBL_1x3x8::hwInfo, &KBL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{IKBL_GT1_DT_DEVICE_F0_ID, &KBL_1x2x6::hwInfo, &KBL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{IKBL_GT2_R_ULT_DEVICE_F0_ID, &KBL_1x3x8::hwInfo, &KBL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{IKBL_GT2_DT_DEVICE_F0_ID, &KBL_1x3x8::hwInfo, &KBL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{IKBL_GT1_HALO_DEVICE_F0_ID, &KBL_1x2x6::hwInfo, &KBL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{IKBL_GT1F_HALO_DEVICE_F0_ID, &KBL_1x2x6::hwInfo, &KBL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{IKBL_GT2_HALO_DEVICE_F0_ID, &KBL_1x3x8::hwInfo, &KBL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{IKBL_GT4_HALO_DEVICE_F0_ID, &KBL_3x3x8::hwInfo, &KBL_3x3x8::setupGtSystemInfo, GTTYPE_GT4},
|
||||
{IKBL_GT1_SERV_DEVICE_F0_ID, &KBL_1x2x6::hwInfo, &KBL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{IKBL_GT2_SERV_DEVICE_F0_ID, &KBL_1x3x8::hwInfo, &KBL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{IKBL_GT2_WRK_DEVICE_F0_ID, &KBL_1x3x8::hwInfo, &KBL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{IKBL_GT3_ULT_DEVICE_F0_ID, &KBL_2x3x8::hwInfo, &KBL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{IKBL_GT3_28W_ULT_DEVICE_F0_ID, &KBL_2x3x8::hwInfo, &KBL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{IKBL_GT4_DT_DEVICE_F0_ID, &KBL_3x3x8::hwInfo, &KBL_3x3x8::setupGtSystemInfo, GTTYPE_GT4},
|
||||
{IKBL_GT3_HALO_DEVICE_F0_ID, &KBL_2x3x8::hwInfo, &KBL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{IKBL_GT3_SERV_DEVICE_F0_ID, &KBL_2x3x8::hwInfo, &KBL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{IKBL_GT4_SERV_DEVICE_F0_ID, &KBL_3x3x8::hwInfo, &KBL_3x3x8::setupGtSystemInfo, GTTYPE_GT4},
|
||||
{IKBL_GT4_WRK_DEVICE_F0_ID, &KBL_3x3x8::hwInfo, &KBL_3x3x8::setupGtSystemInfo, GTTYPE_GT4},
|
||||
}};
|
||||
|
||||
auto compareStructs = [](const DeviceDescriptor *first, const DeviceDescriptor *second) {
|
||||
return first->deviceId == second->deviceId && first->pHwInfo == second->pHwInfo &&
|
||||
first->setupGtSystemInfo == second->setupGtSystemInfo && 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++;
|
||||
}
|
||||
}
|
81
unit_tests/gen9/skl/linux/dll/device_id_tests.cpp
Normal file
81
unit_tests/gen9/skl/linux/dll/device_id_tests.cpp
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hw_cmds.h"
|
||||
#include "runtime/os_interface/linux/drm_neo.h"
|
||||
#include "test.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
TEST(SklDeviceIdTest, supportedDeviceId) {
|
||||
std::array<DeviceDescriptor, 30> expectedDescriptors = {{
|
||||
{ISKL_GT1_DESK_DEVICE_F0_ID, &SKL_1x2x6::hwInfo, &SKL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{ISKL_GT1_DT_DEVICE_F0_ID, &SKL_1x2x6::hwInfo, &SKL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{ISKL_GT1_SERV_DEVICE_F0_ID, &SKL_1x2x6::hwInfo, &SKL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{ISKL_GT1_5_DT_DEVICE_F0_ID, &SKL_1x3x6::hwInfo, &SKL_1x3x6::setupGtSystemInfo, GTTYPE_GT1_5},
|
||||
{ISKL_GT2_DESK_DEVICE_F0_ID, &SKL_1x3x8::hwInfo, &SKL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ISKL_GT2_DT_DEVICE_F0_ID, &SKL_1x3x8::hwInfo, &SKL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ISKL_GT2_WRK_DEVICE_F0_ID, &SKL_1x3x8::hwInfo, &SKL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ISKL_GT2_SERV_DEVICE_F0_ID, &SKL_1x3x8::hwInfo, &SKL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ISKL_GT3_DESK_DEVICE_F0_ID, &SKL_2x3x8::hwInfo, &SKL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{ISKL_GT3_SERV_DEVICE_F0_ID, &SKL_2x3x8::hwInfo, &SKL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{ISKL_GT3_MEDIA_SERV_DEVICE_F0_ID, &SKL_2x3x8::hwInfo, &SKL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{ISKL_GT4_DESK_DEVICE_F0_ID, &SKL_3x3x8::hwInfo, &SKL_3x3x8::setupGtSystemInfo, GTTYPE_GT4},
|
||||
{ISKL_GT4_DT_DEVICE_F0_ID, &SKL_3x3x8::hwInfo, &SKL_3x3x8::setupGtSystemInfo, GTTYPE_GT4},
|
||||
{ISKL_GT4_WRK_DEVICE_F0_ID, &SKL_3x3x8::hwInfo, &SKL_3x3x8::setupGtSystemInfo, GTTYPE_GT4},
|
||||
{ISKL_GT4_SERV_DEVICE_F0_ID, &SKL_3x3x8::hwInfo, &SKL_3x3x8::setupGtSystemInfo, GTTYPE_GT4},
|
||||
{ISKL_GT2_ULT_DEVICE_F0_ID, &SKL_1x3x8::hwInfo, &SKL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ISKL_GT2F_ULT_DEVICE_F0_ID, &SKL_1x3x8::hwInfo, &SKL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ISKL_GT2_ULX_DEVICE_F0_ID, &SKL_1x3x8::hwInfo, &SKL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ISKL_GT1_ULT_DEVICE_F0_ID, &SKL_1x2x6::hwInfo, &SKL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{ISKL_GT1_ULX_DEVICE_F0_ID, &SKL_1x2x6::hwInfo, &SKL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{ISKL_GT1_5_ULT_DEVICE_F0_ID, &SKL_1x3x6::hwInfo, &SKL_1x3x6::setupGtSystemInfo, GTTYPE_GT1_5},
|
||||
{ISKL_GT1_5_ULX_DEVICE_F0_ID, &SKL_1x3x6::hwInfo, &SKL_1x3x6::setupGtSystemInfo, GTTYPE_GT1_5},
|
||||
{ISKL_GT3_ULT_DEVICE_F0_ID, &SKL_2x3x8::hwInfo, &SKL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{ISKL_GT3e_ULT_DEVICE_F0_ID_540, &SKL_2x3x8::hwInfo, &SKL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{ISKL_GT3e_ULT_DEVICE_F0_ID_550, &SKL_2x3x8::hwInfo, &SKL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{ISKL_GT1_HALO_MOBL_DEVICE_F0_ID, &SKL_1x2x6::hwInfo, &SKL_1x2x6::setupGtSystemInfo, GTTYPE_GT1},
|
||||
{ISKL_GT2_HALO_MOBL_DEVICE_F0_ID, &SKL_1x3x8::hwInfo, &SKL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
{ISKL_GT3_HALO_MOBL_DEVICE_F0_ID, &SKL_2x3x8::hwInfo, &SKL_2x3x8::setupGtSystemInfo, GTTYPE_GT3},
|
||||
{ISKL_GT4_HALO_MOBL_DEVICE_F0_ID, &SKL_3x3x8::hwInfo, &SKL_3x3x8::setupGtSystemInfo, GTTYPE_GT4},
|
||||
{ISKL_LP_DEVICE_F0_ID, &SKL_1x3x8::hwInfo, &SKL_1x3x8::setupGtSystemInfo, GTTYPE_GT2},
|
||||
}};
|
||||
|
||||
auto compareStructs = [](const DeviceDescriptor *first, const DeviceDescriptor *second) {
|
||||
return first->deviceId == second->deviceId && first->pHwInfo == second->pHwInfo &&
|
||||
first->setupGtSystemInfo == second->setupGtSystemInfo && 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++;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user