PAPI 7.1.0.0
Loading...
Searching...
No Matches
GPUMetricInterface.h File Reference
Include dependency graph for GPUMetricInterface.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  MetricInfo
 
struct  DeviceInfo
 
struct  DataEntry
 
struct  MetricData
 
struct  MetricNode
 

Macros

#define MAX_STR_LEN   256
 
#define TIME_BASED   0
 
#define EVENT_BASED   1
 
#define M_ACCUMULATE   0x0
 
#define M_AVERAGE   0x1
 
#define M_RAW   0x2
 
#define DRV_BITS   4
 
#define DEV_BITS   4
 
#define SDEV_BITS   4
 
#define IDX_BITS   16
 
#define DMASK   0xf
 
#define DCODE_MASK   0xfff
 
#define IDX_MASK   0xffff
 
#define CreateDeviceCode(drv, dev, sdev)
 
#define CreateIdxCode(devcode, idx)   ((((devcode)&DCODE_MASK)<<IDX_BITS)|((idx)&IDX_MASK))
 
#define GetDeviceCode(handle)   (((handle) >> IDX_BITS) & DCODE_MASK)
 
#define GetIdx(handle)   ((handle) & IDX_MASK)
 
#define GetSDev(handle)   (((handle) >> IDX_BITS) & DMASK)
 
#define GetDev(handle)   (((handle) >> (IDX_BITS+SDEV_BITS)) & DMASK)
 
#define GetDrv(handle)   (((handle) >> (IDX_BITS+SDEV_BITS+DEV_BITS)) & DMASK)
 
#define IsDeviceHandle(devcode, handle)   ((devcode) == (((handle)>>IDX_BITS)&DCODE_MASK))
 
#define METRIC_BITS   8
 
#define METRIC_GROUP_MASK   0xff00
 
#define METRIC_MASK   0x00ff
 
#define CreateGroupCode(mGroupId)   (((mGroupId+1)<<METRIC_BITS) & METRIC_GROUP_MASK)
 
#define CreateMetricCode(mGroupId, mId)   ((CreateGroupCode(mGroupId)) | ((mId+1)&METRIC_MASK))
 
#define GetGroupIdx(code)   (((code) & METRIC_GROUP_MASK) >> METRIC_BITS)
 
#define GetMetricIdx(code)   ((code) & METRIC_MASK)
 
#define MAX_METRICS   128
 
#define MAX_NUM_REPORTS   20
 
#define METRIC_SAMPLE   0x1
 
#define METRIC_SUMMARY   0x2
 
#define METRIC_RESET   0x4
 

Typedefs

typedef int DEVICE_HANDLE
 
typedef char NAMESTR[MAX_STR_LEN]
 

Functions

MetricInfo * GPUAllocMetricInfo (uint32_t count)
 
void GPUFreeMetricInfo (MetricInfo *info, uint32_t count)
 
MetricDataGPUAllocMetricData (uint32_t count, uint32_t numSets, uint32_t numMetrics)
 
void GPUFreeMetricData (MetricData *data, uint32_t count)
 
void strncpy_se (char *dest, size_t destSize, char *src, size_t count)
 
int GPUDetectDevice (DEVICE_HANDLE **handle, uint32_t *numDevice)
 Detect the named device which has performance monitoring feature availale.
 
int GPUGetDeviceInfo (DEVICE_HANDLE handle, MetricInfo *data)
 Get the device properties, which is mainly in <name, value> format.
 
int GPUPrintDeviceInfo (DEVICE_HANDLE handle, FILE *stream)
 Get the device properties, which is mainly in <name, value> format.
 
int GPUGetMetricGroups (DEVICE_HANDLE handle, uint32_t mtype, MetricInfo *data)
 list available metric groups for the selected type
 
int GPUGetMetricList (DEVICE_HANDLE handle, char *groupName, uint32_t mtype, MetricInfo *data)
 list available metrics in the named group. If name is "", list all available metrics in all groups
 
int GPUEnableMetricGroup (DEVICE_HANDLE handle, char *metricGroupName, uint32_t metricGroupCode, uint32_t mtype, uint32_t period, uint32_t numReports)
 
int GPUEnableMetrics (DEVICE_HANDLE handle, char **metricNameList, uint32_t numMetrics, uint32_t mtype, uint32_t period, uint32_t numReports)
 
int GPUDisableMetricGroup (DEVICE_HANDLE handle, uint32_t mtype)
 
int GPUStart (DEVICE_HANDLE handle)
 start collection
 
int GPUStop (DEVICE_HANDLE handle)
 
MetricDataGPUReadMetricData (DEVICE_HANDLE handle, uint32_t mode, uint32_t *reportCounts)
 read metric data
 
int GPUSetMetricControl (DEVICE_HANDLE handle, uint32_t mode)
 set control for metric data collection
 
void GPUFreeDevice (DEVICE_HANDLE handle)
 free the resouce related this device handle
 

Macro Definition Documentation

