Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
uni20::cuda::ScopedDevice Class Reference

Temporarily select one CUDA device and restore the previous device on destruction. More...

#include <runtime.hpp>

Public Member Functions

int device () const noexcept
 Return the selected device ordinal.
 
ScopedDevice & operator= (ScopedDevice const &)=delete
 
 ScopedDevice (int device)
 Select device for the lifetime of this guard.
 
 ScopedDevice (ScopedDevice const &)=delete
 
 ~ScopedDevice ()
 

Detailed Description

Temporarily select one CUDA device and restore the previous device on destruction.

Constructor & Destructor Documentation

◆ ScopedDevice() [1/2]

uni20::cuda::ScopedDevice::ScopedDevice ( int  device)
explicit

Select device for the lifetime of this guard.

◆ ScopedDevice() [2/2]

uni20::cuda::ScopedDevice::ScopedDevice ( ScopedDevice const &  )
delete

◆ ~ScopedDevice()

uni20::cuda::ScopedDevice::~ScopedDevice ( )

Member Function Documentation

◆ device()

int uni20::cuda::ScopedDevice::device ( ) const
inlinenoexcept

Return the selected device ordinal.

◆ operator=()

ScopedDevice & uni20::cuda::ScopedDevice::operator= ( ScopedDevice const &  )
delete

The documentation for this class was generated from the following files: