Class CudaScopedDevice

Class Documentation

class CudaScopedDevice

CudaScopedDevice uses RAII to select a CUDA device context.

Note

A CudaScopedDevice instance cannot be moved or copied.

Warning

This class is not thread-safe.

Public Functions

inline CudaScopedDevice(int device)

Constructs a CudaScopedDevice using a CUDA device.

Parameters

device – CUDA device to scope in the guard.

inline ~CudaScopedDevice()

Destructs a CudaScopedDevice, switching back to the previous CUDA device context.

CudaScopedDevice() = delete
CudaScopedDevice(const CudaScopedDevice&) = delete
CudaScopedDevice(CudaScopedDevice&&) = delete