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.
macros.hpp File Reference
#include "timemory/components/metadata.hpp"
#include "timemory/components/properties.hpp"
#include "timemory/dll.hpp"
#include "timemory/macros.hpp"
#include <string>
#include <unordered_set>
+ Include dependency graph for macros.hpp:

Go to the source code of this file.

Macros

#define TIMEMORY_COMPONENT_HEADER_MODE
 
#define TIMEMORY_DECLARE_COMPONENT(NAME)
 Declare a non-templated component type in the tim::component namespace. More...
 
#define TIMEMORY_DECLARE_API_COMPONENTS(API, ...)
 Declare a non-templated component type in the tim::component namespace. More...
 
#define TIMEMORY_SET_COMPONENT_API(COMP, ...)
 Declare a component is part of one or more APIs. More...
 
#define TIMEMORY_SET_TEMPLATE_COMPONENT_API(TARGS, TSPECIAL, ...)
 Declare a component is part of one or more APIs. More...
 
#define TIMEMORY_BUNDLE_INDEX(NAME, IDX)
 Declare a bundle index. More...
 
#define TIMEMORY_DECLARE_TEMPLATE_COMPONENT(NAME, ...)
 Declare a templated component type in the tim::component namespace. More...
 
#define TIMEMORY_TEMPLATE_COMPONENT(NAME, TEMPLATE_PARAM, ...)
 Declare a templated component type in the tim::component namespace. More...
 
#define TIMEMORY_COMPONENT_ALIAS(NAME, ...)
 Declare a non-templated alias to a component in the tim::component namespace. More...
 
#define TIMEMORY_PROPERTY_SPECIALIZATION(TYPE, ENUM, ID, ...)
 Specialization of the property specialization. More...
 
#define TIMEMORY_METADATA_SPECIALIZATION(TYPE, LABEL, BASIC_DESC, ...)
 Specialization of the property specialization. More...
 
#define TIMEMORY_TOOLSET_ALIAS(NAME, WRAPPER, ...)
 Creates an alias for a complex type when declaring the statistics type. More...
 
#define _EXTERN_NAME_COMBINE(X, Y)   X##Y
 
#define _EXTERN_TUPLE_ALIAS(Y)   _EXTERN_NAME_COMBINE(extern_tuple_, Y)
 
#define _EXTERN_LIST_ALIAS(Y)   _EXTERN_NAME_COMBINE(extern_list_, Y)
 
#define TIMEMORY_INITIALIZE_STORAGE(...)
 
#define TIMEMORY_STORAGE_INITIALIZER(...)   TIMEMORY_INITIALIZE_STORAGE(__VA_ARGS__)
 
#define TIMEMORY_EXTERN_STORAGE_ALIASES
 
#define TIMEMORY_DECLARE_EXTERN_STORAGE(TYPE)
 
#define TIMEMORY_INSTANTIATE_EXTERN_STORAGE(TYPE)
 
#define TIMEMORY_DECLARE_EXTERN_OPERATIONS(TYPE, HAS_DATA)
 
#define TIMEMORY_INSTANTIATE_EXTERN_OPERATIONS(TYPE, HAS_DATA)
 
#define TIMEMORY_EXTERN_OPERATIONS(...)
 
#define TIMEMORY_EXTERN_STORAGE(...)
 
#define TIMEMORY_EXTERN_TEMPLATE(...)
 
#define TIMEMORY_DECLARE_EXTERN_COMPONENT(NAME, HAS_DATA, ...)
 
#define TIMEMORY_INSTANTIATE_EXTERN_COMPONENT(NAME, HAS_DATA, ...)
 

Macro Definition Documentation

◆ _EXTERN_LIST_ALIAS

#define _EXTERN_LIST_ALIAS (   Y)    _EXTERN_NAME_COMBINE(extern_list_, Y)

Definition at line 356 of file macros.hpp.

◆ _EXTERN_NAME_COMBINE

#define _EXTERN_NAME_COMBINE (   X,
 
)    X##Y

Definition at line 344 of file macros.hpp.

◆ _EXTERN_TUPLE_ALIAS

#define _EXTERN_TUPLE_ALIAS (   Y)    _EXTERN_NAME_COMBINE(extern_tuple_, Y)

Definition at line 350 of file macros.hpp.

◆ TIMEMORY_BUNDLE_INDEX

