diff options
Diffstat (limited to 'libgomp/oacc-parallel.c')
-rw-r--r-- | libgomp/oacc-parallel.c | 80 |
1 files changed, 9 insertions, 71 deletions
diff --git a/libgomp/oacc-parallel.c b/libgomp/oacc-parallel.c index cf1baf6..83625ba 100644 --- a/libgomp/oacc-parallel.c +++ b/libgomp/oacc-parallel.c @@ -290,8 +290,8 @@ GOACC_parallel_keyed (int flags_m, void (*fn) (void *), goacc_aq aq = get_goacc_asyncqueue (async); - tgt = gomp_map_vars_async (acc_dev, aq, mapnum, hostaddrs, NULL, sizes, kinds, - true, GOMP_MAP_VARS_OPENACC); + tgt = goacc_map_vars (acc_dev, aq, mapnum, hostaddrs, NULL, sizes, kinds, + true, 0); if (profiling_p) { prof_info.event_type = acc_ev_enter_data_end; @@ -300,7 +300,7 @@ GOACC_parallel_keyed (int flags_m, void (*fn) (void *), goacc_profiling_dispatch (&prof_info, &enter_exit_data_event_info, &api_info); } - + devaddrs = gomp_alloca (sizeof (void *) * mapnum); for (i = 0; i < mapnum; i++) devaddrs[i] = (void *) gomp_map_val (tgt, hostaddrs, i); @@ -321,11 +321,8 @@ GOACC_parallel_keyed (int flags_m, void (*fn) (void *), &api_info); } - /* If running synchronously, unmap immediately. */ - if (aq == NULL) - gomp_unmap_vars (tgt, true); - else - gomp_unmap_vars_async (tgt, true, aq); + /* If running synchronously (aq == NULL), this will unmap immediately. */ + goacc_unmap_vars (tgt, true, aq); if (profiling_p) { @@ -456,8 +453,7 @@ GOACC_data_start (int flags_m, size_t mapnum, { prof_info.device_type = acc_device_host; api_info.device_type = prof_info.device_type; - tgt = gomp_map_vars (NULL, 0, NULL, NULL, NULL, NULL, true, - GOMP_MAP_VARS_OPENACC); + tgt = goacc_map_vars (NULL, NULL, 0, NULL, NULL, NULL, NULL, true, 0); tgt->prev = thr->mapped_data; thr->mapped_data = tgt; @@ -465,8 +461,8 @@ GOACC_data_start (int flags_m, size_t mapnum, } gomp_debug (0, " %s: prepare mappings\n", __FUNCTION__); - tgt = gomp_map_vars (acc_dev, mapnum, hostaddrs, NULL, sizes, kinds, true, - GOMP_MAP_VARS_OPENACC); + tgt = goacc_map_vars (acc_dev, NULL, mapnum, hostaddrs, NULL, sizes, kinds, + true, 0); gomp_debug (0, " %s: mappings prepared\n", __FUNCTION__); tgt->prev = thr->mapped_data; thr->mapped_data = tgt; @@ -542,7 +538,7 @@ GOACC_data_end (void) gomp_debug (0, " %s: restore mappings\n", __FUNCTION__); thr->mapped_data = tgt->prev; - gomp_unmap_vars (tgt, true); + goacc_unmap_vars (tgt, true, NULL); gomp_debug (0, " %s: mappings restored\n", __FUNCTION__); if (profiling_p) @@ -728,61 +724,3 @@ GOACC_get_thread_num (void) { return 0; } - -void -GOACC_declare (int flags_m, size_t mapnum, - void **hostaddrs, size_t *sizes, unsigned short *kinds) -{ - int i; - - for (i = 0; i < mapnum; i++) - { - unsigned char kind = kinds[i] & 0xff; - - if (kind == GOMP_MAP_POINTER || kind == GOMP_MAP_TO_PSET) - continue; - - switch (kind) - { - case GOMP_MAP_FORCE_ALLOC: - case GOMP_MAP_FORCE_FROM: - case GOMP_MAP_FORCE_TO: - case GOMP_MAP_POINTER: - case GOMP_MAP_RELEASE: - case GOMP_MAP_DELETE: - GOACC_enter_exit_data (flags_m, 1, &hostaddrs[i], &sizes[i], - &kinds[i], GOMP_ASYNC_SYNC, 0); - break; - - case GOMP_MAP_FORCE_DEVICEPTR: - break; - - case GOMP_MAP_ALLOC: - if (!acc_is_present (hostaddrs[i], sizes[i])) - GOACC_enter_exit_data (flags_m, 1, &hostaddrs[i], &sizes[i], - &kinds[i], GOMP_ASYNC_SYNC, 0); - break; - - case GOMP_MAP_TO: - GOACC_enter_exit_data (flags_m, 1, &hostaddrs[i], &sizes[i], - &kinds[i], GOMP_ASYNC_SYNC, 0); - - break; - - case GOMP_MAP_FROM: - GOACC_enter_exit_data (flags_m, 1, &hostaddrs[i], &sizes[i], - &kinds[i], GOMP_ASYNC_SYNC, 0); - break; - - case GOMP_MAP_FORCE_PRESENT: - if (!acc_is_present (hostaddrs[i], sizes[i])) - gomp_fatal ("[%p,%ld] is not mapped", hostaddrs[i], - (unsigned long) sizes[i]); - break; - - default: - assert (0); - break; - } - } -} |