oacc-init.c (acc_init): Remove !cached_base_dev condition on call to gomp_init_targets_once.
2016-05-17 Chung-Lin Tang <cltang@codesourcery.com> libgomp/ * oacc-init.c (acc_init): Remove !cached_base_dev condition on call to gomp_init_targets_once. (acc_set_device_type): Remove !cached_base_dev condition on call to gomp_init_targets_once, move call to before acc_device_lock acquire, to avoid deadlock. (acc_get_device_num): Remove !cached_base_dev condition on call to gomp_init_targets_once. (acc_set_device_num): Likewise. From-SVN: r236310
This commit is contained in:
parent
d35c169874
commit
e37288a608
|
@ -1,3 +1,14 @@
|
||||||
|
2016-05-17 Chung-Lin Tang <cltang@codesourcery.com>
|
||||||
|
|
||||||
|
* oacc-init.c (acc_init): Remove !cached_base_dev condition on call
|
||||||
|
to gomp_init_targets_once.
|
||||||
|
(acc_set_device_type): Remove !cached_base_dev condition on call to
|
||||||
|
gomp_init_targets_once, move call to before acc_device_lock acquire,
|
||||||
|
to avoid deadlock.
|
||||||
|
(acc_get_device_num): Remove !cached_base_dev condition on call to
|
||||||
|
gomp_init_targets_once.
|
||||||
|
(acc_set_device_num): Likewise.
|
||||||
|
|
||||||
2016-05-16 Martin Jambor <mjambor@suse.cz>
|
2016-05-16 Martin Jambor <mjambor@suse.cz>
|
||||||
|
|
||||||
* testsuite/libgomp.hsa.c/complex-align-2.c: New test.
|
* testsuite/libgomp.hsa.c/complex-align-2.c: New test.
|
||||||
|
|
|
@ -433,8 +433,7 @@ goacc_attach_host_thread_to_device (int ord)
|
||||||
void
|
void
|
||||||
acc_init (acc_device_t d)
|
acc_init (acc_device_t d)
|
||||||
{
|
{
|
||||||
if (!cached_base_dev)
|
gomp_init_targets_once ();
|
||||||
gomp_init_targets_once ();
|
|
||||||
|
|
||||||
gomp_mutex_lock (&acc_device_lock);
|
gomp_mutex_lock (&acc_device_lock);
|
||||||
|
|
||||||
|
@ -498,10 +497,9 @@ acc_set_device_type (acc_device_t d)
|
||||||
struct gomp_device_descr *base_dev, *acc_dev;
|
struct gomp_device_descr *base_dev, *acc_dev;
|
||||||
struct goacc_thread *thr = goacc_thread ();
|
struct goacc_thread *thr = goacc_thread ();
|
||||||
|
|
||||||
gomp_mutex_lock (&acc_device_lock);
|
gomp_init_targets_once ();
|
||||||
|
|
||||||
if (!cached_base_dev)
|
gomp_mutex_lock (&acc_device_lock);
|
||||||
gomp_init_targets_once ();
|
|
||||||
|
|
||||||
cached_base_dev = base_dev = resolve_device (d, true);
|
cached_base_dev = base_dev = resolve_device (d, true);
|
||||||
acc_dev = &base_dev[goacc_device_num];
|
acc_dev = &base_dev[goacc_device_num];
|
||||||
|
@ -563,8 +561,7 @@ acc_get_device_num (acc_device_t d)
|
||||||
if (d >= _ACC_device_hwm)
|
if (d >= _ACC_device_hwm)
|
||||||
gomp_fatal ("unknown device type %u", (unsigned) d);
|
gomp_fatal ("unknown device type %u", (unsigned) d);
|
||||||
|
|
||||||
if (!cached_base_dev)
|
gomp_init_targets_once ();
|
||||||
gomp_init_targets_once ();
|
|
||||||
|
|
||||||
gomp_mutex_lock (&acc_device_lock);
|
gomp_mutex_lock (&acc_device_lock);
|
||||||
dev = resolve_device (d, true);
|
dev = resolve_device (d, true);
|
||||||
|
@ -584,8 +581,7 @@ acc_set_device_num (int ord, acc_device_t d)
|
||||||
struct gomp_device_descr *base_dev, *acc_dev;
|
struct gomp_device_descr *base_dev, *acc_dev;
|
||||||
int num_devices;
|
int num_devices;
|
||||||
|
|
||||||
if (!cached_base_dev)
|
gomp_init_targets_once ();
|
||||||
gomp_init_targets_once ();
|
|
||||||
|
|
||||||
if (ord < 0)
|
if (ord < 0)
|
||||||
ord = goacc_device_num;
|
ord = goacc_device_num;
|
||||||
|
|
Loading…
Reference in New Issue