Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / ompt / register_non_emi_map.h
blobb5c663410d55a226d0f6441f907aec55e2617e8b
1 #include <omp-tools.h>
3 // From openmp/runtime/test/ompt/callback.h
4 #define register_ompt_callback_t(name, type) \
5 do { \
6 type f_##name = &on_##name; \
7 if (ompt_set_callback(name, (ompt_callback_t)f_##name) == ompt_set_never) \
8 printf("0: Could not register callback '" #name "'\n"); \
9 } while (0)
11 #define register_ompt_callback(name) register_ompt_callback_t(name, name##_t)
13 // OMPT entry point handles
14 static ompt_set_callback_t ompt_set_callback = 0;
16 // Init functions
17 int ompt_initialize(ompt_function_lookup_t lookup, int initial_device_num,
18 ompt_data_t *tool_data) {
19 ompt_set_callback = (ompt_set_callback_t)lookup("ompt_set_callback");
21 if (!ompt_set_callback)
22 return 0; // failed
24 register_ompt_callback(ompt_callback_device_initialize);
25 register_ompt_callback(ompt_callback_device_finalize);
26 register_ompt_callback(ompt_callback_device_load);
27 register_ompt_callback(ompt_callback_target_data_op);
28 register_ompt_callback(ompt_callback_target);
29 register_ompt_callback(ompt_callback_target_submit);
30 register_ompt_callback(ompt_callback_target_map);
32 return 1; // success
35 void ompt_finalize(ompt_data_t *tool_data) {}
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 ompt_start_tool_result_t *ompt_start_tool(unsigned int omp_version,
41 const char *runtime_version) {
42 static ompt_start_tool_result_t ompt_start_tool_result = {&ompt_initialize,
43 &ompt_finalize, 0};
44 return &ompt_start_tool_result;
46 #ifdef __cplusplus
48 #endif