PAPI_get_dev_type_attr(3)
πΈ NAME πΈ
Welcome to the PAPI manual, bestie β this is the page for PAPI_get_dev_type_attr (section 3, iykyk), and it returns device type attributes. π
β¨ SYNOPSIS β¨
π Detailed Description π
π Return values π
ENOSUPPβ invalid attribute. That's the return-value tea. π΅
π Parameters π
handleβ opaque handle for device, obtained throughPAPI_enum_dev_type.attrβ device type attribute to query.valβ value 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__CHAR_NAME, // Vendor name
PAPI_DEV_TYPE_ATTR__INT_COUNT, // Devices of that type and vendor
PAPI_DEV_TYPE_ATTR__CHAR_STATUS, // Status string for the device type
} PAPI_dev_type_attr_e;
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
} PAPI_dev_type_id_e;
void *handle;
int id;
int enum_modifier = PAPI_DEV_TYPE_ENUM__ALL;
while (PAPI_OK == PAPI_enum_dev_type(enum_modifier, &handle)) {
PAPI_get_dev_type_attr(handle, PAPI_DEV_TYPE_ATTR__INT_PAPI_ID, &id);
switch (id) {
case PAPI_DEV_TYPE_ID__CPU:
// query cpu attributes
break;
case PAPI_DEV_TYPE_ID__CUDA:
// query nvidia gpu attributes
break;
case PAPI_DEV_TYPE_ID__ROCM:
// query amd gpu attributes
break;
default: ...
}
}
Okay so PAPI_get_dev_type_attr() literally allows you to query all device type attributes. You pass it a device type handle (the kind returned by PAPI_enum_dev_type) and an attribute to be queried for that device type, and it returns the attribute value. That's the whole arc, no cap. π
π¦ See also π¦
PAPI_enum_dev_typePAPI_get_dev_attr
π AUTHOR π
Generated automatically by Doxygen for PAPI from the source code. ππ€
Cute little sign-off time: this is from the PAPI source, version 7.2.0.0, dated Wed Jun 25 2025 19:30:48. Bye bestie, stay iconic! π«Άβ¨
π¦ where this page comes from
- nixos 26.05: papi 7.2.0
- nixpkgs unstable: papi 7.2.0
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- ubuntu resolute: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- ubuntu stonking: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms