[Openmp-commits] [openmp] [OpenMP] Add ompt_start_tool declaration in omp-tools.h (PR #97099)

Hansang Bae via Openmp-commits openmp-commits at lists.llvm.org
Wed Jul 3 10:26:31 PDT 2024


https://github.com/hansangbae updated https://github.com/llvm/llvm-project/pull/97099

>From c902e6746275bcd12bfe389d1c87467a0de5a806 Mon Sep 17 00:00:00 2001
From: Hansang Bae <hansang.bae at intel.com>
Date: Tue, 16 Apr 2024 11:12:26 -0500
Subject: [PATCH 1/2] [OpenMP] Add ompt_start_tool declaration in omp-tools.h

The function ompt_start_tool is a globally-visible C function according
to the specification.
---
 openmp/runtime/src/include/omp-tools.h.var | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/openmp/runtime/src/include/omp-tools.h.var b/openmp/runtime/src/include/omp-tools.h.var
index 1d1a0f7771e95..9c568397164d0 100644
--- a/openmp/runtime/src/include/omp-tools.h.var
+++ b/openmp/runtime/src/include/omp-tools.h.var
@@ -1408,6 +1408,12 @@ typedef ompt_record_ompt_t *(*ompt_get_record_ompt_t) (
   ompt_buffer_cursor_t current
 );
 
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+ompt_start_tool_result_t *ompt_start_tool(unsigned int omp_version,
+                                          const char *runtime_version);
+
 #define ompt_id_none 0
 #define ompt_data_none {0}
 #define ompt_time_none 0

>From 8106077590cba7e264ceede4653bf880796d8f22 Mon Sep 17 00:00:00 2001
From: Hansang Bae <hansang.bae at intel.com>
Date: Wed, 3 Jul 2024 12:25:10 -0500
Subject: [PATCH 2/2] Add default visibility attribute

---
 openmp/runtime/src/include/omp-tools.h.var | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/openmp/runtime/src/include/omp-tools.h.var b/openmp/runtime/src/include/omp-tools.h.var
index 9c568397164d0..8ee179dfe84d7 100644
--- a/openmp/runtime/src/include/omp-tools.h.var
+++ b/openmp/runtime/src/include/omp-tools.h.var
@@ -1410,6 +1410,8 @@ typedef ompt_record_ompt_t *(*ompt_get_record_ompt_t) (
 
 #ifdef _WIN32
 __declspec(dllexport)
+#else
+__attribute__((visibility("default")))
 #endif
 ompt_start_tool_result_t *ompt_start_tool(unsigned int omp_version,
                                           const char *runtime_version);



More information about the Openmp-commits mailing list