mirror of
https://github.com/intel/compute-runtime.git
synced 2025-06-28 17:58:30 +08:00

Change-Id: I1419231a721fab210e166d26a264cae04d661dcd Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com> Signed-off-by: macabral <matias.a.cabral@intel.com> Signed-off-by: davidoli <david.olien@intel.com> Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@intel.com> Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com> Signed-off-by: Latif, Raiyan <raiyan.latif@intel.com> Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include <level_zero/zes_api.h>
|
|
|
|
#include <vector>
|
|
|
|
struct _zes_mem_handle_t {
|
|
virtual ~_zes_mem_handle_t() = default;
|
|
};
|
|
|
|
namespace L0 {
|
|
|
|
struct OsSysman;
|
|
|
|
class Memory : _zes_mem_handle_t {
|
|
public:
|
|
virtual ze_result_t memoryGetProperties(zes_mem_properties_t *pProperties) = 0;
|
|
virtual ze_result_t memoryGetBandwidth(zes_mem_bandwidth_t *pBandwidth) = 0;
|
|
virtual ze_result_t memoryGetState(zes_mem_state_t *pState) = 0;
|
|
|
|
static Memory *fromHandle(zes_mem_handle_t handle) {
|
|
return static_cast<Memory *>(handle);
|
|
}
|
|
inline zes_mem_handle_t toHandle() { return this; }
|
|
};
|
|
|
|
struct MemoryHandleContext {
|
|
MemoryHandleContext(OsSysman *pOsSysman, ze_device_handle_t hCoreDevice) : pOsSysman(pOsSysman), hCoreDevice(hCoreDevice){};
|
|
~MemoryHandleContext();
|
|
|
|
ze_result_t init();
|
|
|
|
ze_result_t memoryGet(uint32_t *pCount, zes_mem_handle_t *phMemory);
|
|
|
|
OsSysman *pOsSysman = nullptr;
|
|
bool isLmemSupported = false;
|
|
std::vector<Memory *> handleList = {};
|
|
ze_device_handle_t hCoreDevice;
|
|
};
|
|
|
|
} // namespace L0
|