PAPI 7.1.0.0
Loading...
Searching...
No Matches
PAPI_get_dev_type_attr Class Reference

returns device type attributes More...

Detailed Description

Return values
ENOSUPPinvalid attribute
Parameters
handleopaque handle for device, obtained through PAPI_enum_dev_type
attrdevice type attribute to query
valvalue of the requested device type attribute
Example:
typedef enum {
PAPI_DEV_TYPE_ATTR__INT_PAPI_ID, // PAPI defined device type id
PAPI_DEV_TYPE_ATTR__INT_VENDOR_ID, // Vendor defined id
PAPI_DEV_TYPE_ATTR__INT_COUNT, // Devices of that type and vendor
PAPI_DEV_TYPE_ATTR__CHAR_STATUS, // Status string for the device type
typedef enum {
PAPI_DEV_TYPE_ID__CPU, // Device id for CPUs
PAPI_DEV_TYPE_ID__CUDA, // Device id for Nvidia GPUs
PAPI_DEV_TYPE_ID__ROCM, // Device id for AMD GPUs
void *handle;
int id;
int enum_modifier = PAPI_DEV_TYPE_ENUM__ALL;
while (PAPI_OK == PAPI_enum_dev_type(enum_modifier, &handle)) {
switch (id) {
// query cpu attributes
break;
// query nvidia gpu attributes
break;
// query amd gpu attributes
break;
default: ...
}
}
static papi_handle_t handle
Definition: Gamum.c:21
returns handle of next device type
returns device type attributes
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_DEV_TYPE_ENUM__ALL
Definition: f90papi.h:201
#define PAPI_DEV_TYPE_ID__CUDA
Definition: f90papi.h:186
#define PAPI_DEV_TYPE_ATTR__INT_PAPI_ID
Definition: f90papi.h:59
#define PAPI_DEV_TYPE_ATTR__INT_COUNT
Definition: f90papi.h:140
#define PAPI_DEV_TYPE_ATTR__INT_VENDOR_ID
Definition: f90papi.h:116
#define PAPI_DEV_TYPE_ATTR__CHAR_NAME
Definition: f90papi.h:126
#define PAPI_DEV_TYPE_ID__CPU
Definition: f90papi.h:93
#define PAPI_DEV_TYPE_ATTR__CHAR_STATUS
Definition: f90papi.h:239
#define PAPI_DEV_TYPE_ID__ROCM
Definition: f90papi.h:194
PAPI_dev_type_attr_e
Definition: papi.h:1049
PAPI_dev_type_id_e
Definition: papi.h:1022
PAPI_get_dev_type_attr() allows the user to query all device type attributes. It takes a device type handle, returned by PAPI_enum_dev_type, and an attribute to be queried for the device type and returns the attribute value.
Bug:
none known
See also
PAPI_enum_dev_type
PAPI_get_dev_attr

The documentation for this class was generated from the following file: