---
name: "PAPI_enum_dev_type"
section: "3"
platform: "linux"
package: "libpapi-dev"
version: "7.1.0-5+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/PAPI_enum_dev_type"
---

# PAPI\_enum\_dev\_type(3)

returns handle of next device type

## NAME

PAPI\_enum\_dev\_type - returns handle of next device type

## SYNOPSIS

## Detailed Description

**Return values**

*ENOCMP* component does not exist \
 *EINVAL* end of device type list

**Parameters**

*enum\_modifier* device type modifier, used to filter out enumerated device types

**Example:**

```
enum {
    PAPI_DEV_TYPE_ENUM__FIRST,
    PAPI_DEV_TYPE_ENUM__CPU,
    PAPI_DEV_TYPE_ENUM__CUDA,
    PAPI_DEV_TYPE_ENUM__ROCM,
    PAPI_DEV_TYPE_ENUM__ALL
};
void *handle;
const char *vendor_name;
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__CHAR_NAME, &vendor_name);
    ...
}
```

 **PAPI\_enum\_dev\_type()** allows the user to access all device types in the system. It takes an enumerator modifier that allows users to enumerate only devices of a predefined type and it returns an opaque handler that users can pass to other functions in order to query device type attributes.

**See also**

**PAPI\_get\_dev\_type\_attr**

**PAPI\_get\_dev\_attr**

## Author

Generated automatically by Doxygen for PAPI from the source code.
