[Openmp-commits] [llvm] [openmp] [offload][ompt] Added lookup function for device callbacks (PR #110007)

via Openmp-commits openmp-commits at lists.llvm.org
Wed Sep 25 08:59:52 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 2a29d24ba94dac82e838c694595a0a574e505aab e763658b60661962300e6d7848f1ade2cab6035f --extensions cpp,h -- offload/include/OpenMP/OMPT/Callback.h offload/src/OpenMP/OMPT/Callback.cpp openmp/runtime/src/ompt-general.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/offload/src/OpenMP/OMPT/Callback.cpp b/offload/src/OpenMP/OMPT/Callback.cpp
index 4da140f850..1c35a2e957 100644
--- a/offload/src/OpenMP/OMPT/Callback.cpp
+++ b/offload/src/OpenMP/OMPT/Callback.cpp
@@ -45,19 +45,18 @@ double ompt_translate_time(ompt_device_t *device, ompt_device_time_t time) {
 }
 
 ompt_set_result_t ompt_set_trace_ompt(ompt_device_t *device,
-                                        unsigned int enable,
-                                        unsigned int etype) {
+                                      unsigned int enable, unsigned int etype) {
   return ompt_set_error;
 }
 
 ompt_set_result_t ompt_set_trace_native(ompt_device_t *device, int enable,
-                                          int flags) {
+                                        int flags) {
   return ompt_set_error;
 }
 
 int ompt_start_trace(ompt_device_t *device,
-                       ompt_callback_buffer_request_t request,
-                       ompt_callback_buffer_complete_t complete) {
+                     ompt_callback_buffer_request_t request,
+                     ompt_callback_buffer_complete_t complete) {
   return 0;
 }
 
@@ -68,19 +67,19 @@ int ompt_flush_trace(ompt_device_t *device) { return 0; }
 int ompt_stop_trace(ompt_device_t *device) { return 0; }
 
 int ompt_advance_buffer_cursor(ompt_device_t *device, ompt_buffer_t *buffer,
-                                 size_t size, ompt_buffer_cursor_t current,
-                                 ompt_buffer_cursor_t *next) {
+                               size_t size, ompt_buffer_cursor_t current,
+                               ompt_buffer_cursor_t *next) {
   return 0;
 }
 
 ompt_record_t ompt_get_record_type(ompt_buffer_t *buffer,
-                                     ompt_buffer_cursor_t current) {
+                                   ompt_buffer_cursor_t current) {
   return ompt_record_ompt;
 }
 
 void *ompt_get_record_native(ompt_buffer_t *buffer,
-                               ompt_buffer_cursor_t current,
-                               ompt_id_t *host_op_id) {
+                             ompt_buffer_cursor_t current,
+                             ompt_id_t *host_op_id) {
   return NULL;
 }
 
@@ -88,7 +87,8 @@ ompt_record_abstract_t *ompt_get_record_abstract(void *native_record) {
   return NULL;
 }
 
-ompt_interface_fn_t llvm::omp::target::ompt::ompt_device_fn_lookup(const char *s) {
+ompt_interface_fn_t
+llvm::omp::target::ompt::ompt_device_fn_lookup(const char *s) {
 #define ompt_interface_fn(fn)                                                  \
   fn##_t fn##_f = fn;                                                          \
   if (strcmp(s, #fn) == 0)                                                     \
@@ -99,7 +99,6 @@ ompt_interface_fn_t llvm::omp::target::ompt::ompt_device_fn_lookup(const char *s
   return NULL;
 }
 
-
 /// Forward declaration
 class LibomptargetRtlFinalizer;
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/110007


More information about the Openmp-commits mailing list