mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 16:45:25 +08:00
Query engine info with distances
If prelim kernel is being used, query distances and set correctly number of available engines Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
54d377d025
commit
26a24e8fde
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/os_interface/linux/engine_info_impl.h"
|
||||
#include "shared/source/os_interface/linux/engine_info.h"
|
||||
#include "shared/test/common/libult/linux/drm_mock.h"
|
||||
|
||||
#include "level_zero/core/test/unit_tests/mock.h"
|
||||
@@ -54,7 +54,8 @@ struct Mock<EngineNeoDrm> : public EngineNeoDrm {
|
||||
i915engineInfo[5].engine.engineClass = I915_INVALID_ENGINE_CLASS;
|
||||
i915engineInfo[5].engine.engineInstance = 0;
|
||||
|
||||
this->engineInfo.reset(new EngineInfoImpl(i915engineInfo));
|
||||
NEO::HardwareInfo hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
||||
this->engineInfo.reset(new EngineInfo(this, &hwInfo, i915engineInfo));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -226,8 +226,11 @@ TEST_F(ZesEngineFixture, GivenValidOsSysmanPointerWhenRetrievingEngineTypeAndIns
|
||||
TEST_F(ZesEngineFixture, givenEngineInfoQuerySupportedWhenQueryingEngineInfoThenEngineInfoIsCreatedWithEngines) {
|
||||
auto drm = std::make_unique<DrmMockEngine>((const_cast<NEO::RootDeviceEnvironment &>(neoDevice->getRootDeviceEnvironment())));
|
||||
ASSERT_NE(nullptr, drm);
|
||||
std::vector<MemoryRegion> memRegions{
|
||||
{{I915_MEMORY_CLASS_SYSTEM, 0}, 1024, 0}};
|
||||
drm->memoryInfo.reset(new MemoryInfo(memRegions));
|
||||
drm->sysmanQueryEngineInfo();
|
||||
auto engineInfo = static_cast<EngineInfoImpl *>(drm->getEngineInfo());
|
||||
auto engineInfo = drm->getEngineInfo();
|
||||
ASSERT_NE(nullptr, engineInfo);
|
||||
EXPECT_EQ(2u, engineInfo->engines.size());
|
||||
}
|
||||
@@ -235,8 +238,11 @@ TEST_F(ZesEngineFixture, givenEngineInfoQuerySupportedWhenQueryingEngineInfoThen
|
||||
TEST_F(ZesEngineFixture, GivenEngineInfoWithVideoQuerySupportedWhenQueryingEngineInfoWithVideoThenEngineInfoIsCreatedWithEngines) {
|
||||
auto drm = std::make_unique<DrmMockEngine>((const_cast<NEO::RootDeviceEnvironment &>(neoDevice->getRootDeviceEnvironment())));
|
||||
ASSERT_NE(nullptr, drm);
|
||||
std::vector<MemoryRegion> memRegions{
|
||||
{{I915_MEMORY_CLASS_SYSTEM, 0}, 1024, 0}};
|
||||
drm->memoryInfo.reset(new MemoryInfo(memRegions));
|
||||
drm->sysmanQueryEngineInfo();
|
||||
auto engineInfo = static_cast<EngineInfoImpl *>(drm->getEngineInfo());
|
||||
auto engineInfo = drm->getEngineInfo();
|
||||
ASSERT_NE(nullptr, engineInfo);
|
||||
EXPECT_EQ(2u, engineInfo->engines.size());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user