mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 21:27:04 +08:00
feature: Add support for 64 bit memory counters for zesInit
Related-To: LOCI-4613, LOCI-4612 Signed-off-by: Mayank Raghuwanshi <mayank.raghuwanshi@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c3ca3ff119
commit
af6798f257
@@ -17,6 +17,4 @@ target_sources(${L0_STATIC_LIB_NAME}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/zex_memory.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/zex_module.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/zex_module.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/zex_sysman_memory.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/zex_sysman_memory.cpp
|
||||
)
|
||||
|
||||
@@ -22,6 +22,5 @@
|
||||
#include "zex_driver.h"
|
||||
#include "zex_memory.h"
|
||||
#include "zex_module.h"
|
||||
#include "zex_sysman_memory.h"
|
||||
|
||||
#endif // _ZEX_API_H
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "level_zero/api/driver_experimental/public/zex_sysman_memory.h"
|
||||
|
||||
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
||||
#include "level_zero/core/source/driver/driver.h"
|
||||
#include "level_zero/core/source/driver/driver_handle.h"
|
||||
#include "level_zero/sysman/source/sysman_device.h"
|
||||
#include "level_zero/sysman/source/sysman_driver.h"
|
||||
#include "level_zero/sysman/source/sysman_driver_handle.h"
|
||||
#include "level_zero/tools/source/sysman/memory/memory.h"
|
||||
#include "level_zero/tools/source/sysman/sysman.h"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
ze_result_t ZE_APICALL
|
||||
zexSysmanMemoryGetBandwidth(
|
||||
zes_mem_handle_t hMemory,
|
||||
uint64_t *pReadCounters,
|
||||
uint64_t *pWriteCounters,
|
||||
uint64_t *pMaxBandwidth,
|
||||
uint64_t timeout) {
|
||||
if (L0::sysmanInitFromCore) {
|
||||
return L0::Memory::fromHandle(hMemory)->memoryGetBandwidthEx(pReadCounters, pWriteCounters, pMaxBandwidth, timeout);
|
||||
}
|
||||
return L0::Sysman::Memory::fromHandle(hMemory)->memoryGetBandwidthEx(pReadCounters, pWriteCounters, pMaxBandwidth, timeout);
|
||||
}
|
||||
|
||||
} // namespace L0
|
||||
|
||||
extern "C" {
|
||||
|
||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||
zexSysmanMemoryGetBandwidth(
|
||||
zes_mem_handle_t hMemory,
|
||||
uint64_t *pReadCounters,
|
||||
uint64_t *pWriteCounters,
|
||||
uint64_t *pMaxBandwidth,
|
||||
uint64_t timeout) {
|
||||
return L0::zexSysmanMemoryGetBandwidth(hMemory, pReadCounters, pWriteCounters, pMaxBandwidth, timeout);
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ZEX_SYSMAN_MEMORY_H
|
||||
#define _ZEX_SYSMAN_MEMORY_H
|
||||
#if defined(__cplusplus)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
||||
|
||||
namespace L0 {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Get memory bandwidth
|
||||
///
|
||||
/// @details
|
||||
/// - The application may call this function from simultaneous threads.
|
||||
/// - The implementation of this function should be lock-free.
|
||||
///
|
||||
/// @returns
|
||||
/// - ::ZE_RESULT_SUCCESS
|
||||
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
|
||||
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
|
||||
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
|
||||
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
|
||||
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
|
||||
/// + `nullptr == hMemory`
|
||||
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
|
||||
/// + `nullptr == pBandwidth`
|
||||
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
|
||||
/// + User does not have permissions to query this telemetry.
|
||||
ze_result_t ZE_APICALL
|
||||
zexSysmanMemoryGetBandwidth(
|
||||
zes_mem_handle_t hMemory, ///<[in] Handleforthecomponent.
|
||||
uint64_t *pReadCounters, ///<[out] Total bytes read from memory in duration
|
||||
uint64_t *pWriteCounters, ///<[out] Total bytes written to memory in duration
|
||||
uint64_t *pMaxBandwidth, ///<[out] Maximum bandwidth in units of bytes/sec
|
||||
uint64_t duration ///<[in] duration in milliseconds
|
||||
);
|
||||
|
||||
} // namespace L0
|
||||
#endif
|
||||
Reference in New Issue
Block a user