# tf::cudaScopedDevice class

class to create an RAII-styled context switch

Sample usage:

    {
      tf::cudaScopedDevice device(1);  // switch to the device context 1

      // create a stream under device context 1
      cudaStream_t stream;
      cudaStreamCreate(&stream);

    }  // leaving the scope and goes back to the previous device context

cudaScopedDevice is neither movable nor copyable.

## Constructors, destructors, conversion operators

cudaScopedDevice(int device) explicit
  constructs a RAII-styled device switcher
~cudaScopedDevice()
  destructs the guard and switches back to the previous device context

## Function documentation

### tf::cudaScopedDevice::cudaScopedDevice(int device) explicit

constructs a RAII-styled device switcher

Parameters
device | device context to scope in the guard

Tab / T to search, Esc to close
…

Search for symbols, directories, files, pages or modules. You can omit any prefix from the symbol or file path; adding a `:` or `/` suffix lists all members of given symbol or directory.

Use ↓ / ↑ to navigate through the list, Enter to go. Tab autocompletes common prefix, you can copy a link to the result using ⌘ L while ⌘ M produces a Markdown link.

Sorry, nothing was found.