mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Dont create VM IDs if not supported
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
9839b3049d
commit
45b005161a
@ -1,10 +1,10 @@
|
||||
#
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
# Copyright (C) 2020-2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(SUPPORT_DG1)
|
||||
if(SUPPORT_DG1 AND "${BRANCH_TYPE}" STREQUAL "")
|
||||
set(L0_SRCS_TOOLS_SYSMAN_MEMORY_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dg1${BRANCH_DIR_SUFFIX}/os_memory_imp.cpp
|
||||
|
@ -1,10 +1,10 @@
|
||||
#
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
# Copyright (C) 2020-2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(SUPPORT_DG1)
|
||||
if(SUPPORT_DG1 AND "${BRANCH_TYPE}" STREQUAL "")
|
||||
set(L0_TESTS_TOOLS_SYSMAN_MEMORY_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dg1/mock_memory.h
|
||||
|
@ -99,10 +99,12 @@ Drm *Drm::create(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &
|
||||
}
|
||||
|
||||
if (!drmObject->queryMemoryInfo()) {
|
||||
drmObject->setPerContextVMRequired(true);
|
||||
printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to query memory info\n");
|
||||
}
|
||||
|
||||
if (!drmObject->queryEngineInfo()) {
|
||||
drmObject->setPerContextVMRequired(true);
|
||||
printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to query engine info\n");
|
||||
}
|
||||
|
||||
|
@ -459,6 +459,10 @@ TEST_F(DrmTests, whenDrmIsCreatedWithMultipleSubDevicesThenCreateMultipleVirtual
|
||||
auto drm = DrmWrap::createDrm(*rootDeviceEnvironment);
|
||||
EXPECT_NE(drm, nullptr);
|
||||
|
||||
if (drm->isPerContextVMRequired()) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
auto numSubDevices = HwHelper::getSubDevicesCount(rootDeviceEnvironment->getHardwareInfo());
|
||||
for (auto id = 0u; id < numSubDevices; id++) {
|
||||
EXPECT_EQ(id + 1, drm->getVirtualMemoryAddressSpace(id));
|
||||
@ -499,7 +503,12 @@ TEST_F(DrmTests, givenEnabledDebuggingAndVmBindNotAvailableWhenDrmIsCreatedThenP
|
||||
|
||||
auto drm = DrmWrap::createDrm(*rootDeviceEnvironment);
|
||||
EXPECT_NE(drm, nullptr);
|
||||
EXPECT_FALSE(drm->isPerContextVMRequired());
|
||||
|
||||
if (drm->isPerContextVMRequired()) {
|
||||
::testing::internal::GetCapturedStdout();
|
||||
::testing::internal::GetCapturedStderr();
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
auto numSubDevices = HwHelper::getSubDevicesCount(rootDeviceEnvironment->getHardwareInfo());
|
||||
for (auto id = 0u; id < numSubDevices; id++) {
|
||||
@ -531,7 +540,10 @@ TEST_F(DrmTests, givenDrmIsCreatedWhenCreateVirtualMemoryFailsThenReturnVirtualM
|
||||
EXPECT_EQ(0u, static_cast<DrmWrap *>(drm.get())->virtualMemoryIds.size());
|
||||
|
||||
std::string errStr = ::testing::internal::GetCapturedStderr();
|
||||
EXPECT_THAT(errStr, ::testing::HasSubstr(std::string("INFO: Device doesn't support GEM Virtual Memory")));
|
||||
if (!drm->isPerContextVMRequired()) {
|
||||
|
||||
EXPECT_THAT(errStr, ::testing::HasSubstr(std::string("INFO: Device doesn't support GEM Virtual Memory")));
|
||||
}
|
||||
::testing::internal::GetCapturedStdout();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
* Copyright (C) 2019-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -9,7 +9,8 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
struct MemoryInfo {
|
||||
class MemoryInfo {
|
||||
public:
|
||||
MemoryInfo() = default;
|
||||
virtual ~MemoryInfo() = 0;
|
||||
};
|
||||
|
Reference in New Issue
Block a user