NV::Rules::IFrontend Class Reference
[NvRules Tool lifetime-managed classes.]

Frontend interface. More...


Public Types

enum  MarkerKind
 Marker Kind. More...
enum  MsgType
 Message type. More...
enum  Severity
 Focus metric severity. More...
enum  SpeedupType
 Speedup estimation type. More...

Public Member Functions

virtual bool focus_metric (int message_id, const char *metric_name, double metric_value, Severity severity, const char *info)=0
 Rule focus metric message.
virtual void load_chart_from_file (const char *filename)=0
virtual int message (MsgType type, const char *str, const char *name=nullptr)=0
 Rule result message.
virtual int message (const char *str, const char *name=nullptr)=0
 Rule result message.
virtual void source_marker (const char *str, uint64_t address_or_line, MarkerKind kind, const char *file_name, MsgType type=MsgType::MSG_NONE)=0
 Rule source marker.
virtual void source_marker (const char *str, uint64_t address_or_line, MarkerKind kind, MsgType type=MsgType::MSG_NONE)=0
 Rule source marker.
virtual bool speedup (int message_id, SpeedupType type, double estimated_speedup)=0
 Rule estimated speedup message.


Detailed Description

The frontend is responsible for relaying messages and results to the caller via user interfaces, logs or output files.

Member Enumeration Documentation

The kind of marker that is created in the Source Page with source_marker. SASS The marker will be associated with a SASS instruction. SOURCE The marker will be associated with a Source line.

The type a message to the frontend represents when calling message. MSG_NONE No specific type for this message. MSG_OK The message is informative. MSG_OPTIMIZATION The message represents a suggestion for performance optimization. MSG_WARNING The message represents a warning or fixable issue. MSG_ERROR The message represents an error, potentially in executing the rule.

The severity a focus metric represents when calling focus_metric. The severity can be used by the rule system client when processing the focus metric. SEVERITY_DEFAULT The default severity. SEVERITY_LOW Severity if low. SEVERITY_HIGH Severity if high.

The type of speedup estimation used when calling speedup. LOCAL Only section-scope metrics were used for the calculation, potentially indicating a suboptimal approximation. GLOBAL Non section-scope, collectable metrics were used for the calculation, indicating the best available approximation.


Member Function Documentation

virtual bool NV::Rules::IFrontend::focus_metric ( int  message_id,
const char *  metric_name,
double  metric_value,
Severity  severity,
const char *  info 
) [pure virtual]

Issues a focus metric message to the frontend, e.g. to indicate a key metric that triggered the rule output. Can be associated with a prior message using its message_id . The severity can be used to indicate this metric's impact/severity on the result. The info field can be set to a descriptive string for further information, e.g. the calculation leading to this metric being focused. Returns whether the focus_metric could be set successfully for the message_id .

virtual void NV::Rules::IFrontend::load_chart_from_file ( const char *  filename  )  [pure virtual]

Load a ProfilerSection google protcol buffer chart from filename

virtual int NV::Rules::IFrontend::message ( MsgType  type,
const char *  str,
const char *  name = nullptr 
) [pure virtual]

Issues a message str with a specific message type and optional name name to the frontend. Returns a message ID that is unique in this rule invocation.

virtual int NV::Rules::IFrontend::message ( const char *  str,
const char *  name = nullptr 
) [pure virtual]

Issues a message str to the frontend with the default MsgType and optional name name . Returns a message ID that is unique in this rule invocation.

virtual void NV::Rules::IFrontend::source_marker ( const char *  str,
uint64_t  address_or_line,
MarkerKind  kind,
const char *  file_name,
MsgType  type = MsgType::MSG_NONE 
) [pure virtual]

Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. This function supports multi-file programs, which means a file_name has to be specified. The type denotes the urgency associated with this marker and is optional.

virtual void NV::Rules::IFrontend::source_marker ( const char *  str,
uint64_t  address_or_line,
MarkerKind  kind,
MsgType  type = MsgType::MSG_NONE 
) [pure virtual]

Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. The type denotes the urgency associated with this marker and is optional.

virtual bool NV::Rules::IFrontend::speedup ( int  message_id,
SpeedupType  type,
double  estimated_speedup 
) [pure virtual]

Issues an estimated speedup to the frontend associated to the message with ID message_id . It indicates what speedup could potentially be achieved, when following the guidelines of the rule. The type of the speedup estimation indicates whether the estimate was calculated locally (SpeedupType::LOCAL), i.e. using metrics collect at section scope, or globally (SpeedupType::GLOBAL), i.e. using any metric that is collectable on the given system. Returns whether the speedup could be set successfully for the message_id .


Generated on Tue Aug 15 15:00:08 2023 for NvRulesAPI by  doxygen 1.5.8