PAPI 7.1.0.0
Loading...
Searching...
No Matches
linux_intel_gpu_metrics.h
Go to the documentation of this file.
1/*
2 * linux_intel_gpu_metrics.h: IntelĀ® Graphics Processing Unit (GPU) Component for PAPI.
3 *
4 * Copyright (c) 2020 Intel Corp. All rights reserved
5 * Contributed by Peinan Zhang <peinan.zhang@intel.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
11 * of the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
22 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef _INTEL_GPU_METRICS_H
26#define _INTEL_GPU_METRICS_H
27
28/* Headers required by PAPI */
29#include "papi.h"
30#include "papi_internal.h"
31#include "papi_vector.h"
32#include "papi_memory.h"
33
34/* environment varaiable for changing the control */
35#define METRICS_SAMPLING_PERIOD "METRICS_SAMPLING_PERIOD" // setting sampling period
36#define ENABLE_API_TRACING "ZET_ENABLE_API_TRACING_EXP" // for oneAPI Level0 V1.0 +
37#define ENABLE_SUB_DEVICE "ENABLE_SUB_DEVICE"
38
39#define MINIMUM_SAMPLING_PERIOD 100000
40#define DEFAULT_SAMPLING_PERIOD 400000
41
42#define GPU_MAX_COUNTERS 54
43#define GPU_MAX_METRICS 128
44
45void (*_dl_non_dynamic_init) (void) __attribute__ ((weak));
46
47
48typedef struct _metric_ctl_s {
49 uint32_t interval;
50 uint32_t metrics_type;
51 int mode;
52 uint32_t loops;
53 int domain;
55
56
57typedef struct _device_context_s {
58 uint32_t device_code;
59 uint32_t mgroup_code;
60 uint32_t num_metrics;
61 uint32_t metric_code[GPU_MAX_METRICS];
63 uint32_t num_reports;
64 uint32_t num_data_sets;
65 uint32_t *data_set_sidx;
66 uint32_t data_size;
69
70typedef struct _metric_context_s {
71 int cmp_id;
73 int domain;
76 uint32_t num_metrics;
77 uint32_t num_reports;
78 uint32_t num_devices;
80 uint32_t *active_devices;
81 uint32_t metric_idx[GPU_MAX_METRICS];
82 uint32_t dev_ctx_idx[GPU_MAX_METRICS];
83 uint32_t subdev_idx[GPU_MAX_METRICS];
86
87
88
89#endif /* _INTEL_GPU_METRICS_H */
90
int DEVICE_HANDLE
long long metric_values[MAX_NUM_METRICS]
void(* _dl_non_dynamic_init)(void) __attribute__((weak))
#define GPU_MAX_METRICS
unsigned long AO_t __attribute__((__aligned__(4)))
Definition: m68k.h:21
Return codes and api definitions.
uint32_t * active_sub_devices