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) 2023-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 #if defined(NVTX_AS_SYSTEM_HEADER)
0022 #if defined(__clang__)
0023 #pragma clang system_header
0024 #elif defined(__GNUC__) || defined(__NVCOMPILER)
0025 #pragma GCC system_header
0026 #elif defined(_MSC_VER)
0027 #pragma system_header
0028 #endif
0029 #endif
0030 
0031 #ifndef NVTX_EXT_HELPER_MACROS_H
0032 #define NVTX_EXT_HELPER_MACROS_H
0033 
0034 #if !defined(NVTX_NULLPTR)
0035 #if defined(__cplusplus) && __cplusplus >= 201103L
0036 #define NVTX_NULLPTR nullptr
0037 #else
0038 #define NVTX_NULLPTR NULL
0039 #endif
0040 #endif
0041 
0042 /* Combine tokens */
0043 #define _NVTX_EXT_CONCAT(a, b) a##b
0044 #define NVTX_EXT_CONCAT(a, b) _NVTX_EXT_CONCAT(a, b)
0045 
0046 /* Resolves to the number of arguments passed. */
0047 #define NVTX_EXT_NUM_ARGS(...) \
0048     NVTX_EXT_SELECTA16(__VA_ARGS__, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, throwaway)
0049 #define NVTX_EXT_SELECTA16(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, ...) a16
0050 
0051 /* Cast argument(s) to void to prevent unused variable warnings. */
0052 #define _NVTX_EXT_VOIDIFY0()
0053 #define _NVTX_EXT_VOIDIFY1(a1) (void)a1;
0054 #define _NVTX_EXT_VOIDIFY2(a1, a2) (void)a1; (void)a2;
0055 #define _NVTX_EXT_VOIDIFY3(a1, a2, a3) (void)a1; (void)a2; (void)a3;
0056 #define _NVTX_EXT_VOIDIFY4(a1, a2, a3, a4) (void)a1; (void)a2; (void)a3; (void)a4;
0057 #define _NVTX_EXT_VOIDIFY5(a1, a2, a3, a4, a5) (void)a1; (void)a2; (void)a3; (void)a4; (void)a5;
0058 #define _NVTX_EXT_VOIDIFY6(a1, a2, a3, a4, a5, a6) (void)a1; (void)a2; (void)a3; (void)a4; (void)a5; (void)a6;
0059 
0060 /* Mark function arguments as unused. */
0061 #define NVTX_EXT_HELPER_UNUSED_ARGS(...) \
0062     NVTX_EXT_CONCAT(_NVTX_EXT_VOIDIFY, NVTX_EXT_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__)
0063 
0064 #endif /* NVTX_EXT_HELPER_MACROS_H */