Enable NodeMask Generation thru L0 LUID Extension

Related-To: LOCI-3250

Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
This commit is contained in:
Spruit, Neil R
2022-12-08 00:05:54 +00:00
committed by Compute-Runtime-Automation
parent aafe562bce
commit 4fce3ede9b
20 changed files with 75 additions and 25 deletions

View File

@@ -203,7 +203,7 @@ struct WddmLinuxTest : public ::testing::Test {
void SetUp() override {
osEnvironment = std::make_unique<NEO::OsEnvironmentWin>();
osEnvironment->gdi->closeAdapter = closeAdapterMock;
auto hwDeviceIdIn = std::make_unique<WddmLinuxMockHwDeviceIdWddm>(NULL_HANDLE, LUID{}, osEnvironment.get(), std::make_unique<NEO::UmKmDataTranslator>());
auto hwDeviceIdIn = std::make_unique<WddmLinuxMockHwDeviceIdWddm>(NULL_HANDLE, LUID{}, 1u, osEnvironment.get(), std::make_unique<NEO::UmKmDataTranslator>());
this->hwDeviceId = hwDeviceIdIn.get();
auto &rootDeviceEnvironment = *mockExecEnv.rootDeviceEnvironments[0];
auto wddm = std::make_unique<MockWddmLinux>(std::move(hwDeviceIdIn), rootDeviceEnvironment);
@@ -685,7 +685,7 @@ TEST(OSTimeWinLinuxTests, givenOSInterfaceWhenGetCpuGpuTimeThenGetCpuTimeFromOsT
osEnvironment->gdi->reserveGpuVirtualAddress = reserveDeviceAddressSpaceMock;
NEO::MockExecutionEnvironment mockExecEnv;
NEO::MockRootDeviceEnvironment mockRootDeviceEnvironment{mockExecEnv};
hwDeviceIdIn.reset(new NEO::HwDeviceIdWddm(NULL_HANDLE, LUID{}, osEnvironment.get(), std::make_unique<NEO::UmKmDataTranslator>()));
hwDeviceIdIn.reset(new NEO::HwDeviceIdWddm(NULL_HANDLE, LUID{}, 1u, osEnvironment.get(), std::make_unique<NEO::UmKmDataTranslator>()));
std::unique_ptr<NEO::OSInterface> osInterface(new NEO::OSInterface());

View File

@@ -12,12 +12,12 @@
#include "shared/test/common/test_macros/hw_test.h"
namespace NEO {
std::unique_ptr<HwDeviceIdWddm> createHwDeviceIdFromAdapterLuid(OsEnvironmentWin &osEnvironment, LUID adapterLuid);
std::unique_ptr<HwDeviceIdWddm> createHwDeviceIdFromAdapterLuid(OsEnvironmentWin &osEnvironment, LUID adapterLuid, uint32_t adapterNodeOrdinal);
using WddmOsContextDeviceLuidTests = WddmFixtureLuid;
TEST_F(WddmFixtureLuid, givenValidOsContextAndLuidDataRequestThenValidDataReturned) {
LUID adapterLuid = {0x12, 0x1234};
wddm->hwDeviceId = NEO::createHwDeviceIdFromAdapterLuid(*osEnvironment, adapterLuid);
wddm->hwDeviceId = NEO::createHwDeviceIdFromAdapterLuid(*osEnvironment, adapterLuid, 1u);
std::vector<uint8_t> luidData;
size_t arraySize = 8;
osContext->getDeviceLuidArray(luidData, arraySize);
@@ -25,4 +25,10 @@ TEST_F(WddmFixtureLuid, givenValidOsContextAndLuidDataRequestThenValidDataReturn
memcpy_s(&luid, sizeof(uint64_t), luidData.data(), sizeof(uint8_t) * luidData.size());
EXPECT_NE(luid, (uint64_t)0);
}
TEST_F(WddmFixtureLuid, givenValidOsContextAndGetDeviceNodeMaskThenValidDataReturned) {
LUID adapterLuid = {0x12, 0x1234};
wddm->hwDeviceId = NEO::createHwDeviceIdFromAdapterLuid(*osEnvironment, adapterLuid, 2u);
uint32_t adapterDeviceMask = osContext->getDeviceNodeMask();
EXPECT_EQ(adapterDeviceMask, (uint32_t)4);
}
} // namespace NEO

View File

@@ -13,7 +13,7 @@
#include "shared/test/common/test_macros/hw_test.h"
namespace NEO {
std::unique_ptr<HwDeviceIdWddm> createHwDeviceIdFromAdapterLuid(OsEnvironmentWin &osEnvironment, LUID adapterLuid);
std::unique_ptr<HwDeviceIdWddm> createHwDeviceIdFromAdapterLuid(OsEnvironmentWin &osEnvironment, LUID adapterLuid, uint32_t nodeMask);
using WddmTests = WddmTestWithMockGdiDll;
@@ -105,7 +105,7 @@ TEST(WddmPciSpeedInfoTest, WhenGetPciSpeedInfoIsCalledThenUnknownIsReturned) {
}
TEST_F(WddmTests, whenGetAdapterLuidThenLuidIsReturned) {
HwDeviceIdWddm *hwDeviceId = new HwDeviceIdWddm(0, {0, 0}, executionEnvironment->osEnvironment.get(), nullptr);
HwDeviceIdWddm *hwDeviceId = new HwDeviceIdWddm(0, {0, 0}, 1u, executionEnvironment->osEnvironment.get(), nullptr);
wddm->hwDeviceId.reset(hwDeviceId);
auto luid = wddm->getAdapterLuid();