Esempio n. 1
0
/* ========================================================================== */
VOID ILDJIT_startInitParallelLoop(ADDRINT loop) {
    // XXX: HELIX will make this check, so we don't need to.
    //    if (!reached_start_invocation)
    //        return;

    vector<double> scaling;
    double serial_runtime = 0;

    if (!KnobPredictedSpeedupFile.Value().empty()) {
        string loop_name((const char*)loop);
        scaling = GetHelixLoopScaling(loop_name);
        loop_data* data = GetHelixFullLoopData(loop_name);
        serial_runtime = data->serial_runtime;
    }

    /* Invoke the allocator and let HELIX adjust its number of threads
     * before starting the loop. */
    int allocation = AllocateCores(scaling, serial_runtime);
    *allocated_cores = allocation;

    /* TODO: we need some special logic here if allocation == 1.
     * In that case, HELIX still tries to form a ring between cores 0 and 0,
     * and bad things happen. The right thing is to fix it in the HELIX runtime.
     * A dirty hack would be to overwrite automaticParallelizationSingleThread
     * from this callback, and set it back in endParallelLoop. This might get ugly
     * fast. */
}
Esempio n. 2
0
void		name_champ(t_sdl *cor, t_champ *champ)
{
  int		i;
  t_champ	*tmp;
  SDL_Rect	position;

  position.x = 100;
  position.y = 10;
  i = 0;
  if ((cor->font = TTF_OpenFont(MAIN_TF, 20)) == NULL)
    exit(0);
  tmp = champ;
  while (tmp != NULL)
    {
      loop_name(&position, cor, i, tmp);
      i++;
      tmp = tmp->next;
    }
  if (i < 4)
    cor->name[i] = NULL;
}