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::kokkosp::kernel_logger Struct Reference

#include "timemory/api/kokkosp.hpp"

+ Collaboration diagram for tim::kokkosp::kernel_logger:

Public Types

using storage_type = empty_storage
 
using base_type = void
 

Public Member Functions

template<typename... Args>
void mark (int64_t _inc_depth, Args &&... _args)
 
void get () const
 

Static Public Member Functions

static std::string get_message (string_view_cref_t _msg)
 
static int64_t & get_depth ()
 
static std::string get_indent ()
 
template<typename... Args>
static opaque get_opaque (Args &&...)
 

Detailed Description

Definition at line 197 of file kokkosp.hpp.

Member Typedef Documentation

◆ base_type

using tim::component::empty_base::base_type = void
inherited

Definition at line 67 of file declaration.hpp.

◆ storage_type

using tim::component::empty_base::storage_type = empty_storage
inherited

Definition at line 66 of file declaration.hpp.

Member Function Documentation

◆ get()

void tim::component::empty_base::get ( ) const
inlineinherited

Definition at line 69 of file declaration.hpp.

69{}

◆ get_depth()

static int64_t & tim::kokkosp::kernel_logger::get_depth ( )
inlinestatic

Definition at line 222 of file kokkosp.hpp.

223 {
224 static int64_t _value = 0;
225 return _value;
226 }

Referenced by get_indent(), and mark().

◆ get_indent()

static std::string tim::kokkosp::kernel_logger::get_indent ( )
inlinestatic

Definition at line 228 of file kokkosp.hpp.

229 {
230 auto _depth = get_depth();
231 if(_depth < 1)
232 return "";
233 std::stringstream ss;
234 ss << std::right << std::setw(_depth * 2) << "";
235 return ss.str();
236 }
static int64_t & get_depth()
Definition: kokkosp.hpp:222

References get_depth().

Referenced by mark().

◆ get_message()

static std::string tim::kokkosp::kernel_logger::get_message ( string_view_cref_t  _msg)
inlinestatic

Definition at line 217 of file kokkosp.hpp.

218 {
219 return std::string{ "[kokkos_kernel_logger]> " } + std::string{ _msg };
220 }
tim::mpl::apply< std::string > string
Definition: macros.hpp:53

Referenced by mark().

◆ get_opaque()

template<typename... Args>
static opaque tim::component::empty_base::get_opaque ( Args &&  ...)
inlinestaticinherited

Definition at line 72 of file declaration.hpp.

73 {
74 return opaque{};
75 }

◆ mark()

template<typename... Args>
void tim::kokkosp::kernel_logger::mark ( int64_t  _inc_depth,
Args &&...  _args 
)
inline

Definition at line 203 of file kokkosp.hpp.

204 {
205 if(_inc_depth < 0)
206 get_depth() += _inc_depth;
207 {
208 auto _msg = TIMEMORY_JOIN('/', std::forward<Args>(_args)...);
209 auto_lock_t _lk{ type_mutex<decltype(std::cerr)>() };
210 std::cerr << get_indent() << get_message(_msg) << std::endl;
211 }
212 if(_inc_depth > 0)
213 get_depth() += _inc_depth;
214 }
std::array< char *, 4 > _args
std::unique_lock< mutex_t > auto_lock_t
Unique lock type around mutex_t.
Definition: locking.hpp:42
static std::string get_indent()
Definition: kokkosp.hpp:228
static std::string get_message(string_view_cref_t _msg)
Definition: kokkosp.hpp:217
#define TIMEMORY_JOIN(delim,...)
Definition: macros.hpp:90

References tim::_args, get_depth(), get_indent(), get_message(), and TIMEMORY_JOIN.


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