• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/openmp/runtime/src/

Lines Matching refs:victim

972     // Other threads will inspect this variable when searching for a victim.
1216 // note: victim thread can potentially execute another loop
1217 // TODO: algorithm of searching for a victim
1220 dispatch_private_info_template<T> *victim;
1224 victim = reinterpret_cast<dispatch_private_info_template<T> *>(
1226 KMP_DEBUG_ASSERT(victim);
1227 while ((victim == pr || id != victim->u.p.static_steal_counter) &&
1230 victim = reinterpret_cast<dispatch_private_info_template<T> *>(
1232 KMP_DEBUG_ASSERT(victim);
1234 if (victim == pr || id != victim->u.p.static_steal_counter) {
1236 // no victim is ready yet to participate in stealing
1237 // because no victim passed kmp_init_dispatch yet
1239 if (victim->u.p.count + 2 > (UT)victim->u.p.ub) {
1241 continue; // not enough chunks to steal, goto next victim
1244 lck = victim->u.p.th_steal_lock;
1247 limit = victim->u.p.ub; // keep initial ub
1248 if (victim->u.p.count >= limit ||
1249 (remaining = limit - victim->u.p.count) < 2) {
1251 pr->u.p.parm4 = (victimIdx + 1) % nproc; // next victim
1254 // stealing succeeded, reduce victim's ub by 1/4 of undone chunks or
1259 init = (victim->u.p.ub -= (remaining >> 2));
1263 init = (victim->u.p.ub -= 1);
1268 pr->u.p.parm4 = victimIdx; // remember victim to steal from
1276 } // while (search for victim)
1277 } // if (try to find victim and steal)
1315 // note: victim thread can potentially execute another loop
1316 // TODO: algorithm of searching for a victim
1319 dispatch_private_info_template<T> *victim;
1324 victim = reinterpret_cast<dispatch_private_info_template<T> *>(
1326 KMP_DEBUG_ASSERT(victim);
1327 while ((victim == pr || id != victim->u.p.static_steal_counter) &&
1330 victim = reinterpret_cast<dispatch_private_info_template<T> *>(
1332 KMP_DEBUG_ASSERT(victim);
1334 if (victim == pr || id != victim->u.p.static_steal_counter) {
1336 // no victim is ready yet to participate in stealing
1337 // because no victim passed kmp_init_dispatch yet
1339 pr->u.p.parm4 = victimIdx; // new victim found
1340 while (1) { // CAS loop if victim has enough chunks to steal
1341 vold.b = *(volatile kmp_int64 *)(&victim->u.p.count);
1347 pr->u.p.parm4 = (victimIdx + 1) % nproc; // shift start victim id
1348 break; // not enough chunks to steal, goto next victim
1358 (volatile kmp_int64 *)&victim->u.p.count,
1377 } // while (try to steal from particular victim)
1378 } // while (search for victim)
1379 } // if (try to find victim and steal)