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_CUDA
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 void (NVTX_API * nvtxNameCuDeviceA_impl_fntype)(CUdevice device, const char* name);
0041 typedef void (NVTX_API * nvtxNameCuDeviceW_impl_fntype)(CUdevice device, const wchar_t* name);
0042 typedef void (NVTX_API * nvtxNameCuContextA_impl_fntype)(CUcontext context, const char* name);
0043 typedef void (NVTX_API * nvtxNameCuContextW_impl_fntype)(CUcontext context, const wchar_t* name);
0044 typedef void (NVTX_API * nvtxNameCuStreamA_impl_fntype)(CUstream stream, const char* name);
0045 typedef void (NVTX_API * nvtxNameCuStreamW_impl_fntype)(CUstream stream, const wchar_t* name);
0046 typedef void (NVTX_API * nvtxNameCuEventA_impl_fntype)(CUevent event, const char* name);
0047 typedef void (NVTX_API * nvtxNameCuEventW_impl_fntype)(CUevent event, const wchar_t* name);
0048 
0049 NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceA(CUdevice device, const char* name)
0050 {
0051     NVTX_SET_NAME_MANGLING_OPTIONS
0052 #ifdef NVTX_DISABLE
0053     (void)device;
0054     (void)name;
0055 #else /* NVTX_DISABLE */
0056     nvtxNameCuDeviceA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceA_impl_fnptr;
0057     if (local != NVTX_NULLPTR)
0058         (*local)(device, name);
0059 #endif /* NVTX_DISABLE */
0060 }
0061 
0062 NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceW(CUdevice device, const wchar_t* name)
0063 {
0064     NVTX_SET_NAME_MANGLING_OPTIONS
0065 #ifdef NVTX_DISABLE
0066     (void)device;
0067     (void)name;
0068 #else /* NVTX_DISABLE */
0069     nvtxNameCuDeviceW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceW_impl_fnptr;
0070     if (local != NVTX_NULLPTR)
0071         (*local)(device, name);
0072 #endif /* NVTX_DISABLE */
0073 }
0074 
0075 NVTX_DECLSPEC void NVTX_API nvtxNameCuContextA(CUcontext context, const char* name)
0076 {
0077     NVTX_SET_NAME_MANGLING_OPTIONS
0078 #ifdef NVTX_DISABLE
0079     (void)context;
0080     (void)name;
0081 #else /* NVTX_DISABLE */
0082     nvtxNameCuContextA_impl_fntype local = NVTX_REINTERPRET_CAST(nvtxNameCuContextA_impl_fntype, NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextA_impl_fnptr);
0083     if (local != NVTX_NULLPTR)
0084         (*local)(context, name);
0085 #endif /* NVTX_DISABLE */
0086 }
0087 
0088 NVTX_DECLSPEC void NVTX_API nvtxNameCuContextW(CUcontext context, const wchar_t* name)
0089 {
0090     NVTX_SET_NAME_MANGLING_OPTIONS
0091 #ifdef NVTX_DISABLE
0092     (void)context;
0093     (void)name;
0094 #else /* NVTX_DISABLE */
0095     nvtxNameCuContextW_impl_fntype local = NVTX_REINTERPRET_CAST(nvtxNameCuContextW_impl_fntype, NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextW_impl_fnptr);
0096     if (local != NVTX_NULLPTR)
0097         (*local)(context, name);
0098 #endif /* NVTX_DISABLE */
0099 }
0100 
0101 NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamA(CUstream stream, const char* name)
0102 {
0103     NVTX_SET_NAME_MANGLING_OPTIONS
0104 #ifdef NVTX_DISABLE
0105     (void)stream;
0106     (void)name;
0107 #else /* NVTX_DISABLE */
0108     nvtxNameCuStreamA_impl_fntype local = NVTX_REINTERPRET_CAST(nvtxNameCuStreamA_impl_fntype, NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamA_impl_fnptr);
0109     if (local != NVTX_NULLPTR)
0110         (*local)(stream, name);
0111 #endif /* NVTX_DISABLE */
0112 }
0113 
0114 NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamW(CUstream stream, const wchar_t* name)
0115 {
0116     NVTX_SET_NAME_MANGLING_OPTIONS
0117 #ifdef NVTX_DISABLE
0118     (void)stream;
0119     (void)name;
0120 #else /* NVTX_DISABLE */
0121     nvtxNameCuStreamW_impl_fntype local = NVTX_REINTERPRET_CAST(nvtxNameCuStreamW_impl_fntype, NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamW_impl_fnptr);
0122     if (local != NVTX_NULLPTR)
0123         (*local)(stream, name);
0124 #endif /* NVTX_DISABLE */
0125 }
0126 
0127 NVTX_DECLSPEC void NVTX_API nvtxNameCuEventA(CUevent event, const char* name)
0128 {
0129     NVTX_SET_NAME_MANGLING_OPTIONS
0130 #ifdef NVTX_DISABLE
0131     (void)event;
0132     (void)name;
0133 #else /* NVTX_DISABLE */
0134     nvtxNameCuEventA_impl_fntype local = NVTX_REINTERPRET_CAST(nvtxNameCuEventA_impl_fntype, NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventA_impl_fnptr);
0135     if (local != NVTX_NULLPTR)
0136         (*local)(event, name);
0137 #endif /* NVTX_DISABLE */
0138 }
0139 
0140 NVTX_DECLSPEC void NVTX_API nvtxNameCuEventW(CUevent event, const wchar_t* name)
0141 {
0142     NVTX_SET_NAME_MANGLING_OPTIONS
0143 #ifdef NVTX_DISABLE
0144     (void)event;
0145     (void)name;
0146 #else /* NVTX_DISABLE */
0147     nvtxNameCuEventW_impl_fntype local = NVTX_REINTERPRET_CAST(nvtxNameCuEventW_impl_fntype, NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventW_impl_fnptr);
0148     if (local != NVTX_NULLPTR)
0149         (*local)(event, name);
0150 #endif /* NVTX_DISABLE */
0151 }
0152 
0153 #ifdef __cplusplus
0154 } /* extern "C" */
0155 #endif /* __cplusplus */
0156