---
name: "PAPI_get_component_index"
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_get_component_index"
---

# PAPI\_get\_component\_index(3)

returns the component index for the named component

## NAME

PAPI\_get\_component\_index - returns the component index for the named component

## SYNOPSIS

## Detailed Description

**Return values**

*ENOCMP* component does not exist

**Parameters**

*name* name of component to find index for

**Examples:**

```
int cidx;
cidx = PAPI_get_component_index("cuda");
if (cidx==PAPI_OK) {
           printf("The CUDA component is cidx %d\n",cidx);
        }
```

 **PAPI\_get\_component\_index()** returns the component index of the named component. This is useful for finding out if a specified component exists.

**See also**

**PAPI\_get\_event\_component**

## Author

Generated automatically by Doxygen for PAPI from the source code.
