mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
Add EngineInfo for Linux.
Related-To: NEO-3008 Change-Id: Ib9e1a241a5b47aad5e4f83443a3e85db826d13ff Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
This commit is contained in:
@@ -34,6 +34,7 @@ set(RUNTIME_SRCS_OS_INTERFACE_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/drm_neo_create.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/drm_query.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/drm_null_device.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/engine_info.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/linux_inc.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memory_info.h
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "runtime/os_interface/linux/engine_info.h"
|
||||
#include "runtime/os_interface/linux/memory_info.h"
|
||||
#include "runtime/utilities/api_intercept.h"
|
||||
|
||||
@@ -80,10 +81,11 @@ class Drm {
|
||||
bool useSimplifiedMocsTable = false;
|
||||
bool preemptionSupported = false;
|
||||
int fd;
|
||||
int deviceId;
|
||||
int revisionId;
|
||||
GTTYPE eGtType;
|
||||
Drm(int fd) : fd(fd), deviceId(0), revisionId(0), eGtType(GTTYPE_UNDEFINED) {}
|
||||
int deviceId = 0;
|
||||
int revisionId = 0;
|
||||
GTTYPE eGtType = GTTYPE_UNDEFINED;
|
||||
Drm(int fd) : fd(fd) {}
|
||||
std::unique_ptr<EngineInfo> engineInfo;
|
||||
std::unique_ptr<MemoryInfo> memoryInfo;
|
||||
|
||||
static bool isi915Version(int fd);
|
||||
|
||||
19
runtime/os_interface/linux/engine_info.h
Normal file
19
runtime/os_interface/linux/engine_info.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace NEO {
|
||||
|
||||
struct EngineInfo {
|
||||
EngineInfo() = default;
|
||||
virtual ~EngineInfo() = 0;
|
||||
};
|
||||
|
||||
inline EngineInfo::~EngineInfo() {}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -26,3 +26,10 @@ TEST(DrmTest, whenQueryingEngineInfoThenNoIoctlIsCalled) {
|
||||
drm->queryEngineInfo();
|
||||
EXPECT_EQ(0u, drm->ioctlCallsCount);
|
||||
}
|
||||
|
||||
TEST(EngineInfoTest, givenEngineInfoImplementationWhenDestructingThenDestructorIsCalled) {
|
||||
struct EngineInfoImpl : EngineInfo {
|
||||
~EngineInfoImpl() override = default;
|
||||
};
|
||||
EngineInfoImpl engineInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user