Ejemplo n.º 1
0
void
acc_init (acc_device_t d)
{
  if (!cached_base_dev)
    gomp_init_targets_once ();

  gomp_mutex_lock (&acc_device_lock);

  cached_base_dev = acc_init_1 (d);

  gomp_mutex_unlock (&acc_device_lock);
  
  goacc_attach_host_thread_to_device (-1);
}
Ejemplo n.º 2
0
void
acc_init (acc_device_t d)
{
  if (!base_dev)
    gomp_init_targets_once ();

  gomp_mutex_lock (&acc_device_lock);

  base_dev = acc_init_1 (d);

  lazy_open (-1);

  gomp_mutex_unlock (&acc_device_lock);
}
Ejemplo n.º 3
0
static struct gomp_device_descr *
lazy_init (acc_device_t d)
{
  if (base_dev)
    {
      /* Re-initializing the same device, do nothing.  */
      if (d == init_key)
	return base_dev;

      acc_shutdown_1 (init_key);
    }

  assert (!base_dev);

  return acc_init_1 (d);
}