Commit ecd4fd43 by Thomas Schwinge Committed by Thomas Schwinge

libgomp testsuite: Remove some explicit acc_device_nvidia usage.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/lib-1.c: Remove explicit
	acc_device_nvidia usage.
	* testsuite/libgomp.oacc-c-c++-common/lib-10.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-9.c: Likewise.

From-SVN: r229381
parent aa8b7d30
2015-10-26 Thomas Schwinge <thomas@codesourcery.com> 2015-10-26 Thomas Schwinge <thomas@codesourcery.com>
* testsuite/libgomp.oacc-c-c++-common/lib-1.c: Remove explicit
acc_device_nvidia usage.
* testsuite/libgomp.oacc-c-c++-common/lib-10.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-9.c: Likewise.
* oacc-init.c (acc_shutdown): Call gomp_init_targets_once. * oacc-init.c (acc_shutdown): Call gomp_init_targets_once.
* testsuite/libgomp.oacc-c-c++-common/lib-8.c: New file. * testsuite/libgomp.oacc-c-c++-common/lib-8.c: New file.
......
...@@ -6,19 +6,9 @@ ...@@ -6,19 +6,9 @@
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
acc_device_t devtype = acc_device_host; acc_init (acc_device_default);
#if ACC_DEVICE_TYPE_nvidia
devtype = acc_device_nvidia;
if (acc_get_num_devices (devtype) == 0)
return 0;
#endif
acc_init (devtype);
fprintf (stderr, "CheCKpOInT\n"); fprintf (stderr, "CheCKpOInT\n");
acc_init (devtype); acc_init (acc_device_default);
return 0; return 0;
} }
......
...@@ -7,14 +7,7 @@ int ...@@ -7,14 +7,7 @@ int
main (int argc, char **argv) main (int argc, char **argv)
{ {
void *d; void *d;
acc_device_t devtype = acc_device_host; acc_device_t devtype = acc_device_default;
#if ACC_DEVICE_TYPE_nvidia
devtype = acc_device_nvidia;
if (acc_get_num_devices (acc_device_nvidia) == 0)
return 0;
#endif
acc_init (devtype); acc_init (devtype);
......
...@@ -6,21 +6,10 @@ ...@@ -6,21 +6,10 @@
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
acc_device_t devtype = acc_device_host; acc_init (acc_device_default);
acc_shutdown (acc_device_default);
#if ACC_DEVICE_TYPE_nvidia
devtype = acc_device_nvidia;
if (acc_get_num_devices (acc_device_nvidia) == 0)
return 0;
#endif
acc_init (devtype);
acc_shutdown (devtype);
fprintf (stderr, "CheCKpOInT\n"); fprintf (stderr, "CheCKpOInT\n");
acc_shutdown (devtype); acc_shutdown (acc_device_default);
return 0; return 0;
} }
......
...@@ -9,18 +9,17 @@ main (int argc, char **argv) ...@@ -9,18 +9,17 @@ main (int argc, char **argv)
int i; int i;
int num_devices; int num_devices;
int devnum; int devnum;
acc_device_t devtype = acc_device_host; acc_device_t devtype = acc_device_default;
#if ACC_DEVICE_TYPE_nvidia
devtype = acc_device_nvidia;
#endif
num_devices = acc_get_num_devices (devtype); num_devices = acc_get_num_devices (devtype);
if (num_devices == 0) if (num_devices == 0)
return 0; abort ();
acc_init (devtype); acc_init (devtype);
if (num_devices != acc_get_num_devices (devtype))
abort ();
for (i = 0; i < num_devices; i++) for (i = 0; i < num_devices; i++)
{ {
acc_set_device_num (i, devtype); acc_set_device_num (i, devtype);
...@@ -31,8 +30,7 @@ main (int argc, char **argv) ...@@ -31,8 +30,7 @@ main (int argc, char **argv)
acc_shutdown (devtype); acc_shutdown (devtype);
num_devices = acc_get_num_devices (devtype); if (num_devices != acc_get_num_devices (devtype))
if (num_devices == 0)
abort (); abort ();
for (i = 0; i < num_devices; i++) for (i = 0; i < num_devices; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment