timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::component::cuda_event::marker Struct Reference

#include "timemory/components/cuda/components.hpp"

+ Collaboration diagram for tim::component::cuda_event::marker:

Public Member Functions

 marker ()
 
 ~marker ()=default
 
void start (cuda::stream_t &stream)
 
void stop (cuda::stream_t &stream)
 
float sync ()
 

Public Attributes

bool valid = true
 
bool synced = false
 
bool running = false
 
cuda::event_t first = cuda::event_t{}
 
cuda::event_t second = cuda::event_t{}
 

Detailed Description

Definition at line 66 of file components.hpp.

Constructor & Destructor Documentation

◆ marker()

tim::component::cuda_event::marker::marker ( )
inline

Definition at line 74 of file components.hpp.

74{ valid = (cuda::event_create(first) && cuda::event_create(second)); }

References first, second, and valid.

◆ ~marker()

tim::component::cuda_event::marker::~marker ( )
default

Member Function Documentation

◆ start()

void tim::component::cuda_event::marker::start ( cuda::stream_t &  stream)
inline

Definition at line 77 of file components.hpp.

78 {
79 if(!valid || running)
80 return;
81 synced = false;
82 running = true;
83 cuda::event_record(first, stream);
84 }
data::stream stream
Definition: stream.hpp:982

References first, running, synced, and valid.

Referenced by tim::component::cuda_event::start().

◆ stop()

void tim::component::cuda_event::marker::stop ( cuda::stream_t &  stream)
inline

Definition at line 86 of file components.hpp.

87 {
88 if(!valid || !running)
89 return;
90 cuda::event_record(second, stream);
91 running = false;
92 }

References running, second, and valid.

Referenced by tim::component::cuda_event::stop().

◆ sync()

float tim::component::cuda_event::marker::sync ( )
inline

Definition at line 94 of file components.hpp.

95 {
96 if(!valid)
97 return 0.0;
98 if(!synced)
99 cuda::event_sync(second);
100 synced = true;
101 return cuda::event_elapsed_time(first, second) * units::msec;
102 }

References first, second, synced, and valid.

Referenced by tim::component::cuda_event::sync().

Member Data Documentation

◆ first

cuda::event_t tim::component::cuda_event::marker::first = cuda::event_t{}

Definition at line 71 of file components.hpp.

Referenced by marker(), start(), and sync().

◆ running

bool tim::component::cuda_event::marker::running = false

Definition at line 70 of file components.hpp.

Referenced by start(), and stop().

◆ second

cuda::event_t tim::component::cuda_event::marker::second = cuda::event_t{}

Definition at line 72 of file components.hpp.

Referenced by marker(), stop(), and sync().

◆ synced

bool tim::component::cuda_event::marker::synced = false

Definition at line 69 of file components.hpp.

Referenced by start(), and sync().

◆ valid

bool tim::component::cuda_event::marker::valid = true

Definition at line 68 of file components.hpp.

Referenced by marker(), start(), stop(), and sync().


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