aboutsummaryrefslogtreecommitdiff
path: root/libgomp/plugin
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2023-03-02 10:39:09 +0100
committerThomas Schwinge <thomas@codesourcery.com>2023-03-10 15:05:01 +0100
commit649f1939baf11f45fd3579b8b9601c7840a097b3 (patch)
treefa814cd0abcece33915b5492c48648ecaf7e5849 /libgomp/plugin
parente1c8cf9006bd278e969ab7ed35178067ce128f32 (diff)
downloadgcc-649f1939baf11f45fd3579b8b9601c7840a097b3.zip
gcc-649f1939baf11f45fd3579b8b9601c7840a097b3.tar.gz
gcc-649f1939baf11f45fd3579b8b9601c7840a097b3.tar.bz2
Fix OpenACC/GCN 'acc_ev_enqueue_launch_end' position
For an OpenACC compute construct, we've currently got: - [...] - acc_ev_enqueue_launch_start - launch kernel - free memory - acc_ev_free - acc_ev_enqueue_launch_end This confused another thing that I'm working on, so I adjusted that to: - [...] - acc_ev_enqueue_launch_start - launch kernel - acc_ev_enqueue_launch_end - free memory - acc_ev_free Correspondingly, verify 'acc_ev_alloc', 'acc_ev_free' in 'libgomp.oacc-c-c++-common/acc_prof-parallel-1.c'. libgomp/ * plugin/plugin-gcn.c (gcn_exec): Fix 'acc_ev_enqueue_launch_end' position. * testsuite/libgomp.oacc-c-c++-common/acc_prof-parallel-1.c: Verify 'acc_ev_alloc', 'acc_ev_free'.
Diffstat (limited to 'libgomp/plugin')
-rw-r--r--libgomp/plugin/plugin-gcn.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c
index 11ce6b0..96920a4 100644
--- a/libgomp/plugin/plugin-gcn.c
+++ b/libgomp/plugin/plugin-gcn.c
@@ -3192,18 +3192,9 @@ gcn_exec (struct kernel_info *kernel, size_t mapnum, void **hostaddrs,
}
if (!async)
- {
- run_kernel (kernel, ind_da, &kla, NULL, false);
- gomp_offload_free (ind_da);
- }
+ run_kernel (kernel, ind_da, &kla, NULL, false);
else
- {
- queue_push_launch (aq, kernel, ind_da, &kla);
- if (DEBUG_QUEUES)
- GCN_DEBUG ("queue_push_callback %d:%d gomp_offload_free, %p\n",
- aq->agent->device_id, aq->id, ind_da);
- queue_push_callback (aq, gomp_offload_free, ind_da);
- }
+ queue_push_launch (aq, kernel, ind_da, &kla);
if (profiling_dispatch_p)
{
@@ -3213,6 +3204,16 @@ gcn_exec (struct kernel_info *kernel, size_t mapnum, void **hostaddrs,
&enqueue_launch_event_info,
api_info);
}
+
+ if (!async)
+ gomp_offload_free (ind_da);
+ else
+ {
+ if (DEBUG_QUEUES)
+ GCN_DEBUG ("queue_push_callback %d:%d gomp_offload_free, %p\n",
+ aq->agent->device_id, aq->id, ind_da);
+ queue_push_callback (aq, gomp_offload_free, ind_da);
+ }
}
/* }}} */