6#include "gtest/gtest.h"
11TEST(CompareOperatorTests, ThreadBeginIdentity) {
14 auto TBWorker =
OAE::ThreadBegin(
"dflt",
"", OS::Always, ompt_thread_worker);
19 ASSERT_EQ(TBInitial, TBInitial);
20 ASSERT_EQ(TBWorker, TBWorker);
21 ASSERT_EQ(TBOther, TBOther);
22 ASSERT_EQ(TBUnknown, TBUnknown);
25TEST(CompareOperatorTests, ThreadEndIdentity) {
31TEST(CompareOperatorTests, ParallelBeginIdentity) {
34 ASSERT_EQ(PBNumT, PBNumT);
37TEST(CompareOperatorTests, ParallelEndIdentity) {
41 ASSERT_EQ(PEDflt, PEDflt);
44TEST(CompareOperatorTests, WorkIdentity) {
46 OAE::Work(
"loopbgn",
"", OS::Always, ompt_work_loop, ompt_scope_begin);
48 OAE::Work(
"loopend",
"", OS::Always, ompt_work_loop, ompt_scope_end);
50 ASSERT_EQ(WDLoopBgn, WDLoopBgn);
51 ASSERT_EQ(WDLoopEnd, WDLoopEnd);
53 auto WDSectionsBgn =
OAE::Work(
"sectionsbgn",
"", OS::Always,
54 ompt_work_sections, ompt_scope_begin);
55 auto WDSectionsEnd =
OAE::Work(
"sectionsend",
"", OS::Always,
56 ompt_work_sections, ompt_scope_end);
61 ASSERT_EQ(WDSectionsBgn, WDSectionsBgn);
62 ASSERT_EQ(WDSectionsEnd, WDSectionsEnd);
65TEST(CompareOperatorTests, DispatchIdentity) {
68 ASSERT_EQ(DIDflt, DIDflt);
71TEST(CompareOperatorTests, TaskCreateIdentity) {
74 ASSERT_EQ(TCDflt, TCDflt);
77TEST(CompareOperatorTests, TaskScheduleIdentity) {
83TEST(CompareOperatorTests, ImplicitTaskIdentity) {
88 ASSERT_EQ(ITDfltBgn, ITDfltBgn);
89 ASSERT_EQ(ITDfltEnd, ITDfltEnd);
92TEST(CompareOperatorTests, SyncRegionIdentity) {
95 ompt_sync_region_barrier_explicit, ompt_scope_begin);
98 ompt_sync_region_barrier_explicit, ompt_scope_end);
100 ASSERT_EQ(SRDfltBgn, SRDfltBgn);
101 ASSERT_EQ(SRDfltEnd, SRDfltEnd);
104TEST(CompareOperatorTests, TargetIdentity) {
106 OAE::Target(
"dfltbgn",
"", OS::Always, ompt_target, ompt_scope_begin);
108 OAE::Target(
"dfltend",
"", OS::Always, ompt_target, ompt_scope_end);
110 ASSERT_EQ(TargetDfltBgn, TargetDfltBgn);
111 ASSERT_EQ(TargetDfltEnd, TargetDfltEnd);
113 auto TargetDevBgn =
OAE::Target(
"tgtdevbgn",
"", OS::Always, ompt_target,
114 ompt_scope_begin, 1);
116 OAE::Target(
"tgtdevend",
"", OS::Always, ompt_target, ompt_scope_end, 1);
118 ASSERT_EQ(TargetDevBgn, TargetDevBgn);
119 ASSERT_EQ(TargetDevEnd, TargetDevEnd);
122TEST(CompareOperatorTests, BufferRecordIdentity) {
129 ompt_callback_target_submit, 10);
133 ompt_callback_target_submit, {10, 100});
135 ASSERT_EQ(BRDflt, BRDflt);
136 ASSERT_EQ(BRMinSet, BRMinSet);
137 ASSERT_EQ(BRMinMaxSet, BRMinMaxSet);
Contains assertion event constructors, for generally all observable events.
Contains all asserter-related class declarations and important enums.
#define TEST(test_suite_name, test_name)
This file represents the main header file for usage of the ompTest library.
#define OMPTEST_TESTSUITE_MAIN()
omptest::OmptAssertEvent OAE
Assertion event struct, provides statically callable CTORs.
static OmptAssertEvent SyncRegion(const std::string &Name, const std::string &Group, const ObserveState &Expected, ompt_sync_region_t Kind, ompt_scope_endpoint_t Endpoint, ompt_data_t *ParallelData=expectedDefault(ompt_data_t *), ompt_data_t *TaskData=expectedDefault(ompt_data_t *), const void *CodeptrRA=expectedDefault(const void *))
static OmptAssertEvent BufferRecord(const std::string &Name, const std::string &Group, const ObserveState &Expected, ompt_record_ompt_t *Record)
static OmptAssertEvent Dispatch(const std::string &Name, const std::string &Group, const ObserveState &Expected, ompt_data_t *ParallelData=expectedDefault(ompt_data_t *), ompt_data_t *TaskData=expectedDefault(ompt_data_t *), ompt_dispatch_t Kind=expectedDefault(ompt_dispatch_t), ompt_data_t Instance=expectedDefault(ompt_data_t))
static OmptAssertEvent TaskSchedule(const std::string &Name, const std::string &Group, const ObserveState &Expected)
static OmptAssertEvent ParallelEnd(const std::string &Name, const std::string &Group, const ObserveState &Expected, ompt_data_t *ParallelData=expectedDefault(ompt_data_t *), ompt_data_t *EncounteringTaskData=expectedDefault(ompt_data_t *), int Flags=expectedDefault(int), const void *CodeptrRA=expectedDefault(const void *))
static OmptAssertEvent Work(const std::string &Name, const std::string &Group, const ObserveState &Expected, ompt_work_t WorkType, ompt_scope_endpoint_t Endpoint, ompt_data_t *ParallelData=expectedDefault(ompt_data_t *), ompt_data_t *TaskData=expectedDefault(ompt_data_t *), uint64_t Count=expectedDefault(uint64_t), const void *CodeptrRA=expectedDefault(const void *))
static OmptAssertEvent ThreadEnd(const std::string &Name, const std::string &Group, const ObserveState &Expected)
static OmptAssertEvent ParallelBegin(const std::string &Name, const std::string &Group, const ObserveState &Expected, int NumThreads)
static OmptAssertEvent TaskCreate(const std::string &Name, const std::string &Group, const ObserveState &Expected, ompt_data_t *EncounteringTaskData=expectedDefault(ompt_data_t *), const ompt_frame_t *EncounteringTaskFrame=expectedDefault(ompt_frame_t *), ompt_data_t *NewTaskData=expectedDefault(ompt_data_t *), int Flags=expectedDefault(int), int HasDependences=expectedDefault(int), const void *CodeptrRA=expectedDefault(const void *))
static OmptAssertEvent ThreadBegin(const std::string &Name, const std::string &Group, const ObserveState &Expected, ompt_thread_t ThreadType)
static OmptAssertEvent ImplicitTask(const std::string &Name, const std::string &Group, const ObserveState &Expected, ompt_scope_endpoint_t Endpoint, ompt_data_t *ParallelData=expectedDefault(ompt_data_t *), ompt_data_t *TaskData=expectedDefault(ompt_data_t *), unsigned int ActualParallelism=expectedDefault(unsigned int), unsigned int Index=expectedDefault(unsigned int), int Flags=expectedDefault(int))
static OmptAssertEvent Target(const std::string &Name, const std::string &Group, const ObserveState &Expected, ompt_target_t Kind, ompt_scope_endpoint_t Endpoint, int DeviceNum=expectedDefault(int), ompt_data_t *TaskData=expectedDefault(ompt_data_t *), ompt_id_t TargetId=expectedDefault(ompt_id_t), const void *CodeptrRA=expectedDefault(void *))