Commit d93bdab5 by Julian Brown Committed by Julian Brown

mkoffload.c (process): Support variable mapping.

	gcc/
	* config/nvptx/mkoffload.c (process): Support variable mapping.

	libgomp/
	* libgomp.h (target_mem_desc: Remove mem_map field.
	(acc_dispatch_t): Remove open_device_func, close_device_func,
	get_device_num_func, set_device_num_func, target_data members.
	Change create_thread_data_func argument to device number instead of
	generic pointer.
	* oacc-async.c (assert.h): Include.
	(acc_async_test, acc_async_test_all, acc_wait, acc_wait_async)
	(acc_wait_all, acc_wait_all_async): Use current host thread's
	active device, not base_dev.
	* oacc-cuda.c (acc_get_current_cuda_device)
	(acc_get_current_cuda_context, acc_get_cuda_stream)
	(acc_set_cuda_stream): Likewise.
	* oacc-host.c (host_dispatch): Don't set open_device_func,
	close_device_func, get_device_num_func or set_device_num_func.
	* oacc-init.c (base_dev, init_key): Remove.
	(cached_base_dev): New.
	(name_of_acc_device_t): New.
	(acc_init_1): Initialise default-numbered device, not zeroth.
	(acc_shutdown_1): Close all devices of a given type.
	(goacc_destroy_thread): Don't use base_dev.
	(lazy_open, lazy_init, lazy_init_and_open): Remove.
	(goacc_attach_host_thread_to_device): New.
	(acc_init): Reimplement with goacc_attach_host_thread_to_device.
	(acc_get_num_devices): Don't use base_dev.
	(acc_set_device_type): Reimplement.
	(acc_get_device_type): Don't use base_dev.
	(acc_get_device_num): Tweak logic.
	(acc_set_device_num): Likewise.
	(acc_on_device): Use acc_get_device_type.
	(goacc_runtime_initialize): Initialize cached_base_dev not base_dev.
	(goacc_lazy_initialize): Reimplement with acc_init and
	goacc_attach_host_thread_to_device.
	* oacc-int.h (goacc_thread): Add base_dev field.
	(base_dev): Remove extern declaration.
	(goacc_attach_host_thread_to_device): Add prototype.
	* oacc-mem.c (acc_malloc): Use current thread's device instead of
	base_dev.
	(acc_free): Likewise.
	(acc_memcpy_to_device): Likewise.
	(acc_memcpy_from_device): Likewise.
	* oacc-parallel.c (select_acc_device): Remove. Replace calls with
	goacc_lazy_initialize (throughout).
	(GOACC_parallel): Use tgt_offset to locate target functions.
	* target.c (gomp_map_vars): Don't set tgt->mem_map.
	(gomp_unmap_vars): Use devicep->mem_map pointer not tgt->mem_map.
	(gomp_load_plugin_for_device): Remove open_device, close_device,
	get_device_num, set_device_num openacc hook initialisation. Don't set
	openacc.target_data.
	* plugin/plugin-host.c (GOMP_OFFLOAD_openacc_open_device)
	(GOMP_OFFLOAD_openacc_close_device)
	(GOMP_OFFLOAD_openacc_get_device_num)
	(GOMP_OFFLOAD_openacc_set_device_num): Remove.
	(GOMP_OFFLOAD_openacc_create_thread_data): Change (unused) argument
	to int.
	* plugin/plugin-nvptx.c (ptx_inited): Remove.
	(instantiated_devices, ptx_dev_lock): New.
	(struct ptx_image_data): New.
	(ptx_devices, ptx_images, ptx_image_lock): New.
	(fini_streams_for_device): Reorder cuStreamDestroy call.
	(nvptx_get_num_devices): Remove forward declaration.
	(nvptx_init): Change return type to bool.
	(nvptx_fini): Remove.
	(nvptx_attach_host_thread_to_device): New.
	(nvptx_open_device): Return struct ptx_device* instead of void*.
	(nvptx_close_device): Change argument type to struct ptx_device*,
	return type to void.
	(nvptx_get_num_devices): Use instantiated_devices not ptx_inited.
	(kernel_target_data, kernel_host_table): Remove static globals.
	(GOMP_OFFLOAD_register_image, GOMP_OFFLOAD_get_table): Remove.
	(GOMP_OFFLOAD_init_device): Reimplement.
	(GOMP_OFFLOAD_fini_device): Likewise.
	(GOMP_OFFLOAD_load_image, GOMP_OFFLOAD_unload_image): New.
	(GOMP_OFFLOAD_alloc, GOMP_OFFLOAD_free, GOMP_OFFLOAD_dev2host)
	(GOMP_OFFLOAD_host2dev): Use ORD argument.
	(GOMP_OFFLOAD_openacc_open_device)
	(GOMP_OFFLOAD_openacc_close_device)
	(GOMP_OFFLOAD_openacc_set_device_num)
	(GOMP_OFFLOAD_openacc_get_device_num): Remove.
	(GOMP_OFFLOAD_openacc_create_thread_data): Change argument to int
	(device number).

	libgomp/testsuite/
	* libgomp.oacc-c-c++-common/lib-9.c: Fix devnum check in test.

From-SVN: r221922
parent a6330e85
2015-04-08 Julian Brown <julian@codesourcery.com>
* config/nvptx/mkoffload.c (process): Support variable mapping.
2015-03-27 Trevor Saunders <tbsaunde@tbsaunde.org>
* config/alpha/alpha.c (alpha_use_linkage): Change type of slot to
......
......@@ -839,6 +839,7 @@ process (FILE *in, FILE *out)
{
const char *input = read_file (in);
Token *tok = tokenize (input);
unsigned int nvars = 0, nfuncs = 0;
do
tok = parse_file (tok);
......@@ -850,16 +851,17 @@ process (FILE *in, FILE *out)
write_stmts (out, rev_stmts (fns));
fprintf (out, ";\n\n");
fprintf (out, "static const char *var_mappings[] = {\n");
for (id_map *id = var_ids; id; id = id->next)
for (id_map *id = var_ids; id; id = id->next, nvars++)
fprintf (out, "\t\"%s\"%s\n", id->ptx_name, id->next ? "," : "");
fprintf (out, "};\n\n");
fprintf (out, "static const char *func_mappings[] = {\n");
for (id_map *id = func_ids; id; id = id->next)
for (id_map *id = func_ids; id; id = id->next, nfuncs++)
fprintf (out, "\t\"%s\"%s\n", id->ptx_name, id->next ? "," : "");
fprintf (out, "};\n\n");
fprintf (out, "static const void *target_data[] = {\n");
fprintf (out, " ptx_code, var_mappings, func_mappings\n");
fprintf (out, " ptx_code, (void*) %u, var_mappings, (void*) %u, "
"func_mappings\n", nvars, nfuncs);
fprintf (out, "};\n\n");
fprintf (out, "extern void GOMP_offload_register (const void *, int, void *);\n");
......
2015-04-08 Julian Brown <julian@codesourcery.com>
* libgomp.h (target_mem_desc: Remove mem_map field.
(acc_dispatch_t): Remove open_device_func, close_device_func,
get_device_num_func, set_device_num_func, target_data members.
Change create_thread_data_func argument to device number instead of
generic pointer.
* oacc-async.c (assert.h): Include.
(acc_async_test, acc_async_test_all, acc_wait, acc_wait_async)
(acc_wait_all, acc_wait_all_async): Use current host thread's
active device, not base_dev.
* oacc-cuda.c (acc_get_current_cuda_device)
(acc_get_current_cuda_context, acc_get_cuda_stream)
(acc_set_cuda_stream): Likewise.
* oacc-host.c (host_dispatch): Don't set open_device_func,
close_device_func, get_device_num_func or set_device_num_func.
* oacc-init.c (base_dev, init_key): Remove.
(cached_base_dev): New.
(name_of_acc_device_t): New.
(acc_init_1): Initialise default-numbered device, not zeroth.
(acc_shutdown_1): Close all devices of a given type.
(goacc_destroy_thread): Don't use base_dev.
(lazy_open, lazy_init, lazy_init_and_open): Remove.
(goacc_attach_host_thread_to_device): New.
(acc_init): Reimplement with goacc_attach_host_thread_to_device.
(acc_get_num_devices): Don't use base_dev.
(acc_set_device_type): Reimplement.
(acc_get_device_type): Don't use base_dev.
(acc_get_device_num): Tweak logic.
(acc_set_device_num): Likewise.
(acc_on_device): Use acc_get_device_type.
(goacc_runtime_initialize): Initialize cached_base_dev not base_dev.
(goacc_lazy_initialize): Reimplement with acc_init and
goacc_attach_host_thread_to_device.
* oacc-int.h (goacc_thread): Add base_dev field.
(base_dev): Remove extern declaration.
(goacc_attach_host_thread_to_device): Add prototype.
* oacc-mem.c (acc_malloc): Use current thread's device instead of
base_dev.
(acc_free): Likewise.
(acc_memcpy_to_device): Likewise.
(acc_memcpy_from_device): Likewise.
* oacc-parallel.c (select_acc_device): Remove. Replace calls with
goacc_lazy_initialize (throughout).
(GOACC_parallel): Use tgt_offset to locate target functions.
* target.c (gomp_map_vars): Don't set tgt->mem_map.
(gomp_unmap_vars): Use devicep->mem_map pointer not tgt->mem_map.
(gomp_load_plugin_for_device): Remove open_device, close_device,
get_device_num, set_device_num openacc hook initialisation. Don't set
openacc.target_data.
* plugin/plugin-host.c (GOMP_OFFLOAD_openacc_open_device)
(GOMP_OFFLOAD_openacc_close_device)
(GOMP_OFFLOAD_openacc_get_device_num)
(GOMP_OFFLOAD_openacc_set_device_num): Remove.
(GOMP_OFFLOAD_openacc_create_thread_data): Change (unused) argument
to int.
* plugin/plugin-nvptx.c (ptx_inited): Remove.
(instantiated_devices, ptx_dev_lock): New.
(struct ptx_image_data): New.
(ptx_devices, ptx_images, ptx_image_lock): New.
(fini_streams_for_device): Reorder cuStreamDestroy call.
(nvptx_get_num_devices): Remove forward declaration.
(nvptx_init): Change return type to bool.
(nvptx_fini): Remove.
(nvptx_attach_host_thread_to_device): New.
(nvptx_open_device): Return struct ptx_device* instead of void*.
(nvptx_close_device): Change argument type to struct ptx_device*,
return type to void.
(nvptx_get_num_devices): Use instantiated_devices not ptx_inited.
(kernel_target_data, kernel_host_table): Remove static globals.
(GOMP_OFFLOAD_register_image, GOMP_OFFLOAD_get_table): Remove.
(GOMP_OFFLOAD_init_device): Reimplement.
(GOMP_OFFLOAD_fini_device): Likewise.
(GOMP_OFFLOAD_load_image, GOMP_OFFLOAD_unload_image): New.
(GOMP_OFFLOAD_alloc, GOMP_OFFLOAD_free, GOMP_OFFLOAD_dev2host)
(GOMP_OFFLOAD_host2dev): Use ORD argument.
(GOMP_OFFLOAD_openacc_open_device)
(GOMP_OFFLOAD_openacc_close_device)
(GOMP_OFFLOAD_openacc_set_device_num)
(GOMP_OFFLOAD_openacc_get_device_num): Remove.
(GOMP_OFFLOAD_openacc_create_thread_data): Change argument to int
(device number).
testsuite/
* libgomp.oacc-c-c++-common/lib-9.c: Fix devnum check in test.
2015-04-06 Ilya Verbin <ilya.verbin@intel.com>
* libgomp-plugin.h (struct mapping_table): Replace with addr_pair.
......
......@@ -655,9 +655,6 @@ struct target_mem_desc {
/* Corresponding target device descriptor. */
struct gomp_device_descr *device_descr;
/* Memory mapping info for the thread that created this descriptor. */
struct splay_tree_s *mem_map;
/* List of splay keys to remove (or decrease refcount)
at the end of region. */
splay_tree_key list[];
......@@ -691,18 +688,6 @@ typedef struct acc_dispatch_t
/* This is guarded by the lock in the "outer" struct gomp_device_descr. */
struct target_mem_desc *data_environ;
/* Extra information required for a device instance by a given target. */
/* This is guarded by the lock in the "outer" struct gomp_device_descr. */
void *target_data;
/* Open or close a device instance. */
void *(*open_device_func) (int n);
int (*close_device_func) (void *h);
/* Set or get the device number. */
int (*get_device_num_func) (void);
void (*set_device_num_func) (int);
/* Execute. */
void (*exec_func) (void (*) (void *), size_t, void **, void **, size_t *,
unsigned short *, int, int, int, int, void *);
......@@ -720,7 +705,7 @@ typedef struct acc_dispatch_t
void (*async_set_async_func) (int);
/* Create/destroy TLS data. */
void *(*create_thread_data_func) (void *);
void *(*create_thread_data_func) (int);
void (*destroy_thread_data_func) (void *);
/* NVIDIA target specific routines. */
......
......@@ -26,7 +26,7 @@
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#include <assert.h>
#include "openacc.h"
#include "libgomp.h"
#include "oacc-int.h"
......@@ -37,13 +37,23 @@ acc_async_test (int async)
if (async < acc_async_sync)
gomp_fatal ("invalid async argument: %d", async);
return base_dev->openacc.async_test_func (async);
struct goacc_thread *thr = goacc_thread ();
if (!thr || !thr->dev)
gomp_fatal ("no device active");
return thr->dev->openacc.async_test_func (async);
}
int
acc_async_test_all (void)
{
return base_dev->openacc.async_test_all_func ();
struct goacc_thread *thr = goacc_thread ();
if (!thr || !thr->dev)
gomp_fatal ("no device active");
return thr->dev->openacc.async_test_all_func ();
}
void
......@@ -52,19 +62,34 @@ acc_wait (int async)
if (async < acc_async_sync)
gomp_fatal ("invalid async argument: %d", async);
base_dev->openacc.async_wait_func (async);
struct goacc_thread *thr = goacc_thread ();
if (!thr || !thr->dev)
gomp_fatal ("no device active");
thr->dev->openacc.async_wait_func (async);
}
void
acc_wait_async (int async1, int async2)
{
base_dev->openacc.async_wait_async_func (async1, async2);
struct goacc_thread *thr = goacc_thread ();
if (!thr || !thr->dev)
gomp_fatal ("no device active");
thr->dev->openacc.async_wait_async_func (async1, async2);
}
void
acc_wait_all (void)
{
base_dev->openacc.async_wait_all_func ();
struct goacc_thread *thr = goacc_thread ();
if (!thr || !thr->dev)
gomp_fatal ("no device active");
thr->dev->openacc.async_wait_all_func ();
}
void
......@@ -73,5 +98,10 @@ acc_wait_all_async (int async)
if (async < acc_async_sync)
gomp_fatal ("invalid async argument: %d", async);
base_dev->openacc.async_wait_all_async_func (async);
struct goacc_thread *thr = goacc_thread ();
if (!thr || !thr->dev)
gomp_fatal ("no device active");
thr->dev->openacc.async_wait_all_async_func (async);
}
......@@ -34,51 +34,53 @@
void *
acc_get_current_cuda_device (void)
{
void *p = NULL;
struct goacc_thread *thr = goacc_thread ();
if (base_dev && base_dev->openacc.cuda.get_current_device_func)
p = base_dev->openacc.cuda.get_current_device_func ();
if (thr && thr->dev && thr->dev->openacc.cuda.get_current_device_func)
return thr->dev->openacc.cuda.get_current_device_func ();
return p;
return NULL;
}
void *
acc_get_current_cuda_context (void)
{
void *p = NULL;
struct goacc_thread *thr = goacc_thread ();
if (base_dev && base_dev->openacc.cuda.get_current_context_func)
p = base_dev->openacc.cuda.get_current_context_func ();
return p;
if (thr && thr->dev && thr->dev->openacc.cuda.get_current_context_func)
return thr->dev->openacc.cuda.get_current_context_func ();
return NULL;
}
void *
acc_get_cuda_stream (int async)
{
void *p = NULL;
struct goacc_thread *thr = goacc_thread ();
if (async < 0)
return p;
if (base_dev && base_dev->openacc.cuda.get_stream_func)
p = base_dev->openacc.cuda.get_stream_func (async);
return NULL;
return p;
if (thr && thr->dev && thr->dev->openacc.cuda.get_stream_func)
return thr->dev->openacc.cuda.get_stream_func (async);
return NULL;
}
int
acc_set_cuda_stream (int async, void *stream)
{
int s = -1;
struct goacc_thread *thr;
if (async < 0 || stream == NULL)
return 0;
goacc_lazy_initialize ();
if (base_dev && base_dev->openacc.cuda.set_stream_func)
s = base_dev->openacc.cuda.set_stream_func (async, stream);
thr = goacc_thread ();
if (thr && thr->dev && thr->dev->openacc.cuda.set_stream_func)
return thr->dev->openacc.cuda.set_stream_func (async, stream);
return s;
return -1;
}
......@@ -53,16 +53,9 @@ static struct gomp_device_descr host_dispatch =
.host2dev_func = GOMP_OFFLOAD_host2dev,
.run_func = GOMP_OFFLOAD_run,
.mem_map.root = NULL,
.is_initialized = false,
.openacc = {
.open_device_func = GOMP_OFFLOAD_openacc_open_device,
.close_device_func = GOMP_OFFLOAD_openacc_close_device,
.get_device_num_func = GOMP_OFFLOAD_openacc_get_device_num,
.set_device_num_func = GOMP_OFFLOAD_openacc_set_device_num,
.exec_func = GOMP_OFFLOAD_openacc_parallel,
.register_async_cleanup_func
......
......@@ -56,6 +56,9 @@ acc_device_type (enum offload_target_type type)
struct goacc_thread
{
/* The base device for the current thread. */
struct gomp_device_descr *base_dev;
/* The device for the current thread. */
struct gomp_device_descr *dev;
......@@ -89,10 +92,7 @@ goacc_thread (void)
#endif
void goacc_register (struct gomp_device_descr *) __GOACC_NOTHROW;
/* Current dispatcher. */
extern struct gomp_device_descr *base_dev;
void goacc_attach_host_thread_to_device (int);
void goacc_runtime_initialize (void);
void goacc_save_and_set_bind (acc_device_t);
void goacc_restore_bind (void);
......
......@@ -107,7 +107,9 @@ acc_malloc (size_t s)
struct goacc_thread *thr = goacc_thread ();
return base_dev->alloc_func (thr->dev->target_id, s);
assert (thr->dev);
return thr->dev->alloc_func (thr->dev->target_id, s);
}
/* OpenACC 2.0a (3.2.16) doesn't specify what to do in the event
......@@ -122,6 +124,8 @@ acc_free (void *d)
if (!d)
return;
assert (thr && thr->dev);
/* We don't have to call lazy open here, as the ptr value must have
been returned by acc_malloc. It's not permitted to pass NULL in
(unless you got that null from acc_malloc). */
......@@ -134,7 +138,7 @@ acc_free (void *d)
acc_unmap_data ((void *)(k->host_start + offset));
}
base_dev->free_func (thr->dev->target_id, d);
thr->dev->free_func (thr->dev->target_id, d);
}
void
......@@ -144,7 +148,9 @@ acc_memcpy_to_device (void *d, void *h, size_t s)
been obtained from a routine that did that. */
struct goacc_thread *thr = goacc_thread ();
base_dev->host2dev_func (thr->dev->target_id, d, h, s);
assert (thr && thr->dev);
thr->dev->host2dev_func (thr->dev->target_id, d, h, s);
}
void
......@@ -154,7 +160,9 @@ acc_memcpy_from_device (void *h, void *d, size_t s)
been obtained from a routine that did that. */
struct goacc_thread *thr = goacc_thread ();
base_dev->dev2host_func (thr->dev->target_id, h, d, s);
assert (thr && thr->dev);
thr->dev->dev2host_func (thr->dev->target_id, h, d, s);
}
/* Return the device pointer that corresponds to host data H. Or NULL
......
......@@ -49,32 +49,6 @@ find_pset (int pos, size_t mapnum, unsigned short *kinds)
return kind == GOMP_MAP_TO_PSET;
}
/* Ensure that the target device for DEVICE_TYPE is initialised (and that
plugins have been loaded if appropriate). The ACC_dev variable for the
current thread will be set appropriately for the given device type on
return. */
attribute_hidden void
select_acc_device (int device_type)
{
goacc_lazy_initialize ();
if (device_type == GOMP_DEVICE_HOST_FALLBACK)
return;
if (device_type == acc_device_none)
device_type = acc_device_host;
if (device_type >= 0)
{
/* NOTE: this will go badly if the surrounding data environment is set up
to use a different device type. We'll just have to trust that users
know what they're doing... */
acc_set_device_type (device_type);
}
}
static void goacc_wait (int async, int num_waits, va_list ap);
void
......@@ -111,7 +85,7 @@ GOACC_parallel (int device, void (*fn) (void *),
__FUNCTION__, (unsigned long) mapnum, hostaddrs, sizes, kinds,
async);
#endif
select_acc_device (device);
goacc_lazy_initialize ();
thr = goacc_thread ();
acc_dev = thr->dev;
......@@ -151,7 +125,7 @@ GOACC_parallel (int device, void (*fn) (void *),
if (tgt_fn_key == NULL)
gomp_fatal ("target function wasn't mapped");
tgt_fn = (void (*)) tgt_fn_key->tgt->tgt_start;
tgt_fn = (void (*)) tgt_fn_key->tgt_offset;
}
else
tgt_fn = (void (*)) fn;
......@@ -195,7 +169,7 @@ GOACC_data_start (int device, size_t mapnum,
__FUNCTION__, (unsigned long) mapnum, hostaddrs, sizes, kinds);
#endif
select_acc_device (device);
goacc_lazy_initialize ();
struct goacc_thread *thr = goacc_thread ();
struct gomp_device_descr *acc_dev = thr->dev;
......@@ -242,7 +216,7 @@ GOACC_enter_exit_data (int device, size_t mapnum,
bool data_enter = false;
size_t i;
select_acc_device (device);
goacc_lazy_initialize ();
thr = goacc_thread ();
acc_dev = thr->dev;
......@@ -429,7 +403,7 @@ GOACC_update (int device, size_t mapnum,
bool host_fallback = device == GOMP_DEVICE_HOST_FALLBACK;
size_t i;
select_acc_device (device);
goacc_lazy_initialize ();
struct goacc_thread *thr = goacc_thread ();
struct gomp_device_descr *acc_dev = thr->dev;
......
......@@ -119,31 +119,6 @@ GOMP_OFFLOAD_unload_image (int n __attribute__ ((unused)),
}
STATIC void *
GOMP_OFFLOAD_openacc_open_device (int n)
{
return (void *) (intptr_t) n;
}
STATIC int
GOMP_OFFLOAD_openacc_close_device (void *hnd)
{
return 0;
}
STATIC int
GOMP_OFFLOAD_openacc_get_device_num (void)
{
return 0;
}
STATIC void
GOMP_OFFLOAD_openacc_set_device_num (int n)
{
if (n > 0)
GOMP (fatal) ("device number %u out of range for host execution", n);
}
STATIC void *
GOMP_OFFLOAD_alloc (int n __attribute__ ((unused)), size_t s)
{
return GOMP (malloc) (s);
......@@ -254,7 +229,7 @@ GOMP_OFFLOAD_openacc_async_wait_all_async (int async __attribute__ ((unused)))
}
STATIC void *
GOMP_OFFLOAD_openacc_create_thread_data (void *targ_data
GOMP_OFFLOAD_openacc_create_thread_data (int ord
__attribute__ ((unused)))
{
return NULL;
......
......@@ -178,7 +178,6 @@ gomp_map_vars (struct gomp_device_descr *devicep, size_t mapnum,
tgt->list_count = mapnum;
tgt->refcount = 1;
tgt->device_descr = devicep;
tgt->mem_map = mem_map;
if (mapnum == 0)
return tgt;
......@@ -597,7 +596,7 @@ gomp_unmap_vars (struct target_mem_desc *tgt, bool do_copyfrom)
devicep->dev2host_func (devicep->target_id, (void *) k->host_start,
(void *) (k->tgt->tgt_start + k->tgt_offset),
k->host_end - k->host_start);
splay_tree_remove (tgt->mem_map, k);
splay_tree_remove (&devicep->mem_map, k);
if (k->tgt->refcount > 1)
k->tgt->refcount--;
else
......@@ -1159,10 +1158,6 @@ gomp_load_plugin_for_device (struct gomp_device_descr *device,
{
optional_present = optional_total = 0;
DLSYM_OPT (openacc.exec, openacc_parallel);
DLSYM_OPT (openacc.open_device, openacc_open_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.register_async_cleanup,
openacc_register_async_cleanup);
DLSYM_OPT (openacc.async_test, openacc_async_test);
......@@ -1271,7 +1266,6 @@ gomp_target_init (void)
current_device.mem_map.root = NULL;
current_device.is_initialized = false;
current_device.openacc.data_environ = NULL;
current_device.openacc.target_data = NULL;
for (i = 0; i < new_num_devices; i++)
{
current_device.target_id = i;
......
......@@ -58,7 +58,7 @@ main (int argc, char **argv)
acc_set_device_num (1, (acc_device_t) 0);
devnum = acc_get_device_num (devtype);
if (devnum != 0)
if (devnum != 1)
abort ();
}
......
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