#define TIMEMORY_BUNDLE_INDEX (   NAME,
  IDX 
)
Value:
namespace tim \
{ \
namespace component \
{ \
static constexpr size_t NAME = IDX; \
} \
}
Definition: kokkosp.cpp:39

Declare a bundle index.

\macro TIMEMORY_BUNDLE_INDEX

Definition at line 144 of file macros.hpp.

◆ TIMEMORY_COMPONENT_ALIAS

#define TIMEMORY_COMPONENT_ALIAS (   NAME,
  ... 
)
Value:
namespace tim \
{ \
namespace component \
{ \
using NAME = __VA_ARGS__; \
} \
}

Declare a non-templated alias to a component in the tim::component namespace.

\macro TIMEMORY_COMPONENT_ALIAS

Definition at line 205 of file macros.hpp.

◆ TIMEMORY_COMPONENT_HEADER_MODE

#define TIMEMORY_COMPONENT_HEADER_MODE

Definition at line 43 of file macros.hpp.

◆ TIMEMORY_DECLARE_API_COMPONENTS

#define TIMEMORY_DECLARE_API_COMPONENTS (   API,
  ... 
)
Value:
namespace tim \
{ \
namespace trait \
{ \
template <> \
struct api_components<API, void> \
{ \
using type = type_list<__VA_ARGS__>; \
}; \
} \
}

Declare a non-templated component type in the tim::component namespace.

\macro TIMEMORY_DECLARE_API_COMPONENTS

Definition at line 78 of file macros.hpp.

◆ TIMEMORY_DECLARE_COMPONENT

#define TIMEMORY_DECLARE_COMPONENT (   NAME)
Value:
namespace tim \
{ \
namespace component \
{ \
struct NAME; \
} \
namespace trait \
{ \
template <> \
struct is_component<component::NAME> : true_type \
{}; \
} \
}

Declare a non-templated component type in the tim::component namespace.

\macro TIMEMORY_DECLARE_COMPONENT

Definition at line 54 of file macros.hpp.

◆ TIMEMORY_DECLARE_EXTERN_COMPONENT

#define TIMEMORY_DECLARE_EXTERN_COMPONENT (   NAME,
  HAS_DATA,
  ... 
)
Value:
struct tim::component::base<TIMEMORY_ESC(tim::component::NAME), \
__VA_ARGS__>) \
TIMEMORY_DECLARE_EXTERN_OPERATIONS(TIMEMORY_ESC(component::NAME), HAS_DATA) \
TIMEMORY_DECLARE_EXTERN_STORAGE(TIMEMORY_ESC(component::NAME))
#define TIMEMORY_ESC(...)
Definition: macros.hpp:47
#define TIMEMORY_DECLARE_EXTERN_TEMPLATE(...)
Definition: types.hpp:78

Definition at line 720 of file macros.hpp.

◆ TIMEMORY_DECLARE_EXTERN_OPERATIONS

#define TIMEMORY_DECLARE_EXTERN_OPERATIONS (   TYPE,
  HAS_DATA 
)

Definition at line 470 of file macros.hpp.

◆ TIMEMORY_DECLARE_EXTERN_STORAGE

#define TIMEMORY_DECLARE_EXTERN_STORAGE (   TYPE)
Value:
TIMEMORY_EXTERN_STORAGE_ALIASES \
namespace tim \
{ \
extern template class impl::storage<TYPE, \
trait::uses_value_storage<TYPE>::value>; \
extern template class storage<TYPE, typename TYPE::value_type>; \
extern template class singleton<alias::storage_impl_t<TYPE>, \
alias::storage_pointer_t<TYPE>, TIMEMORY_API>; \
extern template storage_singleton<alias::storage_t<TYPE>>* \
get_storage_singleton<alias::storage_t<TYPE>>(); \
extern template storage_initializer storage_initializer::get<TYPE>(); \
namespace node \
{ \
extern template struct data<TYPE>; \
extern template struct graph<TYPE>; \
extern template struct result<TYPE>; \
extern template struct tree<TYPE>; \
} \
}

Definition at line 411 of file macros.hpp.

◆ TIMEMORY_DECLARE_TEMPLATE_COMPONENT

#define TIMEMORY_DECLARE_TEMPLATE_COMPONENT (   NAME,
  ... 
)
Value:
namespace tim \
{ \
namespace component \
{ \
template <__VA_ARGS__> \
struct NAME; \
} \
}

Declare a templated component type in the tim::component namespace.

\macro TIMEMORY_DECLARE_TEMPLATE_COMPONENT

Definition at line 162 of file macros.hpp.

◆ TIMEMORY_EXTERN_OPERATIONS

#define TIMEMORY_EXTERN_OPERATIONS (   ...)

Definition at line 687 of file macros.hpp.

◆ TIMEMORY_EXTERN_STORAGE

#define TIMEMORY_EXTERN_STORAGE (   ...)

Definition at line 693 of file macros.hpp.

◆ TIMEMORY_EXTERN_STORAGE_ALIASES

#define TIMEMORY_EXTERN_STORAGE_ALIASES
Value:
namespace tim \
{ \
namespace alias \
{ \
template <typename T> \
using storage_t = storage<T, typename T::value_type>; \
template <typename T> \
using storage_impl_t = impl::storage<T, trait::uses_value_storage<T>::value>; \
template <typename T> \
using storage_deleter_t = impl::storage_deleter<storage_impl_t<T>>; \
template <typename T> \
using storage_pointer_t = \
std::unique_ptr<alias::storage_impl_t<T>, alias::storage_deleter_t<T>>; \
} \
}

Definition at line 390 of file macros.hpp.

◆ TIMEMORY_EXTERN_TEMPLATE

#define TIMEMORY_EXTERN_TEMPLATE (   ...)

Definition at line 699 of file macros.hpp.

◆ TIMEMORY_INITIALIZE_STORAGE

#define TIMEMORY_INITIALIZE_STORAGE (   ...)
Value:
namespace tim \
{ \
namespace internal \
{ \
namespace initialization \
{ \
namespace \
{ \
using namespace ::tim::component; \
namespace component = ::tim::component; \
auto _TIM_STORAGE_INIT(__COUNTER__) = \
::tim::storage_initializer::get<__VA_ARGS__>(); \
} \
} \
} \
}

Definition at line 362 of file macros.hpp.

◆ TIMEMORY_INSTANTIATE_EXTERN_COMPONENT

#define TIMEMORY_INSTANTIATE_EXTERN_COMPONENT (   NAME,
  HAS_DATA,
  ... 
)
Value:
struct tim::component::base<TIMEMORY_ESC(tim::component::NAME), \
__VA_ARGS__>) \
TIMEMORY_INSTANTIATE_EXTERN_OPERATIONS(TIMEMORY_ESC(component::NAME), HAS_DATA) \
TIMEMORY_INSTANTIATE_EXTERN_STORAGE(TIMEMORY_ESC(component::NAME))
#define TIMEMORY_INSTANTIATE_EXTERN_TEMPLATE(...)
Definition: types.hpp:84

Definition at line 731 of file macros.hpp.

◆ TIMEMORY_INSTANTIATE_EXTERN_OPERATIONS

#define TIMEMORY_INSTANTIATE_EXTERN_OPERATIONS (   TYPE,
  HAS_DATA 
)

Definition at line 553 of file macros.hpp.

◆ TIMEMORY_INSTANTIATE_EXTERN_STORAGE

#define TIMEMORY_INSTANTIATE_EXTERN_STORAGE (   TYPE)
Value:
TIMEMORY_EXTERN_STORAGE_ALIASES \
namespace tim \
{ \
template class impl::storage<TYPE, trait::uses_value_storage<TYPE>::value>; \
template class storage<TYPE, typename TYPE::value_type>; \
template class singleton<alias::storage_impl_t<TYPE>, \
alias::storage_pointer_t<TYPE>, TIMEMORY_API>; \
template storage_singleton<alias::storage_t<TYPE>>* \
get_storage_singleton<alias::storage_t<TYPE>>(); \
template storage_initializer storage_initializer::get<TYPE>(); \
namespace node \
{ \
template struct data<TYPE>; \
template struct graph<TYPE>; \
template struct result<TYPE>; \
template struct tree<TYPE>; \
} \
} \
namespace \
{ \
using namespace ::tim::component; \
namespace component = ::tim::component; \
auto _TIM_STORAGE_INIT(__COUNTER__) = ::tim::storage_initializer::get<TYPE>(); \
}
storage_singleton< Tp > * get_storage_singleton()
Definition: declaration.hpp:75
singleton< Tp, std::unique_ptr< Tp, impl::storage_deleter< Tp > >, TIMEMORY_API > storage_singleton
Definition: types.hpp:177
auto get(const auto_bundle< Tag, Types... > &_obj)

Definition at line 436 of file macros.hpp.

◆ TIMEMORY_METADATA_SPECIALIZATION

#define TIMEMORY_METADATA_SPECIALIZATION (   TYPE,
  LABEL,
  BASIC_DESC,
  ... 
)
Value:
namespace tim \
{ \
namespace component \
{ \
template <> \
struct metadata<TYPE> \
{ \
using type = TYPE; \
using value_type = TIMEMORY_COMPONENT; \
\
static constexpr bool specialized() { return true; } \
static constexpr value_type value = properties<TYPE>::value; \
static std::string name() { return LABEL; } \
static std::string label() { return LABEL; } \
static std::string description() { return BASIC_DESC; } \
static std::string extra_description() \
{ \
return TIMEMORY_JOIN(" ", __VA_ARGS__); \
} \
}; \
} \
}
int TIMEMORY_COMPONENT
Definition: enum.h:659
tim::mpl::apply< std::string > string
Definition: macros.hpp:53
description("A generic option for any setting. Each argument MUST be passed in " "form: 'NAME=VALUE'. E.g. --timemory-args " "\"papi_events=PAPI_TOT_INS,PAPI_TOT_CYC\" text_output=off") .action([&](parser_t &p)
Definition: config.cpp:312
#define TIMEMORY_JOIN(delim,...)
Definition: macros.hpp:90

Specialization of the property specialization.

\macro TIMEMORY_METADATA_SPECIALIZATION

Definition at line 288 of file macros.hpp.

◆ TIMEMORY_PROPERTY_SPECIALIZATION

#define TIMEMORY_PROPERTY_SPECIALIZATION (   TYPE,
  ENUM,
  ID,
  ... 
)

Specialization of the property specialization.

\macro TIMEMORY_PROPERTY_SPECIALIZATION

Definition at line 223 of file macros.hpp.

◆ TIMEMORY_SET_COMPONENT_API

#define TIMEMORY_SET_COMPONENT_API (   COMP,
  ... 
)
Value:
namespace tim \
{ \
namespace trait \
{ \
template <> \
struct component_apis<COMP> \
{ \
using type = type_list<__VA_ARGS__>; \
}; \
} \
}

Declare a component is part of one or more APIs.

\macro TIMEMORY_SET_COMPONENT_APIS

Definition at line 100 of file macros.hpp.

◆ TIMEMORY_SET_TEMPLATE_COMPONENT_API

#define TIMEMORY_SET_TEMPLATE_COMPONENT_API (   TARGS,
  TSPECIAL,
  ... 
)
Value:
namespace tim \
{ \
namespace trait \
{ \
template <TARGS> \
struct component_apis<TSPECIAL> \
{ \
using type = type_list<__VA_ARGS__>; \
}; \
} \
}

Declare a component is part of one or more APIs.

\macro TIMEMORY_SET_TEMPLATE_COMPONENT_API

Definition at line 122 of file macros.hpp.

◆ TIMEMORY_STORAGE_INITIALIZER

#define TIMEMORY_STORAGE_INITIALIZER (   ...)    TIMEMORY_INITIALIZE_STORAGE(__VA_ARGS__)

Definition at line 384 of file macros.hpp.

◆ TIMEMORY_TEMPLATE_COMPONENT

#define TIMEMORY_TEMPLATE_COMPONENT (   NAME,
  TEMPLATE_PARAM,
  ... 
)
Value:
namespace tim \
{ \
namespace component \
{ \
template <TEMPLATE_PARAM> \
struct NAME; \
} \
namespace trait \
{ \
template <TEMPLATE_PARAM> \
struct is_component<component::NAME<__VA_ARGS__>> : true_type \
{}; \
} \
}

Declare a templated component type in the tim::component namespace.

\macro TIMEMORY_TEMPLATE_COMPONENT

Definition at line 180 of file macros.hpp.

◆ TIMEMORY_TOOLSET_ALIAS

#define TIMEMORY_TOOLSET_ALIAS (   NAME,
  WRAPPER,
  ... 
)
Value:
namespace tim \
{ \
namespace component \
{ \
namespace aliases \
{ \
using NAME = WRAPPER<__VA_ARGS__>; \
} \
} \
} \
using tim::component::aliases::NAME;

Creates an alias for a complex type when declaring the statistics type.

\macro TIMEMORY_TOOLSET_ALIAS

Definition at line 323 of file macros.hpp.