[Openmp-commits] [PATCH] D100183: [OpenMP] [OMPD] [3/6] Implementation of OMPD debugging library - libompd. omp-debug: Implementation of OMPD APIs.

Hansang Bae via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Sep 16 12:17:22 PDT 2021


hbae added inline comments.


================
Comment at: openmp/libompd/src/omp-debug.cpp:45
+ompd_rc_t ompd_initialize(ompd_word_t version, const ompd_callbacks_t *table) {
+  ompd_rc_t ret = table ? ompd_rc_ok : ompd_rc_bad_input;
+  ompd_word_t ompd_version;
----------------
Can we return early here if callback table is invalid?


================
Comment at: openmp/libompd/src/omp-debug.cpp:84
+    return ret;
+  if (!handle)
+    return ompd_rc_error;
----------------
Should this be `!*handle`?


================
Comment at: openmp/libompd/src/omp-debug.cpp:152
+  if (!addr_handle)
+    return ompd_rc_bad_input;
+
----------------
`ompd_rc_stale_handle` looks more accurate.


================
Comment at: openmp/libompd/src/omp-debug.cpp:176
+    ompd_parallel_handle_t *parallel_handle, /* IN: OpenMP parallel handle */
+    int thread_num, /* OUT: number of handles in the array */
+    ompd_thread_handle_t **thread_handle /* OUT: handle */
----------------
Comment is incorrect.
Something like `IN: thread number for the returned handle` should be fine.


================
Comment at: openmp/libompd/src/omp-debug.cpp:224
+ompd_rc_t ompd_rel_thread_handle(
+    ompd_thread_handle_t *thread_handle /* IN: OpenMP parallel handle */
+) {
----------------
Comment is incorrect.


================
Comment at: openmp/libompd/src/omp-debug.cpp:616
+    ompd_parallel_handle_t *parallel_handle, /* IN: OpenMP parallel handle */
+    int thread_num,                  /* OUT: number of the task handle */
+    ompd_task_handle_t **task_handle /* OUT: OpenMP task handle */
----------------
Comment is incorrect. This is also an input.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100183/new/

https://reviews.llvm.org/D100183



More information about the Openmp-commits mailing list