mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 16:45:25 +08:00
feature: add appendMarker support for oa
Related-To: NEO-13784 Signed-off-by: Joshua Santosh Ranjan <joshua.santosh.ranjan@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3f9ac1512d
commit
c3ecf13fe1
@@ -400,6 +400,31 @@ ze_result_t OaMetricSourceImp::metricProgrammableGet(uint32_t *pCount, zet_metri
|
||||
return getMetricEnumeration().metricProgrammableGet(pCount, phMetricProgrammables);
|
||||
}
|
||||
|
||||
ze_result_t OaMetricSourceImp::appendMarker(zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value) {
|
||||
|
||||
auto commandListImp = static_cast<CommandListImp *>(CommandList::fromHandle(hCommandList));
|
||||
DeviceImp *pDeviceImp = static_cast<DeviceImp *>(commandListImp->getDevice());
|
||||
|
||||
if (pDeviceImp->metricContext->isImplicitScalingCapable()) {
|
||||
// Use one of the sub-device contexts to append to command list.
|
||||
pDeviceImp = static_cast<DeviceImp *>(pDeviceImp->subDevices[0]);
|
||||
}
|
||||
|
||||
OaMetricSourceImp &metricSource = pDeviceImp->metricContext->getMetricSource<OaMetricSourceImp>();
|
||||
auto &metricsLibrary = metricSource.getMetricsLibrary();
|
||||
|
||||
// Obtain gpu commands.
|
||||
CommandBufferData_1_0 commandBuffer = {};
|
||||
commandBuffer.CommandsType = MetricsLibraryApi::ObjectType::MarkerStreamUser;
|
||||
commandBuffer.MarkerStreamUser.Value = value;
|
||||
commandBuffer.Type = metricSource.isComputeUsed()
|
||||
? MetricsLibraryApi::GpuCommandBufferType::Compute
|
||||
: MetricsLibraryApi::GpuCommandBufferType::Render;
|
||||
|
||||
return metricsLibrary.getGpuCommands(*commandListImp, commandBuffer) ? ZE_RESULT_SUCCESS
|
||||
: ZE_RESULT_ERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
template <>
|
||||
OaMetricSourceImp &MetricDeviceContext::getMetricSource<OaMetricSourceImp>() const {
|
||||
return static_cast<OaMetricSourceImp &>(*metricSources.at(MetricSource::metricSourceTypeOa));
|
||||
|
||||
@@ -59,9 +59,7 @@ class OaMetricSourceImp : public MetricSource {
|
||||
const char description[ZET_MAX_METRIC_GROUP_DESCRIPTION],
|
||||
uint32_t *maxMetricGroupCount,
|
||||
std::vector<zet_metric_group_handle_t> &metricGroupList) override;
|
||||
ze_result_t appendMarker(zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value) override {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
ze_result_t appendMarker(zet_command_list_handle_t hCommandList, zet_metric_group_handle_t hMetricGroup, uint32_t value) override;
|
||||
void metricGroupCreate(const char name[ZET_MAX_METRIC_GROUP_NAME],
|
||||
const char description[ZET_MAX_METRIC_GROUP_DESCRIPTION],
|
||||
zet_metric_group_sampling_type_flag_t samplingType,
|
||||
|
||||
@@ -328,27 +328,8 @@ ze_result_t OaMetricGroupImp::streamerOpen(
|
||||
}
|
||||
|
||||
ze_result_t OaMetricStreamerImp::appendStreamerMarker(CommandList &commandList, uint32_t value) {
|
||||
|
||||
DeviceImp *pDeviceImp = static_cast<DeviceImp *>(commandList.getDevice());
|
||||
|
||||
if (pDeviceImp->metricContext->isImplicitScalingCapable()) {
|
||||
// Use one of the sub-device contexts to append to command list.
|
||||
pDeviceImp = static_cast<DeviceImp *>(pDeviceImp->subDevices[0]);
|
||||
}
|
||||
|
||||
OaMetricSourceImp &metricSource = pDeviceImp->metricContext->getMetricSource<OaMetricSourceImp>();
|
||||
auto &metricsLibrary = metricSource.getMetricsLibrary();
|
||||
|
||||
// Obtain gpu commands.
|
||||
CommandBufferData_1_0 commandBuffer = {};
|
||||
commandBuffer.CommandsType = ObjectType::MarkerStreamUser;
|
||||
commandBuffer.MarkerStreamUser.Value = value;
|
||||
commandBuffer.Type = metricSource.isComputeUsed()
|
||||
? GpuCommandBufferType::Compute
|
||||
: GpuCommandBufferType::Render;
|
||||
|
||||
return metricsLibrary.getGpuCommands(commandList, commandBuffer) ? ZE_RESULT_SUCCESS
|
||||
: ZE_RESULT_ERROR_UNKNOWN;
|
||||
auto &metricSource = commandList.getDevice()->getMetricDeviceContext().getMetricSource<OaMetricSourceImp>();
|
||||
return metricSource.appendMarker(commandList.toHandle(), hMetricGroup, value);
|
||||
}
|
||||
|
||||
} // namespace L0
|
||||
|
||||
Reference in New Issue
Block a user