ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nnkit::support::onnx::Status Class Reference

#include <Status.h>

Public Member Functions

 Status ()
 
 Status (OrtStatus *status)
 
 ~Status ()
 
Statusoperator= (OrtStatus *status)
 
bool isError (void)
 
void throwOnError (void)
 

Detailed Description

Definition at line 32 of file Status.h.

Constructor & Destructor Documentation

◆ Status() [1/2]

nnkit::support::onnx::Status::Status ( )
inline

Definition at line 35 of file Status.h.

35 : _status(nullptr)
36 {
37 // DO NOTHING
38 }

◆ Status() [2/2]

nnkit::support::onnx::Status::Status ( OrtStatus *  status)
inline

Definition at line 40 of file Status.h.

40 : _status(status)
41 {
42 // DO NOTHING
43 }

◆ ~Status()

nnkit::support::onnx::Status::~Status ( )
inline

Definition at line 45 of file Status.h.

46 {
47 if (_status)
48 {
49 OrtReleaseStatus(_status);
50 }
51 }

Member Function Documentation

◆ isError()

bool nnkit::support::onnx::Status::isError ( void  )
inline

Definition at line 63 of file Status.h.

63{ return (_status != nullptr); }

Referenced by nnkit::support::onnx::Runner::Runner().

◆ operator=()

Status & nnkit::support::onnx::Status::operator= ( OrtStatus *  status)
inline

Definition at line 53 of file Status.h.

54 {
55 if (_status)
56 {
57 OrtReleaseStatus(_status);
58 }
59 _status = status;
60 return *this;
61 }

◆ throwOnError()

void nnkit::support::onnx::Status::throwOnError ( void  )
inline

Definition at line 65 of file Status.h.

66 {
67 if (_status)
68 {
69 const char *msg = OrtGetErrorMessage(_status);
70 std::string err{msg};
71 OrtReleaseStatus(_status);
72 throw std::runtime_error{err};
73 }
74 }

Referenced by nnkit::support::onnx::Allocator::Allocator(), nnkit::support::onnx::TensorContext::getConstFloatTensor(), nnkit::support::onnx::TensorContext::getMutableFloatTensor(), nnkit::support::onnx::Runner::prepareInputs(), nnkit::support::onnx::Runner::prepareOutputs(), nnkit::support::onnx::Runner::run(), and nnkit::support::onnx::TensorSet::set().


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