◆ CreateDeviceCode

#define CreateDeviceCode (   drv,
  dev,
  sdev 
)
Value:
((((drv)&DMASK)<<(SDEV_BITS+DEV_BITS)) | \
(((dev)&DMASK)<<SDEV_BITS) | \
((sdev)&DMASK))
#define SDEV_BITS
#define DMASK
#define DEV_BITS

Definition at line 117 of file GPUMetricInterface.h.

◆ CreateGroupCode

#define CreateGroupCode (   mGroupId)    (((mGroupId+1)<<METRIC_BITS) & METRIC_GROUP_MASK)

Definition at line 141 of file GPUMetricInterface.h.

◆ CreateIdxCode

#define CreateIdxCode (   devcode,
  idx 
)    ((((devcode)&DCODE_MASK)<<IDX_BITS)|((idx)&IDX_MASK))

Definition at line 125 of file GPUMetricInterface.h.

◆ CreateMetricCode

#define CreateMetricCode (   mGroupId,
  mId 
)    ((CreateGroupCode(mGroupId)) | ((mId+1)&METRIC_MASK))

Definition at line 142 of file GPUMetricInterface.h.

◆ DCODE_MASK

#define DCODE_MASK   0xfff

Definition at line 114 of file GPUMetricInterface.h.

◆ DEV_BITS

#define DEV_BITS   4

Definition at line 110 of file GPUMetricInterface.h.

◆ DMASK

#define DMASK   0xf

Definition at line 113 of file GPUMetricInterface.h.

◆ DRV_BITS

#define DRV_BITS   4

Definition at line 109 of file GPUMetricInterface.h.

◆ EVENT_BASED

#define EVENT_BASED   1

Definition at line 43 of file GPUMetricInterface.h.

◆ GetDev

#define GetDev (   handle)    (((handle) >> (IDX_BITS+SDEV_BITS)) & DMASK)

Definition at line 130 of file GPUMetricInterface.h.

◆ GetDeviceCode

#define GetDeviceCode (   handle)    (((handle) >> IDX_BITS) & DCODE_MASK)

Definition at line 127 of file GPUMetricInterface.h.

◆ GetDrv

#define GetDrv (   handle)    (((handle) >> (IDX_BITS+SDEV_BITS+DEV_BITS)) & DMASK)

Definition at line 131 of file GPUMetricInterface.h.

◆ GetGroupIdx

#define GetGroupIdx (   code)    (((code) & METRIC_GROUP_MASK) >> METRIC_BITS)

Definition at line 143 of file GPUMetricInterface.h.

◆ GetIdx

#define GetIdx (   handle)    ((handle) & IDX_MASK)

Definition at line 128 of file GPUMetricInterface.h.

◆ GetMetricIdx

#define GetMetricIdx (   code)    ((code) & METRIC_MASK)

Definition at line 144 of file GPUMetricInterface.h.

◆ GetSDev

#define GetSDev (   handle)    (((handle) >> IDX_BITS) & DMASK)

Definition at line 129 of file GPUMetricInterface.h.

◆ IDX_BITS

#define IDX_BITS   16

Definition at line 112 of file GPUMetricInterface.h.

◆ IDX_MASK

#define IDX_MASK   0xffff

Definition at line 115 of file GPUMetricInterface.h.

◆ IsDeviceHandle

#define IsDeviceHandle (   devcode,
  handle 
)    ((devcode) == (((handle)>>IDX_BITS)&DCODE_MASK))

Definition at line 132 of file GPUMetricInterface.h.

◆ M_ACCUMULATE

#define M_ACCUMULATE   0x0

Definition at line 46 of file GPUMetricInterface.h.

◆ M_AVERAGE

#define M_AVERAGE   0x1

Definition at line 47 of file GPUMetricInterface.h.

◆ M_RAW

#define M_RAW   0x2

Definition at line 48 of file GPUMetricInterface.h.

◆ MAX_METRICS

#define MAX_METRICS   128

Definition at line 147 of file GPUMetricInterface.h.

◆ MAX_NUM_REPORTS

#define MAX_NUM_REPORTS   20

Definition at line 149 of file GPUMetricInterface.h.

◆ MAX_STR_LEN

#define MAX_STR_LEN   256

Definition at line 38 of file GPUMetricInterface.h.

◆ METRIC_BITS

#define METRIC_BITS   8

Definition at line 137 of file GPUMetricInterface.h.

◆ METRIC_GROUP_MASK

#define METRIC_GROUP_MASK   0xff00

Definition at line 138 of file GPUMetricInterface.h.

◆ METRIC_MASK

#define METRIC_MASK   0x00ff

Definition at line 139 of file GPUMetricInterface.h.

◆ METRIC_RESET

#define METRIC_RESET   0x4

Definition at line 154 of file GPUMetricInterface.h.

◆ METRIC_SAMPLE

#define METRIC_SAMPLE   0x1

Definition at line 152 of file GPUMetricInterface.h.

