mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Add cl_khr_device_uuid to extension list
Related-To: NEO-5681 Signed-off-by: Baj, Tomasz <tomasz.baj@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d5b2f03dc4
commit
b450d3c20b
13
shared/test/unit_test/device/linux/CMakeLists.txt
Normal file
13
shared/test/unit_test/device/linux/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# Copyright (C) 2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(UNIX)
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/neo_device_linux_tests.cpp
|
||||
)
|
||||
endif()
|
||||
add_subdirectories()
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using DeviceTest = Test<DeviceFixture>;
|
||||
|
||||
TEST_F(DeviceTest, GivenDeviceWhenGetAdapterLuidThenLuidIsNotSet) {
|
||||
std::array<uint8_t, HwInfoConfig::luidSize> luid, expectedLuid;
|
||||
expectedLuid.fill(-1);
|
||||
luid = expectedLuid;
|
||||
pDevice->getAdapterLuid(luid);
|
||||
|
||||
EXPECT_EQ(expectedLuid, luid);
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, GivenDeviceWhenVerifyAdapterLuidThenFalseIsReturned) {
|
||||
EXPECT_FALSE(pDevice->verifyAdapterLuid());
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, GivenDeviceWhenGetAdapterMaskThenMaskIsNotSet) {
|
||||
uint32_t nodeMask = 0x1234u;
|
||||
pDevice->getAdapterMask(nodeMask);
|
||||
|
||||
EXPECT_EQ(nodeMask, 0x1234u);
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, GivenCallBaseVerifyAdapterLuidWhenGetAdapterMaskThenMaskIsSet) {
|
||||
uint32_t nodeMask = 0x1234u;
|
||||
pDevice->callBaseVerifyAdapterLuid = false;
|
||||
pDevice->getAdapterMask(nodeMask);
|
||||
|
||||
EXPECT_EQ(nodeMask, 1u);
|
||||
}
|
||||
13
shared/test/unit_test/device/windows/CMakeLists.txt
Normal file
13
shared/test/unit_test/device/windows/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# Copyright (C) 2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(WIN32)
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/neo_device_windows_tests.cpp
|
||||
)
|
||||
endif()
|
||||
add_subdirectories()
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/mocks/mock_wddm.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using DeviceTest = Test<DeviceFixture>;
|
||||
|
||||
TEST_F(DeviceTest, GivenDeviceWhenGetAdapterLuidThenLuidIsSet) {
|
||||
std::array<uint8_t, HwInfoConfig::luidSize> luid, expectedLuid;
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface);
|
||||
auto mockWddm = new WddmMock(*pDevice->executionEnvironment->rootDeviceEnvironments[0]);
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(mockWddm));
|
||||
|
||||
memcpy_s(expectedLuid.data(), HwInfoConfig::luidSize, &mockWddm->mockAdaperLuid, sizeof(LUID));
|
||||
pDevice->getAdapterLuid(luid);
|
||||
|
||||
EXPECT_EQ(expectedLuid, luid);
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, GivenDeviceWhenVerifyAdapterLuidThenTrueIsReturned) {
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface);
|
||||
auto mockWddm = new WddmMock(*pDevice->executionEnvironment->rootDeviceEnvironments[0]);
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(mockWddm));
|
||||
|
||||
EXPECT_TRUE(pDevice->verifyAdapterLuid());
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, GivenFailingVerifyAdapterLuidWhenGetAdapterMaskThenMaskIsNotSet) {
|
||||
uint32_t nodeMask = 0x1234u;
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface);
|
||||
auto mockWddm = new WddmMock(*pDevice->executionEnvironment->rootDeviceEnvironments[0]);
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(mockWddm));
|
||||
pDevice->callBaseVerifyAdapterLuid = false;
|
||||
pDevice->verifyAdapterLuidReturnValue = false;
|
||||
pDevice->getAdapterMask(nodeMask);
|
||||
|
||||
EXPECT_EQ(nodeMask, 0x1234u);
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, GivenDeviceWhenGetAdapterMaskThenMaskIsSet) {
|
||||
uint32_t nodeMask = 0x1234u;
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface);
|
||||
auto mockWddm = new WddmMock(*pDevice->executionEnvironment->rootDeviceEnvironments[0]);
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(mockWddm));
|
||||
pDevice->getAdapterMask(nodeMask);
|
||||
|
||||
EXPECT_EQ(nodeMask, 1u);
|
||||
}
|
||||
Reference in New Issue
Block a user