@@ -1,5 +1,11 @@
2014-11-05 Thomas Schwinge <thomas@codesourcery.com>
+ * target.h (struct ACC_dispatch_t): Remove avail_func. Update all
+ users.
+ * oacc-host.c (openacc_avail): Likewise.
+ * plugin-nvptx.c (PTX_avail, openacc_avail): Likewise.
+ * libgomp.texi (acc_get_num_devices): Revise.
+
* testsuite/libgomp.oacc-c/goacc_kernels.c: Remove file.
* testsuite/libgomp.oacc-c/goacc_parallel.c: Remove file.
@@ -187,12 +187,12 @@ API routines for target platforms.
@node acc_get_num_devices
@section @code{acc_get_num_devices} -- Get number of devices for given device type
@table @asis
-item @emph{Description}
-This routine returns a value, between 0 and @emph{n}, indicating the
-number of devices available for the given device type. It determines
-the number of devices in a @emph{passive} manner. In other words, it
+@item @emph{Description}
+This routine returns a value indicating the
+number of devices available for the given device type. It determines
+the number of devices in a @emph{passive} manner. In other words, it
does not alter the state within the runtime environment aside from
-possibly initializing an uninitialized device. This aspect allows
+possibly initializing an uninitialized device. This aspect allows
the routine to be called without concern for altering the interaction
with an attached accelerator device.
@@ -153,16 +153,6 @@ device_get_table (struct mapping_table **table)
return 0;
}
-STATIC bool
-openacc_avail (void)
-{
-#ifdef DEBUG
- fprintf (stderr, SELF "%s:%s\n", __FILE__, __FUNCTION__);
-#endif
-
- return 1;
-}
-
STATIC void *
openacc_open_device (int n)
{
@@ -414,9 +404,6 @@ static struct gomp_device_descr host_dispatch =
.get_device_num_func = openacc_get_device_num,
.set_device_num_func = openacc_set_device_num,
- /* Device available. */
- .avail_func = openacc_avail,
-
.exec_func = openacc_parallel,
.register_async_cleanup_func = openacc_register_async_cleanup,
@@ -97,7 +97,7 @@ resolve_device (acc_device_t d)
while (++d != _ACC_device_hwm)
if (dispatchers[d]
&& !strcasecmp (goacc_device_type, dispatchers[d]->name)
- && dispatchers[d]->openacc.avail_func ())
+ && dispatchers[d]->device_init_func () > 0)
goto found;
gomp_fatal ("device type %s not supported", goacc_device_type);
@@ -112,7 +112,7 @@ resolve_device (acc_device_t d)
case acc_device_not_host:
/* Find the first available device after acc_device_not_host. */
while (++d != _ACC_device_hwm)
- if (dispatchers[d] && dispatchers[d]->openacc.avail_func ())
+ if (dispatchers[d] && dispatchers[d]->device_init_func () > 0)
goto found;
if (d_arg == acc_device_default)
{
@@ -150,7 +150,7 @@ _acc_init (acc_device_t d)
acc_dev = resolve_device (d);
- if (!acc_dev || !acc_dev->openacc.avail_func ())
+ if (!acc_dev || acc_dev->device_init_func () <= 0)
gomp_fatal ("device %u not supported", (unsigned)d);
if (acc_dev->is_initialized)
@@ -730,17 +730,6 @@ PTX_get_num_devices (void)
return n;
}
-static bool
-PTX_avail(void)
-{
- bool avail = false;
-
- if (PTX_init () > 0)
- avail = true;
-
- return avail;
-}
-
static void
link_ptx (CUmodule *module, char *ptx_code)
{
@@ -1729,15 +1718,6 @@ openacc_get_device_num (void)
return -1;
}
-bool
-openacc_avail (void)
-{
-#ifdef DEBUG
- fprintf (stderr, "libgomp plugin: %s:%s\n", __FILE__, __FUNCTION__);
-#endif
- return PTX_avail ();
-}
-
void
openacc_register_async_cleanup (void *targ_mem_desc)
{
@@ -1045,7 +1045,6 @@ gomp_load_plugin_for_device (struct gomp_device_descr *device,
DLSYM_OPT (openacc.close_device, openacc_close_device);
DLSYM_OPT (openacc.get_device_num, openacc_get_device_num);
DLSYM_OPT (openacc.set_device_num, openacc_set_device_num);
- DLSYM_OPT (openacc.avail, openacc_avail);
DLSYM_OPT (openacc.register_async_cleanup,
openacc_register_async_cleanup);
DLSYM_OPT (openacc.async_test, openacc_async_test);
@@ -103,9 +103,6 @@ typedef struct ACC_dispatch_t
int (*get_device_num_func) (void);
void (*set_device_num_func) (int);
- /* Availability. */
- bool (*avail_func) (void);
-
/* Execute. */
void (*exec_func) (void (*) (void *), size_t, void **, void **, size_t *,
unsigned short *, int, int, int, int, void *);