rocprofiler-sdk/ompt.h Source File

rocprofiler-sdk/ompt.h Source File#

ROCprofiler-SDK developer API: rocprofiler-sdk/ompt.h Source File
ROCprofiler-SDK developer API 1.0.0
ROCm Profiling API and tools
ompt.h
1// MIT License
2//
3// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in all
13// copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21// SOFTWARE.
22
23#pragma once
24
25#include <rocprofiler-sdk/defines.h>
26#include <rocprofiler-sdk/fwd.h>
27#include <rocprofiler-sdk/ompt/api_args.h>
28#include <rocprofiler-sdk/ompt/api_id.h>
29#include <rocprofiler-sdk/ompt/omp-tools.h>
30
31/**
32 * @defgroup OMPT_REGISTRATION Tool registration for OpenMP Tools
33 *
34 * Functions for enabling OMPT support in tools which provide their own ompt_start_tool symbol but
35 * want to defer to rocprofiler-sdk for OMPT.
36 *
37 * @{
38 */
39
40ROCPROFILER_EXTERN_C_INIT
41
42/**
43 * @brief (experimental) Query whether rocprofiler-sdk OMPT implementation has been initialized by
44 * OpenMP runtime.
45 *
46 * @param [out] status Set to 0 if rocprofiler OMPT has not been initialized. Otherwise, set to 1.
47 * @return ::rocprofiler_status_t
48 * @retval ::ROCPROFILER_STATUS_SUCCESS Always returns this value
49 */
50ROCPROFILER_SDK_EXPERIMENTAL
52rocprofiler_ompt_is_initialized(int* status) ROCPROFILER_API ROCPROFILER_NONNULL(1);
53
54/**
55 * @brief (experimental) Query whether rocprofiler-sdk OMPT implementation has invoked ompt_finalize
56 * function.
57 *
58 * @param [out] status Set to 0 if rocprofiler OMPT has not been finalized. Otherwise, set to 1.
59 * @return ::rocprofiler_status_t
60 * @retval ::ROCPROFILER_STATUS_SUCCESS Always returns this value
61 */
62ROCPROFILER_SDK_EXPERIMENTAL
64rocprofiler_ompt_is_finalized(int* status) ROCPROFILER_API ROCPROFILER_NONNULL(1);
65
66/**
67 * @brief (experimental) If a tool which contains a "ompt_start_tool" function which is invoked by
68 * the OpenMP runtime but the tool wishes to defer to rocprofiler-sdk to be the OMPT tool, it should
69 * invoke this function from it's `ompt_start_tool` implementation.
70 *
71 * @param [in] omp_version Refer to OpenMP OMPT docs for more information
72 * @param [in] runtime_version Refer to OpenMP OMPT docs for more information
73 * @return ompt_start_tool_result_t*
74 */
75ROCPROFILER_SDK_EXPERIMENTAL
76ompt_start_tool_result_t*
77rocprofiler_ompt_start_tool(unsigned int omp_version, const char* runtime_version) ROCPROFILER_API;
78
79ROCPROFILER_EXTERN_C_FINI
80
81/** @} */
rocprofiler_status_t
Status codes.
Definition fwd.h:49
rocprofiler_status_t rocprofiler_ompt_is_finalized(int *status)
(experimental) Query whether rocprofiler-sdk OMPT implementation has invoked ompt_finalize function.
ompt_start_tool_result_t * rocprofiler_ompt_start_tool(unsigned int omp_version, const char *runtime_version)
(experimental) If a tool which contains a "ompt_start_tool" function which is invoked by the OpenMP r...
rocprofiler_status_t rocprofiler_ompt_is_initialized(int *status)
(experimental) Query whether rocprofiler-sdk OMPT implementation has been initialized by OpenMP runti...