[OpenMP][Tests][NFC] rename macro to avoid naming clash

When including <ostream>, the register_callback macro of the OMPT callback.h
clashes with a function defined in ostream. This patch renames the macro
and includes ompt into the macro name.
This commit is contained in:
Joachim Protze 2021-02-24 17:54:50 +01:00
parent 6628387c9a
commit 35ab6d6390
5 changed files with 36 additions and 36 deletions

View File

@ -234,14 +234,14 @@ ompt_label_##id:
((uint64_t)addr) / FUZZY_ADDRESS_DISCARD_BYTES + 1, \ ((uint64_t)addr) / FUZZY_ADDRESS_DISCARD_BYTES + 1, \
((uint64_t)addr) / FUZZY_ADDRESS_DISCARD_BYTES + 2, addr) ((uint64_t)addr) / FUZZY_ADDRESS_DISCARD_BYTES + 2, addr)
#define register_callback_t(name, type) \ #define register_ompt_callback_t(name, type) \
do { \ do { \
type f_##name = &on_##name; \ type f_##name = &on_##name; \
if (ompt_set_callback(name, (ompt_callback_t)f_##name) == ompt_set_never) \ if (ompt_set_callback(name, (ompt_callback_t)f_##name) == ompt_set_never) \
printf("0: Could not register callback '" #name "'\n"); \ printf("0: Could not register callback '" #name "'\n"); \
} while (0) } while (0)
#define register_callback(name) register_callback_t(name, name##_t) #define register_ompt_callback(name) register_ompt_callback_t(name, name##_t)
#ifndef USE_PRIVATE_TOOL #ifndef USE_PRIVATE_TOOL
static void static void
@ -1150,29 +1150,29 @@ int ompt_initialize(
ompt_enumerate_states = (ompt_enumerate_states_t) lookup("ompt_enumerate_states"); ompt_enumerate_states = (ompt_enumerate_states_t) lookup("ompt_enumerate_states");
ompt_enumerate_mutex_impls = (ompt_enumerate_mutex_impls_t) lookup("ompt_enumerate_mutex_impls"); ompt_enumerate_mutex_impls = (ompt_enumerate_mutex_impls_t) lookup("ompt_enumerate_mutex_impls");
register_callback(ompt_callback_mutex_acquire); register_ompt_callback(ompt_callback_mutex_acquire);
register_callback_t(ompt_callback_mutex_acquired, ompt_callback_mutex_t); register_ompt_callback_t(ompt_callback_mutex_acquired, ompt_callback_mutex_t);
register_callback_t(ompt_callback_mutex_released, ompt_callback_mutex_t); register_ompt_callback_t(ompt_callback_mutex_released, ompt_callback_mutex_t);
register_callback(ompt_callback_nest_lock); register_ompt_callback(ompt_callback_nest_lock);
register_callback(ompt_callback_sync_region); register_ompt_callback(ompt_callback_sync_region);
register_callback_t(ompt_callback_sync_region_wait, ompt_callback_sync_region_t); register_ompt_callback_t(ompt_callback_sync_region_wait, ompt_callback_sync_region_t);
register_callback_t(ompt_callback_reduction, ompt_callback_sync_region_t); register_ompt_callback_t(ompt_callback_reduction, ompt_callback_sync_region_t);
register_callback(ompt_callback_control_tool); register_ompt_callback(ompt_callback_control_tool);
register_callback(ompt_callback_flush); register_ompt_callback(ompt_callback_flush);
register_callback(ompt_callback_cancel); register_ompt_callback(ompt_callback_cancel);
register_callback(ompt_callback_implicit_task); register_ompt_callback(ompt_callback_implicit_task);
register_callback_t(ompt_callback_lock_init, ompt_callback_mutex_acquire_t); register_ompt_callback_t(ompt_callback_lock_init, ompt_callback_mutex_acquire_t);
register_callback_t(ompt_callback_lock_destroy, ompt_callback_mutex_t); register_ompt_callback_t(ompt_callback_lock_destroy, ompt_callback_mutex_t);
register_callback(ompt_callback_work); register_ompt_callback(ompt_callback_work);
register_callback(ompt_callback_masked); register_ompt_callback(ompt_callback_masked);
register_callback(ompt_callback_parallel_begin); register_ompt_callback(ompt_callback_parallel_begin);
register_callback(ompt_callback_parallel_end); register_ompt_callback(ompt_callback_parallel_end);
register_callback(ompt_callback_task_create); register_ompt_callback(ompt_callback_task_create);
register_callback(ompt_callback_task_schedule); register_ompt_callback(ompt_callback_task_schedule);
register_callback(ompt_callback_dependences); register_ompt_callback(ompt_callback_dependences);
register_callback(ompt_callback_task_dependence); register_ompt_callback(ompt_callback_task_dependence);
register_callback(ompt_callback_thread_begin); register_ompt_callback(ompt_callback_thread_begin);
register_callback(ompt_callback_thread_end); register_ompt_callback(ompt_callback_thread_end);
printf("0: NULL_POINTER=%p\n", (void*)NULL); printf("0: NULL_POINTER=%p\n", (void*)NULL);
return 1; //success return 1; //success
} }

View File

@ -86,8 +86,8 @@ int ompt_initialize(ompt_function_lookup_t lookup, int initial_device_num,
ompt_get_unique_id = (ompt_get_unique_id_t)lookup("ompt_get_unique_id"); ompt_get_unique_id = (ompt_get_unique_id_t)lookup("ompt_get_unique_id");
ompt_get_thread_data = (ompt_get_thread_data_t)lookup("ompt_get_thread_data"); ompt_get_thread_data = (ompt_get_thread_data_t)lookup("ompt_get_thread_data");
register_callback(ompt_callback_thread_begin); register_ompt_callback(ompt_callback_thread_begin);
register_callback(ompt_callback_parallel_begin); register_ompt_callback(ompt_callback_parallel_begin);
printf("0: NULL_POINTER=%p\n", (void *)NULL); printf("0: NULL_POINTER=%p\n", (void *)NULL);
return 1; // success return 1; // success
} }

View File

@ -121,7 +121,7 @@ on_ompt_callback_sync_region_wait(
} }
} }
#define register_callback_t(name, type) \ #define register_ompt_callback_t(name, type) \
do{ \ do{ \
type f_##name = &on_##name; \ type f_##name = &on_##name; \
if (ompt_set_callback(name, (ompt_callback_t)f_##name) == \ if (ompt_set_callback(name, (ompt_callback_t)f_##name) == \
@ -129,7 +129,7 @@ do{ \
printf("0: Could not register callback '" #name "'\n"); \ printf("0: Could not register callback '" #name "'\n"); \
}while(0) }while(0)
#define register_callback(name) register_callback_t(name, name##_t) #define register_ompt_callback(name) register_ompt_callback_t(name, name##_t)
int ompt_initialize(ompt_function_lookup_t lookup, int initial_device_num, int ompt_initialize(ompt_function_lookup_t lookup, int initial_device_num,
ompt_data_t *tool_data) { ompt_data_t *tool_data) {
@ -137,9 +137,9 @@ int ompt_initialize(ompt_function_lookup_t lookup, int initial_device_num,
ompt_set_callback = (ompt_set_callback_t) lookup("ompt_set_callback"); ompt_set_callback = (ompt_set_callback_t) lookup("ompt_set_callback");
ompt_get_unique_id = (ompt_get_unique_id_t) lookup("ompt_get_unique_id"); ompt_get_unique_id = (ompt_get_unique_id_t) lookup("ompt_get_unique_id");
ompt_get_thread_data = (ompt_get_thread_data_t) lookup("ompt_get_thread_data"); ompt_get_thread_data = (ompt_get_thread_data_t) lookup("ompt_get_thread_data");
register_callback(ompt_callback_sync_region); register_ompt_callback(ompt_callback_sync_region);
register_callback_t(ompt_callback_sync_region_wait, ompt_callback_sync_region_t); register_ompt_callback_t(ompt_callback_sync_region_wait, ompt_callback_sync_region_t);
register_callback(ompt_callback_thread_begin); register_ompt_callback(ompt_callback_thread_begin);
printf("0: NULL_POINTER=%p\n", (void*)NULL); printf("0: NULL_POINTER=%p\n", (void*)NULL);
return 1; //success return 1; //success
} }

View File

@ -62,7 +62,7 @@ int ompt_initialize(ompt_function_lookup_t lookup, int initial_device_num,
ompt_get_unique_id = (ompt_get_unique_id_t)lookup("ompt_get_unique_id"); ompt_get_unique_id = (ompt_get_unique_id_t)lookup("ompt_get_unique_id");
ompt_get_thread_data = (ompt_get_thread_data_t)lookup("ompt_get_thread_data"); ompt_get_thread_data = (ompt_get_thread_data_t)lookup("ompt_get_thread_data");
register_callback(ompt_callback_master); register_ompt_callback(ompt_callback_master);
printf("0: NULL_POINTER=%p\n", (void *)NULL); printf("0: NULL_POINTER=%p\n", (void *)NULL);
return 1; // success return 1; // success
} }

View File

@ -77,9 +77,9 @@ int ompt_initialize(ompt_function_lookup_t lookup, int initial_device_num,
ompt_get_unique_id = (ompt_get_unique_id_t)lookup("ompt_get_unique_id"); ompt_get_unique_id = (ompt_get_unique_id_t)lookup("ompt_get_unique_id");
ompt_get_task_memory = (ompt_get_task_memory_t)lookup("ompt_get_task_memory"); ompt_get_task_memory = (ompt_get_task_memory_t)lookup("ompt_get_task_memory");
register_callback(ompt_callback_implicit_task); register_ompt_callback(ompt_callback_implicit_task);
register_callback(ompt_callback_task_create); register_ompt_callback(ompt_callback_task_create);
register_callback(ompt_callback_task_schedule); register_ompt_callback(ompt_callback_task_schedule);
printf("0: NULL_POINTER=%p\n", (void *)NULL); printf("0: NULL_POINTER=%p\n", (void *)NULL);
return 1; // success return 1; // success
} }