Lines Matching +full:loc +full:- +full:code
3 * kmp_itt.inl -- Inline functions of ITT Notify.
6 //===----------------------------------------------------------------------===//
10 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
12 //===----------------------------------------------------------------------===//
48 // this API to support user-defined synchronization primitives, but does not use
71 kmp_itthash_t *h, ident_t *loc,
74 size_t bucket = __kmp_itthash_hash((kmp_intptr_t)loc, KMP_MAX_FRAME_DOMAINS);
75 for (entry = h->buckets[bucket]; entry; entry = entry->next_in_bucket)
76 if (entry->loc == loc && entry->team_size == team_size)
81 int cnt = KMP_TEST_THEN_INC32(&h->count);
83 KMP_TEST_THEN_DEC32(&h->count); // revert the count
89 entry->loc = loc;
90 entry->team_size = team_size;
91 entry->d = NULL;
92 entry->next_in_bucket = h->buckets[bucket];
93 while (!KMP_COMPARE_AND_STORE_PTR(&h->buckets[bucket],
94 entry->next_in_bucket, entry)) {
96 entry->next_in_bucket = h->buckets[bucket];
102 KMP_DEBUG_ASSERT(loc->psource == entry->loc->psource);
121 execute some more user code -- such a thread can execute tasks.
129 if (team->t.t_active_level > 1) {
134 ident_t *loc = th->th.th_ident;
135 if (!loc) {
140 e = __kmp_itthash_find(th, &__kmp_itt_region_domains, loc, team_size);
143 if (e->d == NULL) {
144 // Transform compiler-generated region location into the format
149 __kmp_str_loc_init(loc->psource, /* init_fname */ false);
154 e->d = __itt_domain_create(buff);
155 KMP_ASSERT(e->d != NULL);
161 e = __kmp_itthash_find(th, &__kmp_itt_barrier_domains, loc, 0);
163 KMP_DEBUG_ASSERT(e->d == NULL);
168 e->d = __itt_domain_create(buff);
169 KMP_ASSERT(e->d != NULL);
176 __itt_frame_begin_v3(e->d, NULL);
178 KMP_ITT_DEBUG_PRINT("[frm beg] gtid=%d, domain=%p, loc:%p\n", gtid, e->d,
179 loc);
183 // -----------------------------------------------------------------------------
186 ident_t *loc, int team_size, int region) {
188 if (!loc) {
196 if (team->t.t_active_level + serialized > 1) {
202 e = __kmp_itthash_find(th, &__kmp_itt_region_domains, loc, team_size);
205 if (e->d == NULL) { // new entry, need to calculate domain
206 // Transform compiler-generated region location into the format
211 __kmp_str_loc_init(loc->psource, /* init_fname */ false);
216 e->d = __itt_domain_create(buff);
217 KMP_ASSERT(e->d != NULL);
223 __itt_frame_submit_v3(e->d, NULL, begin, end);
226 "[reg sub] gtid=%d, domain=%p, region:%d, loc:%p, beg:%llu, end:%llu\n",
227 gtid, e->d, region, loc, begin, end);
231 e = __kmp_itthash_find(th, &__kmp_itt_barrier_domains, loc, 0);
234 if (e->d == NULL) { // new entry, need to calculate domain
235 // Transform compiler-generated region location into the format
239 __kmp_str_loc_init(loc->psource, /* init_fname */ false);
243 __kmp_str_format("%s$omp$barrier-imbalance:%d@%s:%d", str_loc.func,
250 e->d = __itt_domain_create(buff);
251 KMP_ASSERT(e->d != NULL);
256 __itt_frame_submit_v3(e->d, NULL, begin, end);
259 "[frm sub] gtid=%d, domain=%p, loc:%p, beg:%llu, end:%llu\n", gtid,
260 e->d, loc, begin, end);
265 // -----------------------------------------------------------------------------
294 // -----------------------------------------------------------------------------
295 LINKAGE void __kmp_itt_metadata_loop(ident_t *loc, kmp_uint64 sched_type,
312 KMP_DEBUG_ASSERT(loc->psource);
315 __kmp_str_loc_numbers(loc->psource, &line, &col);
327 // -----------------------------------------------------------------------------
328 LINKAGE void __kmp_itt_metadata_single(ident_t *loc) {
344 __kmp_str_loc_numbers(loc->psource, &line, &col);
354 // -----------------------------------------------------------------------------
360 // -----------------------------------------------------------------------------
366 // ----------------------------------------------------------------------------
370 if (team->t.t_active_level > 1) {
375 ident_t *loc = th->th.th_ident;
376 if (loc) {
378 loc, th->th.th_team_nproc);
381 KMP_DEBUG_ASSERT(e->d);
383 __itt_frame_end_v3(e->d, NULL);
384 KMP_ITT_DEBUG_PRINT("[frm end] gtid=%d, domain=%p, loc:%p\n", gtid, e->d,
385 loc);
393 1. Gather -- primary thread waits for all worker threads to arrive; each
395 2. Release -- each worker thread waits until primary thread lets it go;
399 * __kmp_itt_barrier_starting() -- before arriving to the gather phase.
400 * __kmp_itt_barrier_middle() -- between gather and release phases.
401 * __kmp_itt_barrier_finished() -- after release phase.
419 // value; specify -1 to get previous
425 kmp_team_t *team = thr->th.th_team;
435 team->t.t_bar[bt].b_arrived / KMP_BARRIER_STATE_BUMP + delta;
453 ident_t const *loc = NULL;
459 // saves location in thr->th.th_ident.
460 loc = thr->th.th_ident;
464 if (loc != NULL) {
465 src = loc->psource;
466 expl = (loc->flags & KMP_IDENT_BARRIER_EXPL) != 0;
467 impl = (loc->flags & KMP_IDENT_BARRIER_IMPL) != 0;
470 switch (loc->flags & KMP_IDENT_BARRIER_IMPL_MASK) {
493 // In case of fork/join barrier we can read thr->th.th_ident, because it
495 // such one). Use th_ident of primary thread instead --
502 loc = team->t.t_ident;
503 if (loc != NULL) {
504 src = loc->psource;
520 // -----------------------------------------------------------------------------
534 // -----------------------------------------------------------------------------
549 // -----------------------------------------------------------------------------
570 kmp_taskdata_t *taskdata = thread->th.th_current_task;
572 taskdata->td_taskwait_counter %
582 kmp_taskdata_t *taskdata = thread->th.th_current_task;
583 ident_t const *loc = taskdata->td_taskwait_ident;
584 char const *src = (loc == NULL ? NULL : loc->psource);
623 // -----------------------------------------------------------------------------
652 const ident_t *loc) {
655 char const *src = (loc == NULL ? NULL : loc->psource);
664 // Internal guts -- common code for locks and critical sections, do not call
669 ident_t const *loc = NULL;
671 loc = __kmp_get_user_lock_location_((lock));
672 char const *src = (loc == NULL ? NULL : loc->psource);
682 // Internal guts -- common code for locks and critical sections, do not call
692 // -----------------------------------------------------------------------------
694 void __kmp_itt_lock_creating(kmp_user_lock_p lock, const ident_t *loc) {
695 ___kmp_itt_lock_init(lock, "OMP Lock", loc);
709 __itt_sync_prepare(ilk->lock);
725 __itt_sync_acquired(ilk->lock);
740 __itt_sync_releasing(ilk->lock);
755 __itt_sync_cancel(ilk->lock);
773 void __kmp_itt_critical_creating(kmp_user_lock_p lock, const ident_t *loc) {
774 ___kmp_itt_lock_init(lock, "OMP Critical", loc);
804 ident_t *loc = thr->th.th_ident;
805 char const *src = (loc == NULL ? NULL : loc->psource);
808 __kmp_str_buf_print(&name, "OMP Single-%s", src);
810 thr->th.th_itt_mark_single = __itt_mark_create(name.str);
811 KMP_ITT_DEBUG_PRINT("[sin sta] mcre( \"%s\") -> %d\n", name.str,
812 thr->th.th_itt_mark_single);
815 __itt_mark(thr->th.th_itt_mark_single, NULL);
817 thr->th.th_itt_mark_single);
824 __itt_mark_type mark = __kmp_thread_from_gtid(gtid)->th.th_itt_mark_single;
837 * __kmp_itt_ordered_start is called just before entering user code (after
839 * __kmp_itt_ordered_end is called after returning from user code.
841 Sync object is th->th.th_dispatch->th_dispatch_sh_current.
848 ident_t const *loc = thr->th.th_ident;
849 char const *src = (loc == NULL ? NULL : loc->psource);
850 __itt_sync_create(thr->th.th_dispatch->th_dispatch_sh_current,
860 if (!t->t.t_serialized) {
862 __itt_sync_prepare(th->th.th_dispatch->th_dispatch_sh_current);
872 if (!t->t.t_serialized) {
874 __itt_sync_acquired(th->th.th_dispatch->th_dispatch_sh_current);
884 if (!t->t.t_serialized) {
886 __itt_sync_releasing(th->th.th_dispatch->th_dispatch_sh_current);
917 ITT catches operations with system sync objects (like Windows* OS on IA-32