Skip to content

Commit bd119b8

Browse files
joshuaranjanpbg-intel
authored andcommitted
support previous version of MetricCreateFromProgrammable
Signed-off-by: Joshua Santosh Ranjan <[email protected]>
1 parent 7ef52fa commit bd119b8

File tree

2 files changed

+45
-9
lines changed

2 files changed

+45
-9
lines changed

scripts/tools/EXT_Exp_MetricProgrammable.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ API
3939
* ${t}MetricProgrammableGetPropertiesExp
4040
* ${t}MetricProgrammableGetParamInfoExp
4141
* ${t}MetricProgrammableGetParamValueInfoExp
42-
* ${t}MetricCreateFromProgrammableExp
42+
* ${t}MetricCreateFromProgrammable1Exp
4343
* ${t}DeviceCreateMetricGroupsFromMetricsExp
4444
* ${t}MetricGroupAddMetricExp
4545
* ${t}MetricGroupRemoveMetricExp
@@ -95,9 +95,9 @@ The following pseudo-code demonstrates how programmable metrics could be enumera
9595
// Create Metric
9696
char metricName[ZET_MAX_METRIC_NAME] = "eu_active_minimum";
9797
char metricDescription[ZET_MAX_METRIC_DESCRIPTION] = "eu_active_minimum_desc";
98-
${t}MetricCreateFromProgrammableExp(programmableHandle, &parameterValue, 1, metricName, metricDescription, &metricHandleCount, nullptr);
98+
${t}MetricCreateFromProgrammable1Exp(programmableHandle, &parameterValue, 1, metricName, metricDescription, &metricHandleCount, nullptr);
9999
${t}_metric_handle_t * metricHandles = allocate(sizeof(${t}_metric_handle_t) * metricHandleCount);
100-
${t}MetricCreateFromProgrammableExp(programmableHandle, &parameterValue, 1, metricName, metricDescription, &metricHandleCount, metricHandles);
100+
${t}MetricCreateFromProgrammable1Exp(programmableHandle, &parameterValue, 1, metricName, metricDescription, &metricHandleCount, metricHandles);
101101
}
102102
}
103103

scripts/tools/metricProgrammable.yml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ params:
358358
--- #--------------------------------------------------------------------------
359359
type: function
360360
desc: "Create metric handles by applying parameter values on the metric programmable handle."
361-
version: "1.9"
361+
version: "1.11"
362362
class: $tMetric
363-
name: CreateFromProgrammableExp
363+
name: CreateFromProgrammable1Exp
364364
decl: static
365365
details:
366366
- "Multiple parameter values could be used to prepare a metric."
@@ -397,13 +397,49 @@ params:
397397
if count is less than the number of metrics available, then driver shall only retrieve that number of metric handles.
398398
--- #--------------------------------------------------------------------------
399399
type: function
400+
desc: "Create metric handles by applying parameter values on the metric programmable handle."
401+
version: "1.11"
402+
class: $tMetric
403+
name: CreateFromProgrammableExp
404+
decl: static
405+
details:
406+
- "This API is deprecated. Please use $tMetricCreateFromProgrammable1Exp()"
407+
params:
408+
- type: $t_metric_programmable_exp_handle_t
409+
name: hMetricProgrammable
410+
desc: "[in] handle of the metric programmable"
411+
- type: $t_metric_programmable_param_value_exp_t*
412+
name: pParameterValues
413+
desc: "[in] list of parameter values to be set."
414+
- type: uint32_t
415+
name: parameterCount
416+
desc: "[in] Count of parameters to set."
417+
- type: "const char*"
418+
name: "pName"
419+
desc: "[in] pointer to metric name to be used. Must point to a null-terminated character array no longer than $T_MAX_METRIC_NAME."
420+
- type: "const char*"
421+
name: "pDescription"
422+
desc: "[in] pointer to metric description to be used. Must point to a null-terminated character array no longer than $T_MAX_METRIC_DESCRIPTION."
423+
- type: "uint32_t*"
424+
name: pMetricHandleCount
425+
desc: |
426+
[in,out] Pointer to the number of metric handles.
427+
if count is zero, then the driver shall update the value with the number of metric handles available for this programmable.
428+
if count is greater than the number of metric handles available, then the driver shall update the value with the correct number of metric handles available.
429+
- type: "$t_metric_handle_t*"
430+
name: phMetricHandles
431+
desc: |
432+
[in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics.
433+
if count is less than the number of metrics available, then driver shall only retrieve that number of metric handles.
434+
--- #--------------------------------------------------------------------------
435+
type: function
400436
desc: "Create multiple metric group handles from metric handles."
401437
version: "1.10"
402438
class: $tDevice
403439
name: CreateMetricGroupsFromMetricsExp
404440
decl: static
405441
details:
406-
- "Creates multiple metric groups from metrics which were created using $tMetricCreateFromProgrammableExp()."
442+
- "Creates multiple metric groups from metrics which were created using $tMetricCreateFromProgrammable1Exp()."
407443
- "Metrics whose Hardware resources do not overlap are added to same metric group."
408444
- "The metric groups created using this API are managed by the application and cannot be retrieved using $tMetricGroupGet()."
409445
- "The created metric groups are ready for activation and collection."
@@ -525,8 +561,8 @@ class: $tMetricGroup
525561
name: DestroyExp
526562
decl: static
527563
details:
528-
- "Metric handles created using $tMetricCreateFromProgrammableExp and are part of the metricGroup are not destroyed."
529-
- "It is necessary to call $tMetricDestroyExp for each of the metric handles (created from $tMetricCreateFromProgrammableExp) to destroy them."
564+
- "Metric handles created using $tMetricCreateFromProgrammable1Exp and are part of the metricGroup are not destroyed."
565+
- "It is necessary to call $tMetricDestroyExp for each of the metric handles (created from $tMetricCreateFromProgrammable1Exp) to destroy them."
530566
params:
531567
- type: $t_metric_group_handle_t
532568
name: hMetricGroup
@@ -538,7 +574,7 @@ returns:
538574
- "If trying to destroy an activated metric group"
539575
--- #--------------------------------------------------------------------------
540576
type: function
541-
desc: "Destroy a metric created using $tMetricCreateFromProgrammableExp."
577+
desc: "Destroy a metric created using $tMetricCreateFromProgrammable1Exp."
542578
version: "1.9"
543579
class: $tMetric
544580
name: DestroyExp

0 commit comments

Comments
 (0)