Hi! On 2019-09-06T09:02:13-0700, Julian Brown wrote: > This patch adds profiling support to the AMD GCN libgomp plugin, modeled > after the equivalent support in the NVPTX plugin. This gives a positive > test delta in AMD GCN offload testing. Yay! \o/ > I will apply to the openacc-gcc-9-branch shortly. ..., and later these changes got into master branch, via integration into "[PATCH 7/7 libgomp,amdgcn] GCN Libgomp Plugin". > --- a/libgomp/plugin/plugin-gcn.c > +++ b/libgomp/plugin/plugin-gcn.c | static void | gomp_offload_free (void *ptr) | { | GCN_DEBUG ("Async thread ?:?: Freeing %p\n", ptr); | GOMP_OFFLOAD_free (0, ptr); | } > @@ -3046,6 +3075,35 @@ GOMP_OFFLOAD_free (int device, void *ptr) > return false; > } > > + struct goacc_thread *thr = GOMP_PLUGIN_goacc_thread (); > + bool profiling_dispatch_p > + = __builtin_expect (thr != NULL && thr->prof_info != NULL, false); > + if (profiling_dispatch_p) > + { > + [...] > + prof_info->event_type = acc_ev_free; > + > + [...] > + GOMP_PLUGIN_goacc_profiling_dispatch (prof_info, &data_event_info, > + api_info); > + } > + > return true; > } > > @@ -3276,6 +3334,35 @@ gcn_exec (struct kernel_info *kernel, size_t mapnum, void **hostaddrs, > {1, 64, 16} > }; > > + struct goacc_thread *thr = GOMP_PLUGIN_goacc_thread (); > + acc_prof_info *prof_info = thr->prof_info; > + acc_event_info enqueue_launch_event_info; > + acc_api_info *api_info = thr->api_info; > + bool profiling_dispatch_p = __builtin_expect (prof_info != NULL, false); > + if (profiling_dispatch_p) > + { > + prof_info->event_type = acc_ev_enqueue_launch_start; > + > + [...] > + GOMP_PLUGIN_goacc_profiling_dispatch (prof_info, > + &enqueue_launch_event_info, api_info); > + } > + > if (!async) > { > run_kernel (kernel, ind_da, &kla, NULL, false); | gomp_offload_free (ind_da); | } | 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); > } > + > + if (profiling_dispatch_p) > + { > + prof_info->event_type = acc_ev_enqueue_launch_end; > + enqueue_launch_event_info.launch_event.event_type = prof_info->event_type; > + GOMP_PLUGIN_goacc_profiling_dispatch (prof_info, > + &enqueue_launch_event_info, > + api_info); > + } > } Per that, 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 Pushed to master branch commit 649f1939baf11f45fd3579b8b9601c7840a097b3 "Fix OpenACC/GCN 'acc_ev_enqueue_launch_end' position", see attached. Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955