Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:45:12

0001 /*
0002  * SPDX-FileCopyrightText: Copyright (c) 2009-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
0003  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0004  *
0005  * Licensed under the Apache License, Version 2.0 (the "License");
0006  * you may not use this file except in compliance with the License.
0007  * You may obtain a copy of the License at
0008  *
0009  *     http://www.apache.org/licenses/LICENSE-2.0
0010  *
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  *
0017  * Licensed under the Apache License v2.0 with LLVM Exceptions.
0018  * See https://nvidia.github.io/NVTX/LICENSE.txt for license information.
0019  */
0020 
0021 #ifndef NVTX_IMPL_GUARD_SYNC
0022 #error Never include this file directly -- it is automatically included by nvToolsExtCuda.h (except when NVTX_NO_IMPL is defined).
0023 #endif
0024 
0025 #if defined(NVTX_AS_SYSTEM_HEADER)
0026 #if defined(__clang__)
0027 #pragma clang system_header
0028 #elif defined(__GNUC__) || defined(__NVCOMPILER)
0029 #pragma GCC system_header
0030 #elif defined(_MSC_VER)
0031 #pragma system_header
0032 #endif
0033 #endif
0034 
0035 
0036 #ifdef __cplusplus
0037 extern "C" {
0038 #endif /* __cplusplus */
0039 
0040 typedef nvtxSyncUser_t (NVTX_API * nvtxDomainSyncUserCreate_impl_fntype)(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t* attribs);
0041 typedef void (NVTX_API * nvtxDomainSyncUserDestroy_impl_fntype)(nvtxSyncUser_t handle);
0042 typedef void (NVTX_API * nvtxDomainSyncUserAcquireStart_impl_fntype)(nvtxSyncUser_t handle);
0043 typedef void (NVTX_API * nvtxDomainSyncUserAcquireFailed_impl_fntype)(nvtxSyncUser_t handle);
0044 typedef void (NVTX_API * nvtxDomainSyncUserAcquireSuccess_impl_fntype)(nvtxSyncUser_t handle);
0045 typedef void (NVTX_API * nvtxDomainSyncUserReleasing_impl_fntype)(nvtxSyncUser_t handle);
0046 
0047 NVTX_DECLSPEC nvtxSyncUser_t NVTX_API nvtxDomainSyncUserCreate(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t* attribs)
0048 {
0049     NVTX_SET_NAME_MANGLING_OPTIONS
0050 #ifdef NVTX_DISABLE
0051     (void)domain;
0052     (void)attribs;
0053 #else /* NVTX_DISABLE */
0054     nvtxDomainSyncUserCreate_impl_fntype local = NVTX_REINTERPRET_CAST(nvtxDomainSyncUserCreate_impl_fntype, NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserCreate_impl_fnptr);
0055     if (local != NVTX_NULLPTR)
0056         return (*local)(domain, attribs);
0057     else
0058 #endif /* NVTX_DISABLE */
0059         return NVTX_NULLPTR;
0060 }
0061 
0062 NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserDestroy(nvtxSyncUser_t handle)
0063 {
0064     NVTX_SET_NAME_MANGLING_OPTIONS
0065 #ifdef NVTX_DISABLE
0066     (void)handle;
0067 #else /* NVTX_DISABLE */
0068     nvtxDomainSyncUserDestroy_impl_fntype local = NVTX_REINTERPRET_CAST(nvtxDomainSyncUserDestroy_impl_fntype, NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserDestroy_impl_fnptr);
0069     if (local != NVTX_NULLPTR)
0070         (*local)(handle);
0071 #endif /* NVTX_DISABLE */
0072 }
0073 
0074 NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireStart(nvtxSyncUser_t handle)
0075 {
0076     NVTX_SET_NAME_MANGLING_OPTIONS
0077 #ifdef NVTX_DISABLE
0078     (void)handle;
0079 #else /* NVTX_DISABLE */
0080     nvtxDomainSyncUserAcquireStart_impl_fntype local = NVTX_REINTERPRET_CAST(nvtxDomainSyncUserAcquireStart_impl_fntype, NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireStart_impl_fnptr);
0081     if (local != NVTX_NULLPTR)
0082         (*local)(handle);
0083 #endif /* NVTX_DISABLE */
0084 }
0085 
0086 NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireFailed(nvtxSyncUser_t handle)
0087 {
0088     NVTX_SET_NAME_MANGLING_OPTIONS
0089 #ifdef NVTX_DISABLE
0090     (void)handle;
0091 #else /* NVTX_DISABLE */
0092     nvtxDomainSyncUserAcquireFailed_impl_fntype local = NVTX_REINTERPRET_CAST(nvtxDomainSyncUserAcquireFailed_impl_fntype, NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireFailed_impl_fnptr);
0093     if (local != NVTX_NULLPTR)
0094         (*local)(handle);
0095 #endif /* NVTX_DISABLE */
0096 }
0097 
0098 NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireSuccess(nvtxSyncUser_t handle)
0099 {
0100     NVTX_SET_NAME_MANGLING_OPTIONS
0101 #ifdef NVTX_DISABLE
0102     (void)handle;
0103 #else /* NVTX_DISABLE */
0104     nvtxDomainSyncUserAcquireSuccess_impl_fntype local = NVTX_REINTERPRET_CAST(nvtxDomainSyncUserAcquireSuccess_impl_fntype, NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireSuccess_impl_fnptr);
0105     if (local != NVTX_NULLPTR)
0106         (*local)(handle);
0107 #endif /* NVTX_DISABLE */
0108 }
0109 
0110 NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserReleasing(nvtxSyncUser_t handle)
0111 {
0112     NVTX_SET_NAME_MANGLING_OPTIONS
0113 #ifdef NVTX_DISABLE
0114     (void)handle;
0115 #else /* NVTX_DISABLE */
0116     nvtxDomainSyncUserReleasing_impl_fntype local = NVTX_REINTERPRET_CAST(nvtxDomainSyncUserReleasing_impl_fntype, NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserReleasing_impl_fnptr);
0117     if (local != NVTX_NULLPTR)
0118         (*local)(handle);
0119 #endif /* NVTX_DISABLE */
0120 }
0121 
0122 #ifdef __cplusplus
0123 } /* extern "C" */
0124 #endif /* __cplusplus */