◆ METRIC_SUMMARY

#define METRIC_SUMMARY   0x2

Definition at line 153 of file GPUMetricInterface.h.

◆ SDEV_BITS

#define SDEV_BITS   4

Definition at line 111 of file GPUMetricInterface.h.

◆ TIME_BASED

#define TIME_BASED   0

Definition at line 42 of file GPUMetricInterface.h.

Typedef Documentation

◆ DEVICE_HANDLE

typedef int DEVICE_HANDLE

Definition at line 50 of file GPUMetricInterface.h.

◆ NAMESTR

typedef char NAMESTR[MAX_STR_LEN]

Definition at line 52 of file GPUMetricInterface.h.

Function Documentation

◆ GPUAllocMetricData()

MetricData * GPUAllocMetricData ( uint32_t  count,
uint32_t  numSets,
uint32_t  numMetrics 
)

◆ GPUAllocMetricInfo()

MetricInfo * GPUAllocMetricInfo ( uint32_t  count)

◆ GPUDetectDevice()

int GPUDetectDevice ( DEVICE_HANDLE **  handle,
uint32_t *  numDevice 
)
Parameters
OUThandle - a array of handle, each for an instance of the device
Returns
0 – success, otherwise, error code
Here is the caller graph for this function:

◆ GPUDisableMetricGroup()

int GPUDisableMetricGroup ( DEVICE_HANDLE  handle,
uint32_t  mtype 
)
Here is the caller graph for this function:

◆ GPUEnableMetricGroup()

int GPUEnableMetricGroup ( DEVICE_HANDLE  handle,
char *  metricGroupName,
uint32_t  metricGroupCode,
uint32_t  mtype,
uint32_t  period,
uint32_t  numReports 
)
Here is the caller graph for this function:

◆ GPUEnableMetrics()

int GPUEnableMetrics ( DEVICE_HANDLE  handle,
char **  metricNameList,
uint32_t  numMetrics,
uint32_t  mtype,
uint32_t  period,
uint32_t  numReports 
)

◆ GPUFreeDevice()

void GPUFreeDevice ( DEVICE_HANDLE  handle)
Parameters
INhandle - handle to the selected device
Returns
0 – success, otherwise, error code
Here is the caller graph for this function:

◆ GPUFreeMetricData()

void GPUFreeMetricData ( MetricData data,
uint32_t  count 
)
Here is the caller graph for this function:

◆ GPUFreeMetricInfo()

void GPUFreeMetricInfo ( MetricInfo *  info,
uint32_t  count 
)

◆ GPUGetDeviceInfo()

int GPUGetDeviceInfo ( DEVICE_HANDLE  handle,
MetricInfo *  data 
)
Parameters
INhandle - handle to the selected device
OUTdata - the property data
Returns
0 – success, otherwise, error code

◆ GPUGetMetricGroups()

int GPUGetMetricGroups ( DEVICE_HANDLE  handle,
uint32_t  mtype,
MetricInfo *  data 
)
Parameters
INhandle - handle to the selected device
INmtype - metric group type
OUTdata - metric data
Returns
0 – success, otherwise, error code

◆ GPUGetMetricList()

int GPUGetMetricList ( DEVICE_HANDLE  handle,
char *  groupName,
uint32_t  mtype,
MetricInfo *  data 
)
Parameters
INhandle - handle to the selected device
INgroupName - metric group name. "" means all groups.
Inmtype - metric type <TIME_BASED, EVENT_BASED>
OUTdata - metric data
Returns
0 – success, otherwise, error code
Here is the caller graph for this function:

◆ GPUPrintDeviceInfo()

int GPUPrintDeviceInfo ( DEVICE_HANDLE  handle,
FILE *  stream 
)
Parameters
INhandle - handle to the selected device
INstream - IO stream to print
Returns
0 – success, otherwise, error code

◆ GPUReadMetricData()

Metricdata * GPUReadMetricData ( DEVICE_HANDLE  handle,
uint32_t  mode,
uint32_t *  reportCounts 
)
Parameters
INhandle - handle to the selected device
INmode - collection mode (sample, summary, reset)
OUTreportCounts - returned metric data array size
Returns
data - returned metric data array
Here is the caller graph for this function:

◆ GPUSetMetricControl()

Metricdata * GPUSetMetricControl ( DEVICE_HANDLE  handle,
uint32_t  mode 
)
Parameters
INhandle - handle to the selected device
INmode - collection mode (sample, summary, reset)
Returns
0 – success, otherwise, error code
Here is the caller graph for this function:

◆ GPUStart()

int GPUStart ( DEVICE_HANDLE  handle)
Parameters
INhandle - handle to the selected device
Returns
0 – success, otherwise, error code

◆ GPUStop()

int GPUStop ( DEVICE_HANDLE  handle)

◆ strncpy_se()

void strncpy_se ( char *  dest,
size_t  destSize,
char *  src,
size_t  count 
)
Here is the caller graph for this function: