kokkos-execution 0.0.1
Loading...
Searching...
No Matches
callback_matchers.hpp File Reference
#include <string>
#include <string_view>
#include "Kokkos_Core.hpp"
#include "kokkos-utils/callbacks/Helpers.hpp"

Go to the source code of this file.

Classes

struct  EventDiscardMatcher< Exec >
 Matcher to filter out events that are just noise for tests. More...

Macros

#define MATCHER_FOR_NAME(_type_, _name_)
#define MATCHER_FOR_DEV_ID(_type_, _exec_)
#define MATCHER_FOR_BEGIN_FENCE(_exec_, _label_)
#define MATCHER_FOR_BEGIN_PFOR(_exec_, _label_)
#define MATCHER_FOR_BEGIN_PRED(_exec_, _label_)
#define MATCHER_FOR_PUSH_REGION(_label_)
#define MATCHER_FOR_POP_REGION()
#define MATCHER_FOR_BEGIN_DEEP_COPY(_dst_, _src_)
#define MATCHER_FOR_RECORD_EVENT(_exec_)
#define MATCHER_FOR_WAIT_EVENT(_record_event_variant_)

Functions

template<Kokkos::ExecutionSpace Exec, std::convertible_to< std::string_view > Label>
constexpr std::string dispatch_label (const Exec &, Label &&label)
 Get the dispatch label from Exec and label.

Detailed Description

This file provides some helpers for matchers from Kokkos::utils::callbacks.

Todo
Let's revisit these helpers in light of what happens in https://github.com/uliegecsm/kokkos-utils/issues/42.

Definition in file callback_matchers.hpp.

Macro Definition Documentation

◆ MATCHER_FOR_BEGIN_DEEP_COPY

#define MATCHER_FOR_BEGIN_DEEP_COPY ( _dst_,
_src_ )

◆ MATCHER_FOR_BEGIN_FENCE

#define MATCHER_FOR_BEGIN_FENCE ( _exec_,
_label_ )
Value:
ABeginFenceEvent(MATCHER_FOR_NAME(BeginFence, _label_), MATCHER_FOR_DEV_ID(BeginFence, _exec_))
#define MATCHER_FOR_DEV_ID(_type_, _exec_)
#define MATCHER_FOR_NAME(_type_, _name_)

Definition at line 28 of file callback_matchers.hpp.

◆ MATCHER_FOR_BEGIN_PFOR

#define MATCHER_FOR_BEGIN_PFOR ( _exec_,
_label_ )
Value:
ABeginParallelForEvent(MATCHER_FOR_NAME(BeginParallelFor, _label_), MATCHER_FOR_DEV_ID(BeginParallelFor, _exec_))

Definition at line 30 of file callback_matchers.hpp.

◆ MATCHER_FOR_BEGIN_PRED

#define MATCHER_FOR_BEGIN_PRED ( _exec_,
_label_ )
Value:
ABeginParallelReduceEvent( \
MATCHER_FOR_NAME(BeginParallelReduce, _label_), MATCHER_FOR_DEV_ID(BeginParallelReduce, _exec_))

Definition at line 32 of file callback_matchers.hpp.

◆ MATCHER_FOR_DEV_ID

#define MATCHER_FOR_DEV_ID ( _type_,
_exec_ )
Value:
::testing::Field( \
&Kokkos::utils::callbacks::_type_##Event::dev_id, \
::testing::Eq(Kokkos::Tools::Experimental::device_id(_exec_)))

Definition at line 23 of file callback_matchers.hpp.

◆ MATCHER_FOR_NAME

#define MATCHER_FOR_NAME ( _type_,
_name_ )
Value:
::testing::Field(&Kokkos::utils::callbacks::_type_##Event::name, ::testing::StrEq(_name_))

Definition at line 20 of file callback_matchers.hpp.

◆ MATCHER_FOR_POP_REGION

#define MATCHER_FOR_POP_REGION ( )
Value:
APopRegionEvent()

Definition at line 36 of file callback_matchers.hpp.

◆ MATCHER_FOR_PUSH_REGION

#define MATCHER_FOR_PUSH_REGION ( _label_)
Value:
APushRegionEventWithName(::testing::StrEq(_label_))

Definition at line 35 of file callback_matchers.hpp.

◆ MATCHER_FOR_RECORD_EVENT

#define MATCHER_FOR_RECORD_EVENT ( _exec_)
Value:
ARecordEvent( \
::testing::Field( \
::testing::Eq(Kokkos::Tools::Experimental::device_id(_exec_))))

Definition at line 57 of file callback_matchers.hpp.

◆ MATCHER_FOR_WAIT_EVENT

#define MATCHER_FOR_WAIT_EVENT ( _record_event_variant_)
Value:
AWaitEvent( \
::testing::Field( \
::testing::Eq(std::get<Kokkos::Execution::Impl::RecordEvent>(_record_event_variant_).event_id)))

Definition at line 63 of file callback_matchers.hpp.

Function Documentation

◆ dispatch_label()

template<Kokkos::ExecutionSpace Exec, std::convertible_to< std::string_view > Label>
std::string dispatch_label ( const Exec & ,
Label && label )
constexpr

Get the dispatch label from Exec and label.

Definition at line 47 of file callback_matchers.hpp.