File: driver_imp.h

package info (click to toggle)
intel-compute-runtime-legacy 24.35.30872.40-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 73,292 kB
  • sloc: cpp: 826,355; lisp: 3,686; sh: 677; makefile: 148; python: 21
file content (54 lines) | stat: -rw-r--r-- 1,111 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
/*
 * Copyright (C) 2020-2024 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 */

#pragma once

#include "level_zero/core/source/driver/driver.h"

#include <atomic>
#include <mutex>
#include <string>

namespace L0 {

class DriverImp : public Driver {
  public:
    ze_result_t driverInit(ze_init_flags_t flags) override;

    void initialize(ze_result_t *result) override;
    unsigned int getPid() const override {
        return pid;
    }
    ze_result_t initGtpin() override;

    enum class GtPinInitializationStatus {
        notNeeded,
        pending,
        inProgress,
        error
    };

  protected:
    uint32_t pid = 0;
    std::once_flag initDriverOnce;
    static ze_result_t initStatus;
    std::atomic<GtPinInitializationStatus> gtPinInitializationStatus{GtPinInitializationStatus::notNeeded};
    std::recursive_mutex gtpinInitMtx;
};

struct L0EnvVariables {
    std::string affinityMask;
    uint32_t programDebugging;
    bool metrics;
    bool pin;
    bool sysman;
    bool pciIdDeviceOrder;
    bool fp64Emulation;
    std::string deviceHierarchyMode;
};

} // namespace L0