Skip to main content
`Ctrl`+`K`

# PetscDeviceGetAttribute

Query a particular attribute of a `PetscDevice`

## Synopsis

    #include <petscdevice.h>
    PetscErrorCode PetscDeviceGetAttribute(PetscDevice device, PetscDeviceAttribute attr, void *value)

Not Collective

## Input Parameters

- device - The `PetscDevice`

- attr - The attribute

## Output Parameter

- value - The value of the attribute

## Notes

Since different attributes are often different types `value` is a `void *` to accommodate them all. The underlying type of the attribute is therefore included in the name of the `PetscDeviceAttribute` responsible for querying it. For example, `PETSC_DEVICE_ATTR_SIZE_T_SHARED_MEM_PER_BLOCK` is of type `size_t`.

## See Also

`PetscDeviceAtrtibute`, `PetscDeviceConfigure()`, `PetscDevice`

## Level

intermediate

## Location

src/sys/objects/device/interface/device.cxx

Index of all Device routines
Table of Contents for all manual pages
Index of all manual pages