2021-02-24 01:57:27 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <level_zero/zet_api.h>
|
|
|
|
|
|
|
|
struct _zet_debug_session_handle_t {};
|
|
|
|
|
|
|
|
namespace L0 {
|
|
|
|
|
|
|
|
struct Device;
|
|
|
|
|
|
|
|
struct DebugSession : _zet_debug_session_handle_t {
|
|
|
|
virtual ~DebugSession() = default;
|
|
|
|
DebugSession() = delete;
|
|
|
|
|
|
|
|
static DebugSession *create(const zet_debug_config_t &config, Device *device);
|
|
|
|
|
|
|
|
static DebugSession *fromHandle(zet_debug_session_handle_t handle) { return static_cast<DebugSession *>(handle); }
|
|
|
|
inline zet_debug_session_handle_t toHandle() { return this; }
|
|
|
|
|
2021-03-03 20:09:39 +08:00
|
|
|
virtual bool closeConnection() = 0;
|
|
|
|
|
|
|
|
Device *getConnectedDevice() { return connectedDevice; }
|
|
|
|
|
2021-02-24 01:57:27 +08:00
|
|
|
protected:
|
2021-03-03 20:09:39 +08:00
|
|
|
DebugSession(const zet_debug_config_t &config, Device *device) : connectedDevice(device){};
|
|
|
|
Device *connectedDevice = nullptr;
|
2021-02-24 01:57:27 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace L0
|