PAPI 7.1.0.0
Loading...
Searching...
No Matches
gpu_common_utils.h
Go to the documentation of this file.
1/* Copyright (c) 2020 Intel Corp. All rights reserved
2 * Contributed by Peinan Zhang <peinan.zhang@intel.com>
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8 * of the Software, and to permit persons to whom the Software is furnished to do so,
9 * subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in all
12 * copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
18 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
19 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 */
21
22/*
23 * This test case tests time based data collection on ntel GPU performance metrics
24 *
25 * @ brief Collect metric data for a certain time interval, with one or more loops.
26 * By default, the metric data will aggregate overtime for each loop.
27 * When reset, each group reports metric data only for the sepecified tiem duration
28 *
29 * @option:
30 * [-d <time interval in second>][-l <number of loops>] [-s (reset)]
31 */
32
33#ifndef _GPU_COMMON_UTILS_H
34#define _GPU_COMMON_UTILS_H
35
36#include <stdint.h>
37
38#if defined(__cplusplus)
39extern "C" {
40#endif
41
42#define MAX_NUM_METRICS 40
43#define MAX_STRLEN 128
44
45#define COMP_NAME "intel_gpu"
46
47typedef struct _inParams {
48 uint32_t duration;
49 uint32_t loops;
50 uint32_t reset;
51 uint32_t app_dev;
52 uint32_t app_tile;
53 uint32_t num_metrics;
55} InParams;
56
57
58void parseMetricList(char *metric_list, InParams *param);
59int parseInputParam(int argc, char **argv, InParams *param);
60int initPAPIGPUComp();
61int initMetricSet(char **metric_names, int num_metrics, int *eventSet);
62
63
64#if defined(__cplusplus)
65}
66#endif
67
68#endif /* _GPU_COMMON_UTILS_H */
69
int initPAPIGPUComp()
int parseInputParam(int argc, char **argv, InParams *param)
void parseMetricList(char *metric_list, InParams *param)
int initMetricSet(char **metric_names, int num_metrics, int *eventSet)
uint32_t num_metrics
uint32_t duration
uint32_t loops
uint32_t reset
char ** metric_names
uint32_t app_dev
uint32_t app_tile