Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Static Public Attributes
MSNPUGuardImpl Struct Referencefinal
Inheritance diagram for MSNPUGuardImpl:

Public Member Functions

 MSNPUGuardImpl (DeviceType t)
DeviceType type () const override
 Return the type of device managed by this guard implementation.
Device exchangeDevice (Device d) const override
Device getDevice () const override
 Get the current device.
void setDevice (Device d) const override
void uncheckedSetDevice (Device d) const noexceptoverride
Stream getStream (Device d) const noexceptoverride
Stream exchangeStream (Stream s) const noexceptoverride
DeviceIndex deviceCount () const override
 Get the number of devices.
- Public Member Functions inherited from c10::impl::DeviceGuardImplInterface
virtual Device exchangeDevice (Device) const =0
 Set the current device to Device, and return the previous Device.
virtual void setDevice (Device) const =0
 Set the current device to Device.
virtual void uncheckedSetDevice (Device) const noexcept=0
 Set the current device to Device, without checking for errors (so, e.g., this can be called from a destructor).
virtual Stream getStream (Device) const noexcept=0
 Get the current stream for a given device.
virtual Stream exchangeStream (Stream) const noexcept=0
 Set a stream to be the thread local current stream for its device. More...
virtual ~DeviceGuardImplInterface ()=default
 Intended use of this class is to leak the DeviceGuardImpl at program end. More...

Static Public Attributes

static constexpr DeviceType static_type = DeviceType::MSNPU

Detailed Description

Definition at line 96 of file msnpu_extension.cpp.

The documentation for this struct was generated from the following file: