File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ namespace opdi {
4242 virtual std::size_t getNestLockIdentifier (omp_nest_lock_t * lock) = 0;
4343 virtual std::size_t getCriticalIdentifier (std::string const & name) = 0;
4444 virtual std::size_t getReductionIdentifier () = 0;
45+ virtual std::size_t getOrderedIdentifier () = 0;
4546
4647 virtual void * getParallelData () = 0;
4748 virtual void * getTaskData () = 0;
Original file line number Diff line number Diff line change 181181#define OPDI_ORDERED (...) \
182182 OPDI_PRAGMA (omp ordered __VA_ARGS__) \
183183 { \
184- opdi::logic->onMutexAcquired (opdi::LogicInterface::MutexKind::Ordered, 0 );
184+ opdi::logic->onMutexAcquired (opdi::LogicInterface::MutexKind::Ordered, opdi::backend-> getOrderedIdentifier () );
185185
186186#define OPDI_END_ORDERED \
187- opdi::logic->onMutexReleased (opdi::LogicInterface::MutexKind::Ordered, 0 ); \
187+ opdi::logic->onMutexReleased (opdi::LogicInterface::MutexKind::Ordered, opdi::backend-> getOrderedIdentifier () ); \
188188 }
189189
190190#define OPDI_SECTION (...) \
Original file line number Diff line number Diff line change @@ -49,6 +49,14 @@ namespace opdi {
4949 omp_destroy_lock (&this ->criticalLock );
5050 }
5151
52+ std::size_t getLockIdentifier (omp_lock_t * lock) {
53+ return reinterpret_cast <std::size_t >(lock);
54+ }
55+
56+ std::size_t getNestLockIdentifier (omp_nest_lock_t * lock) {
57+ return reinterpret_cast <std::size_t >(lock);
58+ }
59+
5260 std::size_t getCriticalIdentifier (std::string const & name) {
5361 // unnamed critical region has index 0
5462 if (name.empty ()) {
@@ -69,12 +77,8 @@ namespace opdi {
6977 return reinterpret_cast <std::size_t >(opdi::backend->getParallelData ());
7078 }
7179
72- std::size_t getLockIdentifier (omp_lock_t * lock) {
73- return reinterpret_cast <std::size_t >(lock);
74- }
75-
76- std::size_t getNestLockIdentifier (omp_nest_lock_t * lock) {
77- return reinterpret_cast <std::size_t >(lock);
80+ std::size_t getOrderedIdentifier () {
81+ return reinterpret_cast <std::size_t >(opdi::backend->getParallelData ());
7882 }
7983 };
8084
Original file line number Diff line number Diff line change @@ -164,14 +164,19 @@ namespace opdi {
164164
165165 std::size_t getCriticalIdentifier (std::string const & name) {
166166 OPDI_UNUSED (name);
167- OPDI_ERROR (" OMPT backend does not support explicit queries of mutex identifiers of critical regions ." );
167+ OPDI_ERROR (" OMPT backend does not support explicit queries of mutex identifiers of critical constructs ." );
168168 return 0 ;
169169 }
170170
171171 std::size_t getReductionIdentifier () {
172172 return reinterpret_cast <std::size_t >(getParallelData ());
173173 }
174174
175+ std::size_t getOrderedIdentifier () {
176+ OPDI_ERROR (" OMPT backend does not support explicit queries of mutex identifiers of ordered constructs." );
177+ return 0 ;
178+ }
179+
175180 void * getParallelData () {
176181 ompt_data_t * parallelData;
177182 int teamSize;
You can’t perform that action at this time.
0 commit comments