Scroll to navigation

PAPI_get_dev_attr(3) PAPI PAPI_get_dev_attr(3)

NAME

PAPI_get_dev_attr - returns device attributes

SYNOPSIS

Detailed Description

Return values

ENOSUPP invalid/unsupported attribute

Parameters

handle opaque handle for device, obtained through PAPI_enum_dev_type
id integer identifier of queried device
attr device attribute to query
val value of the requested device attribute

Example:

typedef enum {

PAPI_DEV_ATTR__CPU_CHAR_NAME,
PAPI_DEV_ATTR__CPU_UINT_L1I_CACHE_SIZE,
PAPI_DEV_ATTR__CPU_UINT_L1D_CACHE_SIZE,
PAPI_DEV_ATTR__CPU_UINT_L2U_CACHE_SIZE,
PAPI_DEV_ATTR__CPU_UINT_L3U_CACHE_SIZE,
PAPI_DEV_ATTR__CPU_UINT_L1I_CACHE_LINE_SIZE,
PAPI_DEV_ATTR__CPU_UINT_L1D_CACHE_LINE_SIZE,
PAPI_DEV_ATTR__CPU_UINT_L2U_CACHE_LINE_SIZE,
PAPI_DEV_ATTR__CPU_UINT_L3U_CACHE_LINE_SIZE,
PAPI_DEV_ATTR__CPU_UINT_L1I_CACHE_LINE_COUNT,
PAPI_DEV_ATTR__CPU_UINT_L1D_CACHE_LINE_COUNT,
PAPI_DEV_ATTR__CPU_UINT_L2U_CACHE_LINE_COUNT,
PAPI_DEV_ATTR__CPU_UINT_L3U_CACHE_LINE_COUNT,
PAPI_DEV_ATTR__CPU_UINT_L1I_CACHE_ASSOC,
PAPI_DEV_ATTR__CPU_UINT_L1D_CACHE_ASSOC,
PAPI_DEV_ATTR__CPU_UINT_L2U_CACHE_ASSOC,
PAPI_DEV_ATTR__CPU_UINT_L3U_CACHE_ASSOC,
PAPI_DEV_ATTR__CPU_UINT_SOCKET_COUNT,
PAPI_DEV_ATTR__CPU_UINT_NUMA_COUNT,
PAPI_DEV_ATTR__CPU_UINT_CORE_COUNT,
PAPI_DEV_ATTR__CPU_UINT_THREAD_COUNT,
PAPI_DEV_ATTR__CPU_UINT_FAMILY,
PAPI_DEV_ATTR__CPU_UINT_MODEL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UINT_WAVE_PER_CU,
PAPI_DEV_ATTR__ROCM_UINT_SHM_PER_WG,
PAPI_DEV_ATTR__ROCM_UINT_WG_DIM_X,
PAPI_DEV_ATTR__ROCM_UINT_WG_DIM_Y,
PAPI_DEV_ATTR__ROCM_UINT_WG_DIM_Z,
PAPI_DEV_ATTR__ROCM_UINT_GRD_DIM_X,
PAPI_DEV_ATTR__ROCM_UINT_GRD_DIM_Y,
PAPI_DEV_ATTR__ROCM_UINT_GRD_DIM_Z,
PAPI_DEV_ATTR__ROCM_UINT_CU_COUNT,
PAPI_DEV_ATTR__ROCM_UINT_SIMD_PER_CU,
PAPI_DEV_ATTR__ROCM_UINT_COMP_CAP_MAJOR,
PAPI_DEV_ATTR__ROCM_UINT_COMP_CAP_MINOR, } PAPI_dev_attr_e; void *handle; int id; int count; int enum_modifier = PAPI_DEV_TYPE_ENUM__CPU | PAPI_DEV_TYPE_ENUM__CUDA; while (PAPI_OK == PAPI_enum_dev_type(enum_modifier, &handle)) {
PAPI_get_dev_type_attr(handle, PAPI_DEV_TYPE_ATTR__INT_PAPI_ID, &id);
PAPI_get_dev_type_attr(handle, PAPI_DEV_TYPE_ATTR__INT_COUNT, &count);
if (PAPI_DEV_TYPE_ID__CUDA == id) {
for (int i = 0; i < count; ++i) {
unsigned int warp_size;
unsigned int cc_major, cc_minor;
PAPI_get_dev_attr(handle, i, PAPI_DEV_ATTR__CUDA_UINT_WARP_SIZE, &warp_size);
PAPI_get_dev_attr(handle, i, PAPI_DEV_ATTR__CUDA_UINT_COMP_CAP_MAJOR, &cc_major);
PAPI_get_dev_attr(handle, i, PAPI_DEV_ATTR__CUDA_UINT_COMP_CAP_MINOR, &cc_minor);
...
}
} }


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, the device sequential id and an attribute to be queried for the device and returns the attribute value.

See also

PAPI_enum_dev_type

PAPI_get_dev_attr

Author

Generated automatically by Doxygen for PAPI from the source code.

Thu Dec 14 2023 Version 7.1.0.0