diff options
author | Dhruva Chakrabarti <Dhruva.Chakrabarti@amd.com> | 2022-09-30 04:41:29 +0000 |
---|---|---|
committer | Dhruva Chakrabarti <Dhruva.Chakrabarti@amd.com> | 2022-10-01 00:46:40 +0000 |
commit | 667af48179cdb581832fd9b06a8ab3ca2b4efd69 (patch) | |
tree | 8cd4807fcaac59ca2a3636e21201bef20f1f6358 /openmp/runtime | |
parent | 56c7cf41d45104f97afedad3a61afd0d4d901591 (diff) | |
download | llvm-667af48179cdb581832fd9b06a8ab3ca2b4efd69.zip llvm-667af48179cdb581832fd9b06a8ab3ca2b4efd69.tar.gz llvm-667af48179cdb581832fd9b06a8ab3ca2b4efd69.tar.bz2 |
[OpenMP] [OMPT] [1/8] Create separate categories for host, device, [no]emi events
In preparation for OMPT target changes, create separate categories of events that will be used by OMPT target support.
Split up existing macro FOREACH_OMPT_EVENT into new ones. There is no change to the original macro. Created new macros FOREACH_OMPT_HOST_EVENT, FOREACH_OMPT_DEVICE_EVENT, FOREACH_OMPT_NOEMI_EVENT, FOREACH_OMPT_EMI_EVENT, and a few other sub-categories that can be used as required. One such use is in D123974 which uses events selectively.
Patch from John Mellor-Crummey <johnmc@rice.edu>
Reviewed By: dreachem
Differential Revision: https://reviews.llvm.org/D123429
Diffstat (limited to 'openmp/runtime')
-rw-r--r-- | openmp/runtime/src/include/omp-tools.h.var | 57 |
1 files changed, 42 insertions, 15 deletions
diff --git a/openmp/runtime/src/include/omp-tools.h.var b/openmp/runtime/src/include/omp-tools.h.var index 6bae305..53defaa 100644 --- a/openmp/runtime/src/include/omp-tools.h.var +++ b/openmp/runtime/src/include/omp-tools.h.var @@ -108,7 +108,7 @@ macro (kmp_mutex_impl_queuing, 2) /* based on some fair policy */ \ macro (kmp_mutex_impl_speculative, 3) /* based on HW-supported speculation */ -#define FOREACH_OMPT_EVENT(macro) \ +#define FOREACH_OMPT_HOST_EVENT(macro) \ \ /*--- Mandatory Events ---*/ \ macro (ompt_callback_thread_begin, ompt_callback_thread_begin_t, 1) /* thread begin */ \ @@ -121,18 +121,8 @@ macro (ompt_callback_task_schedule, ompt_callback_task_schedule_t, 6) /* task schedule */ \ macro (ompt_callback_implicit_task, ompt_callback_implicit_task_t, 7) /* implicit task */ \ \ - macro (ompt_callback_target, ompt_callback_target_t, 8) /* target */ \ - macro (ompt_callback_target_data_op, ompt_callback_target_data_op_t, 9) /* target data op */ \ - macro (ompt_callback_target_submit, ompt_callback_target_submit_t, 10) /* target submit */ \ - \ macro (ompt_callback_control_tool, ompt_callback_control_tool_t, 11) /* control tool */ \ \ - macro (ompt_callback_device_initialize, ompt_callback_device_initialize_t, 12) /* device initialize */ \ - macro (ompt_callback_device_finalize, ompt_callback_device_finalize_t, 13) /* device finalize */ \ - \ - macro (ompt_callback_device_load, ompt_callback_device_load_t, 14) /* device load */ \ - macro (ompt_callback_device_unload, ompt_callback_device_unload_t, 15) /* device unload */ \ - \ /* Optional Events */ \ macro (ompt_callback_sync_region_wait, ompt_callback_sync_region_t, 16) /* sync region wait begin or end */ \ \ @@ -145,8 +135,6 @@ \ macro (ompt_callback_masked, ompt_callback_masked_t, 21) /* task at masked begin or end */ \ \ - macro (ompt_callback_target_map, ompt_callback_target_map_t, 22) /* target map */ \ - \ macro (ompt_callback_sync_region, ompt_callback_sync_region_t, 23) /* sync region begin or end */ \ \ macro (ompt_callback_lock_init, ompt_callback_mutex_acquire_t, 24) /* lock init */ \ @@ -164,11 +152,50 @@ macro (ompt_callback_reduction, ompt_callback_sync_region_t, 31) /* reduction */ \ \ macro (ompt_callback_dispatch, ompt_callback_dispatch_t, 32) /* dispatch of work */ \ + macro (ompt_callback_error, ompt_callback_error_t, 37) /* error */ + +#define FOREACH_OMPT_DEVICE_EVENT(macro) \ + /*--- Mandatory Events ---*/ \ + macro (ompt_callback_device_initialize, ompt_callback_device_initialize_t, 12) /* device initialize */ \ + macro (ompt_callback_device_finalize, ompt_callback_device_finalize_t, 13) /* device finalize */ \ + \ + macro (ompt_callback_device_load, ompt_callback_device_load_t, 14) /* device load */ \ + macro (ompt_callback_device_unload, ompt_callback_device_unload_t, 15) /* device unload */ + +#define FOREACH_OMPT_NOEMI_EVENT(macro) \ + /*--- Mandatory Events ---*/ \ + macro (ompt_callback_target, ompt_callback_target_t, 8) /* target */ \ + macro (ompt_callback_target_data_op, ompt_callback_target_data_op_t, 9) /* target data op */ \ + macro (ompt_callback_target_submit, ompt_callback_target_submit_t, 10) /* target submit */ \ + /* Optional Events */ \ + macro (ompt_callback_target_map, ompt_callback_target_map_t, 22) /* target map */ + +#define FOREACH_OMPT_EMI_EVENT(macro) \ + /*--- Mandatory Events ---*/ \ macro (ompt_callback_target_emi, ompt_callback_target_emi_t, 33) /* target */ \ macro (ompt_callback_target_data_op_emi,ompt_callback_target_data_op_emi_t,34) /* target data op */ \ macro (ompt_callback_target_submit_emi, ompt_callback_target_submit_emi_t, 35) /* target submit */ \ - macro (ompt_callback_target_map_emi, ompt_callback_target_map_emi_t, 36) /* target map */ \ - macro (ompt_callback_error, ompt_callback_error_t, 37) /* error */ + /* Optional Events */ \ + macro (ompt_callback_target_map_emi, ompt_callback_target_map_emi_t, 36) /* target map */ + +#define FOREACH_OMPT_50_TARGET_EVENT(macro) \ + FOREACH_OMPT_DEVICE_EVENT(macro) \ + FOREACH_OMPT_NOEMI_EVENT(macro) + +#define FOREACH_OMPT_51_TARGET_EVENT(macro) \ + FOREACH_OMPT_DEVICE_EVENT(macro) \ + FOREACH_OMPT_EMI_EVENT(macro) + +#define FOREACH_OMPT_EVENT(macro) \ + FOREACH_OMPT_HOST_EVENT(macro) \ + FOREACH_OMPT_DEVICE_EVENT(macro) \ + FOREACH_OMPT_NOEMI_EVENT(macro) \ + FOREACH_OMPT_EMI_EVENT(macro) + +#define FOREACH_OMPT_51_EVENT(macro) \ + FOREACH_OMPT_HOST_EVENT(macro) \ + FOREACH_OMPT_DEVICE_EVENT(macro) \ + FOREACH_OMPT_EMI_EVENT(macro) /***************************************************************************** * implementation specific types |