File: sysman_os_engine_imp.h

package info (click to toggle)
intel-compute-runtime 25.44.36015.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 79,632 kB
  • sloc: cpp: 931,547; lisp: 2,074; sh: 719; makefile: 162; python: 21
file content (67 lines) | stat: -rw-r--r-- 1,931 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * Copyright (C) 2020-2025 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 */

#pragma once
#include "shared/source/helpers/non_copyable_or_moveable.h"
#include "shared/source/os_interface/linux/drm_neo.h"

#include "level_zero/sysman/source/api/engine/sysman_os_engine.h"
#include "level_zero/sysman/source/device/sysman_device_imp.h"

#include <unistd.h>

namespace NEO {
class Drm;
} // namespace NEO

namespace L0 {
namespace Sysman {

class SysmanKmdInterface;
class PmuInterface;
class LinuxSysmanImp;
struct Device;

struct EngineGroupInfo {
    zes_engine_group_t engineGroup;
    uint32_t engineInstance;
    uint32_t tileId;
};
struct OsSysman;
struct SysmanDeviceImp;

class LinuxEngineImp : public OsEngine, NEO::NonCopyableAndNonMovableClass {
  public:
    ze_result_t getActivity(zes_engine_stats_t *pStats) override;
    ze_result_t getActivityExt(uint32_t *pCount, zes_engine_stats_t *pStats) override {
        return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
    }
    ze_result_t getProperties(zes_engine_properties_t &properties) override;
    bool isEngineModuleSupported() override;
    static zes_engine_group_t getGroupFromEngineType(zes_engine_group_t type);
    LinuxEngineImp() = default;
    LinuxEngineImp(OsSysman *pOsSysman, MapOfEngineInfo &mapEngineInfo, zes_engine_group_t type, uint32_t engineInstance, uint32_t tileId, ze_bool_t onSubDevice);
    ~LinuxEngineImp() override;
    void cleanup();

  protected:
    SysmanKmdInterface *pSysmanKmdInterface = nullptr;
    LinuxSysmanImp *pLinuxSysmanImp = nullptr;
    EngineGroupInfo engineGroupInfo = {};
    PmuInterface *pPmuInterface = nullptr;
    NEO::Drm *pDrm = nullptr;
    SysmanDeviceImp *pDevice = nullptr;
    ze_bool_t onSubDevice = false;

  private:
    void init(MapOfEngineInfo &mapEngineInfo);
    std::vector<int64_t> fdList{};
    ze_result_t initStatus = ZE_RESULT_SUCCESS;
};

} // namespace Sysman
} // namespace L0