---
name: "rtcRetainDevice"
section: "3embree4"
platform: "linux"
package: "embree"
version: "4.4.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/rtcRetainDevice/3embree4"
---

# rtcRetainDevice(3embree4)

### NAME

-

  ```
  rtcRetainDevice - increments the device reference count
  ```

### SYNOPSIS

-

  ```
  #include <embree4/rtcore.h>
  void rtcRetainDevice(RTCDevice device);
  ```

### DESCRIPTION

Device objects are reference counted. The `rtcRetainDevice` function increments the reference count of the passed device object (`device` argument). This function together with `rtcReleaseDevice` allows to use the internal reference counting in a C++ wrapper class to manage the ownership of the object.

### EXIT STATUS

On failure an error code is set that can be queried using `rtcGetDeviceError`.

### SEE ALSO

\[rtcNewDevice\], \[rtcReleaseDevice\]
