Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- wemm/lib/python3.10/site-packages/nvidia/__init__.py +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nccl/__init__.py +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nccl/__pycache__/__init__.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nccl/include/__init__.py +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nccl/include/__pycache__/__init__.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nccl/include/nccl.h +398 -0
- wemm/lib/python3.10/site-packages/nvidia/nccl/include/nccl_net.h +313 -0
- wemm/lib/python3.10/site-packages/nvidia/nccl/lib/__init__.py +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nccl/lib/__pycache__/__init__.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvjitlink/__init__.py +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvjitlink/__pycache__/__init__.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvjitlink/include/__init__.py +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvjitlink/include/__pycache__/__init__.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvjitlink/include/nvJitLink.h +522 -0
- wemm/lib/python3.10/site-packages/nvidia/nvjitlink/lib/__init__.py +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvjitlink/lib/__pycache__/__init__.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/__init__.py +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/__pycache__/__init__.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/__init__.py +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/__pycache__/__init__.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvToolsExt.h +1561 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvToolsExtCuda.h +164 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvToolsExtCudaRt.h +140 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvToolsExtOpenCL.h +214 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvToolsExtSync.h +406 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvToolsExt.h +1499 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvToolsExtCuda.h +170 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvToolsExtCudaRt.h +146 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvToolsExtOpenCL.h +220 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvToolsExtSync.h +411 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxImpl.h +469 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxImplCore.h +299 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxImplCuda_v3.h +133 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxImplOpenCL_v3.h +192 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxInit.h +343 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxInitDefs.h +565 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxLinkOnce.h +75 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxTypes.h +333 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/lib/__init__.py +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/lib/__pycache__/__init__.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/nvidia/nvtx/lib/libnvToolsExt.so.1 +0 -0
- wemm/lib/python3.10/site-packages/pytorch_lightning/loggers/__pycache__/__init__.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/pytorch_lightning/loggers/__pycache__/csv_logs.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/pytorch_lightning/loggers/__pycache__/neptune.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/pytorch_lightning/loggers/__pycache__/utilities.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/pytorch_lightning/loggers/__pycache__/wandb.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/pytorch_lightning/loggers/neptune.py +545 -0
- wemm/lib/python3.10/site-packages/pytorch_lightning/profilers/__pycache__/__init__.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/pytorch_lightning/profilers/__pycache__/base.cpython-310.pyc +0 -0
- wemm/lib/python3.10/site-packages/pytorch_lightning/profilers/__pycache__/pytorch.cpython-310.pyc +0 -0
wemm/lib/python3.10/site-packages/nvidia/__init__.py
ADDED
|
File without changes
|
wemm/lib/python3.10/site-packages/nvidia/nccl/__init__.py
ADDED
|
File without changes
|
wemm/lib/python3.10/site-packages/nvidia/nccl/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (161 Bytes). View file
|
|
|
wemm/lib/python3.10/site-packages/nvidia/nccl/include/__init__.py
ADDED
|
File without changes
|
wemm/lib/python3.10/site-packages/nvidia/nccl/include/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (169 Bytes). View file
|
|
|
wemm/lib/python3.10/site-packages/nvidia/nccl/include/nccl.h
ADDED
|
@@ -0,0 +1,398 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*************************************************************************
|
| 2 |
+
* Copyright (c) 2015-2021, NVIDIA CORPORATION. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* See LICENSE.txt for license information
|
| 5 |
+
************************************************************************/
|
| 6 |
+
|
| 7 |
+
#ifndef NCCL_H_
|
| 8 |
+
#define NCCL_H_
|
| 9 |
+
|
| 10 |
+
#include <cuda_runtime.h>
|
| 11 |
+
#include <cuda_fp16.h>
|
| 12 |
+
#if CUDART_VERSION >= 11000
|
| 13 |
+
#include <cuda_bf16.h>
|
| 14 |
+
#endif
|
| 15 |
+
|
| 16 |
+
#define NCCL_MAJOR 2
|
| 17 |
+
#define NCCL_MINOR 14
|
| 18 |
+
#define NCCL_PATCH 3
|
| 19 |
+
#define NCCL_SUFFIX ""
|
| 20 |
+
|
| 21 |
+
#define NCCL_VERSION_CODE 21403
|
| 22 |
+
#define NCCL_VERSION(X,Y,Z) (((X) <= 2 && (Y) <= 8) ? (X) * 1000 + (Y) * 100 + (Z) : (X) * 10000 + (Y) * 100 + (Z))
|
| 23 |
+
|
| 24 |
+
#ifdef __cplusplus
|
| 25 |
+
extern "C" {
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
/* Opaque handle to communicator */
|
| 29 |
+
typedef struct ncclComm* ncclComm_t;
|
| 30 |
+
|
| 31 |
+
#define NCCL_UNIQUE_ID_BYTES 128
|
| 32 |
+
typedef struct { char internal[NCCL_UNIQUE_ID_BYTES]; } ncclUniqueId;
|
| 33 |
+
|
| 34 |
+
/* Error type */
|
| 35 |
+
typedef enum { ncclSuccess = 0,
|
| 36 |
+
ncclUnhandledCudaError = 1,
|
| 37 |
+
ncclSystemError = 2,
|
| 38 |
+
ncclInternalError = 3,
|
| 39 |
+
ncclInvalidArgument = 4,
|
| 40 |
+
ncclInvalidUsage = 5,
|
| 41 |
+
ncclRemoteError = 6,
|
| 42 |
+
ncclInProgress = 7,
|
| 43 |
+
ncclNumResults = 8 } ncclResult_t;
|
| 44 |
+
|
| 45 |
+
/* Communicator configuration. Users can assign value to attributes to specify the
|
| 46 |
+
* behavior of a communicator. */
|
| 47 |
+
typedef struct ncclConfig_v21400 {
|
| 48 |
+
/* attributes that users should never touch. */
|
| 49 |
+
size_t size;
|
| 50 |
+
unsigned int magic;
|
| 51 |
+
unsigned int version;
|
| 52 |
+
/* attributes that users are able to customize. */
|
| 53 |
+
int blocking;
|
| 54 |
+
} ncclConfig_t;
|
| 55 |
+
|
| 56 |
+
/* Config initializer must be assigned to initialize config structure when it is created.
|
| 57 |
+
* Not initialized config will result in NCCL error. */
|
| 58 |
+
#define NCCL_CONFIG_INITIALIZER { \
|
| 59 |
+
sizeof(ncclConfig_t), /* size */ \
|
| 60 |
+
0xcafebeef, /* magic */ \
|
| 61 |
+
NCCL_VERSION(NCCL_MAJOR, NCCL_MINOR, NCCL_PATCH), /* version */ \
|
| 62 |
+
1 /* blocking */ \
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
/* Return the NCCL_VERSION_CODE of the NCCL library in the supplied integer.
|
| 66 |
+
* This integer is coded with the MAJOR, MINOR and PATCH level of the
|
| 67 |
+
* NCCL library
|
| 68 |
+
*/
|
| 69 |
+
ncclResult_t ncclGetVersion(int *version);
|
| 70 |
+
ncclResult_t pncclGetVersion(int *version);
|
| 71 |
+
|
| 72 |
+
/* Generates an Id to be used in ncclCommInitRank. ncclGetUniqueId should be
|
| 73 |
+
* called once and the Id should be distributed to all ranks in the
|
| 74 |
+
* communicator before calling ncclCommInitRank. */
|
| 75 |
+
ncclResult_t ncclGetUniqueId(ncclUniqueId* uniqueId);
|
| 76 |
+
ncclResult_t pncclGetUniqueId(ncclUniqueId* uniqueId);
|
| 77 |
+
|
| 78 |
+
/* Create a new communicator (multi thread/process version) with a configuration
|
| 79 |
+
* set by users. */
|
| 80 |
+
ncclResult_t ncclCommInitRankConfig(ncclComm_t* comm, int nranks, ncclUniqueId commId, int rank, ncclConfig_t* config);
|
| 81 |
+
ncclResult_t pncclCommInitRankConfig(ncclComm_t* comm, int nranks, ncclUniqueId commId, int rank, ncclConfig_t* config);
|
| 82 |
+
|
| 83 |
+
/* Creates a new communicator (multi thread/process version).
|
| 84 |
+
* rank must be between 0 and nranks-1 and unique within a communicator clique.
|
| 85 |
+
* Each rank is associated to a CUDA device, which has to be set before calling
|
| 86 |
+
* ncclCommInitRank.
|
| 87 |
+
* ncclCommInitRank implicitly syncronizes with other ranks, so it must be
|
| 88 |
+
* called by different threads/processes or use ncclGroupStart/ncclGroupEnd. */
|
| 89 |
+
ncclResult_t ncclCommInitRank(ncclComm_t* comm, int nranks, ncclUniqueId commId, int rank);
|
| 90 |
+
ncclResult_t pncclCommInitRank(ncclComm_t* comm, int nranks, ncclUniqueId commId, int rank);
|
| 91 |
+
|
| 92 |
+
/* Creates a clique of communicators (single process version).
|
| 93 |
+
* This is a convenience function to create a single-process communicator clique.
|
| 94 |
+
* Returns an array of ndev newly initialized communicators in comm.
|
| 95 |
+
* comm should be pre-allocated with size at least ndev*sizeof(ncclComm_t).
|
| 96 |
+
* If devlist is NULL, the first ndev CUDA devices are used.
|
| 97 |
+
* Order of devlist defines user-order of processors within the communicator. */
|
| 98 |
+
ncclResult_t ncclCommInitAll(ncclComm_t* comm, int ndev, const int* devlist);
|
| 99 |
+
ncclResult_t pncclCommInitAll(ncclComm_t* comm, int ndev, const int* devlist);
|
| 100 |
+
|
| 101 |
+
/* Finalize a communicator. ncclCommFinalize flushes all issued communications,
|
| 102 |
+
* and marks communicator state as ncclInProgress. The state will change to ncclSuccess
|
| 103 |
+
* when the communicator is globally quiescent and related resources are freed; then,
|
| 104 |
+
* calling ncclCommDestroy can locally free the rest of the resources (e.g. communicator
|
| 105 |
+
* itself) without blocking. */
|
| 106 |
+
ncclResult_t ncclCommFinalize(ncclComm_t comm);
|
| 107 |
+
ncclResult_t pncclCommFinalize(ncclComm_t comm);
|
| 108 |
+
|
| 109 |
+
/* Frees local resources associated with communicator object. */
|
| 110 |
+
ncclResult_t ncclCommDestroy(ncclComm_t comm);
|
| 111 |
+
ncclResult_t pncclCommDestroy(ncclComm_t comm);
|
| 112 |
+
|
| 113 |
+
/* Frees resources associated with communicator object and aborts any operations
|
| 114 |
+
* that might still be running on the device. */
|
| 115 |
+
ncclResult_t ncclCommAbort(ncclComm_t comm);
|
| 116 |
+
ncclResult_t pncclCommAbort(ncclComm_t comm);
|
| 117 |
+
|
| 118 |
+
/* Returns a string for each error code. */
|
| 119 |
+
const char* ncclGetErrorString(ncclResult_t result);
|
| 120 |
+
const char* pncclGetErrorString(ncclResult_t result);
|
| 121 |
+
|
| 122 |
+
/* Returns a human-readable message of the last error that occurred.
|
| 123 |
+
* comm is currently unused and can be set to NULL
|
| 124 |
+
*/
|
| 125 |
+
const char* ncclGetLastError(ncclComm_t comm);
|
| 126 |
+
const char* pncclGetError(ncclComm_t comm);
|
| 127 |
+
|
| 128 |
+
/* Checks whether the comm has encountered any asynchronous errors */
|
| 129 |
+
ncclResult_t ncclCommGetAsyncError(ncclComm_t comm, ncclResult_t *asyncError);
|
| 130 |
+
ncclResult_t pncclCommGetAsyncError(ncclComm_t comm, ncclResult_t *asyncError);
|
| 131 |
+
|
| 132 |
+
/* Gets the number of ranks in the communicator clique. */
|
| 133 |
+
ncclResult_t ncclCommCount(const ncclComm_t comm, int* count);
|
| 134 |
+
ncclResult_t pncclCommCount(const ncclComm_t comm, int* count);
|
| 135 |
+
|
| 136 |
+
/* Returns the cuda device number associated with the communicator. */
|
| 137 |
+
ncclResult_t ncclCommCuDevice(const ncclComm_t comm, int* device);
|
| 138 |
+
ncclResult_t pncclCommCuDevice(const ncclComm_t comm, int* device);
|
| 139 |
+
|
| 140 |
+
/* Returns the user-ordered "rank" associated with the communicator. */
|
| 141 |
+
ncclResult_t ncclCommUserRank(const ncclComm_t comm, int* rank);
|
| 142 |
+
ncclResult_t pncclCommUserRank(const ncclComm_t comm, int* rank);
|
| 143 |
+
|
| 144 |
+
/* Reduction operation selector */
|
| 145 |
+
typedef enum { ncclNumOps_dummy = 5 } ncclRedOp_dummy_t;
|
| 146 |
+
typedef enum { ncclSum = 0,
|
| 147 |
+
ncclProd = 1,
|
| 148 |
+
ncclMax = 2,
|
| 149 |
+
ncclMin = 3,
|
| 150 |
+
ncclAvg = 4,
|
| 151 |
+
/* ncclNumOps: The number of built-in ncclRedOp_t values. Also
|
| 152 |
+
* serves as the least possible value for dynamic ncclRedOp_t's
|
| 153 |
+
* as constructed by ncclRedOpCreate*** functions. */
|
| 154 |
+
ncclNumOps = 5,
|
| 155 |
+
/* ncclMaxRedOp: The largest valid value for ncclRedOp_t.
|
| 156 |
+
* It is defined to be the largest signed value (since compilers
|
| 157 |
+
* are permitted to use signed enums) that won't grow
|
| 158 |
+
* sizeof(ncclRedOp_t) when compared to previous NCCL versions to
|
| 159 |
+
* maintain ABI compatibility. */
|
| 160 |
+
ncclMaxRedOp = 0x7fffffff>>(32-8*sizeof(ncclRedOp_dummy_t))
|
| 161 |
+
} ncclRedOp_t;
|
| 162 |
+
|
| 163 |
+
/* Data types */
|
| 164 |
+
typedef enum { ncclInt8 = 0, ncclChar = 0,
|
| 165 |
+
ncclUint8 = 1,
|
| 166 |
+
ncclInt32 = 2, ncclInt = 2,
|
| 167 |
+
ncclUint32 = 3,
|
| 168 |
+
ncclInt64 = 4,
|
| 169 |
+
ncclUint64 = 5,
|
| 170 |
+
ncclFloat16 = 6, ncclHalf = 6,
|
| 171 |
+
ncclFloat32 = 7, ncclFloat = 7,
|
| 172 |
+
ncclFloat64 = 8, ncclDouble = 8,
|
| 173 |
+
#if defined(__CUDA_BF16_TYPES_EXIST__)
|
| 174 |
+
ncclBfloat16 = 9,
|
| 175 |
+
ncclNumTypes = 10
|
| 176 |
+
#else
|
| 177 |
+
ncclNumTypes = 9
|
| 178 |
+
#endif
|
| 179 |
+
} ncclDataType_t;
|
| 180 |
+
|
| 181 |
+
/* ncclScalarResidence_t: Location and dereferencing logic for scalar arguments. */
|
| 182 |
+
typedef enum {
|
| 183 |
+
/* ncclScalarDevice: The scalar is in device-visible memory and will be
|
| 184 |
+
* dereferenced while the collective is running. */
|
| 185 |
+
ncclScalarDevice = 0,
|
| 186 |
+
|
| 187 |
+
/* ncclScalarHostImmediate: The scalar is in host-visible memory and will be
|
| 188 |
+
* dereferenced before the ncclRedOpCreate***() function returns. */
|
| 189 |
+
ncclScalarHostImmediate = 1
|
| 190 |
+
} ncclScalarResidence_t;
|
| 191 |
+
|
| 192 |
+
/*
|
| 193 |
+
* ncclRedOpCreatePreMulSum
|
| 194 |
+
*
|
| 195 |
+
* Creates a new reduction operator which pre-multiplies input values by a given
|
| 196 |
+
* scalar locally before reducing them with peer values via summation. For use
|
| 197 |
+
* only with collectives launched against *comm* and *datatype*. The
|
| 198 |
+
* *residence* argument indicates how/when the memory pointed to by *scalar*
|
| 199 |
+
* will be dereferenced. Upon return, the newly created operator's handle
|
| 200 |
+
* is stored in *op*.
|
| 201 |
+
*/
|
| 202 |
+
ncclResult_t ncclRedOpCreatePreMulSum(ncclRedOp_t *op, void *scalar, ncclDataType_t datatype, ncclScalarResidence_t residence, ncclComm_t comm);
|
| 203 |
+
ncclResult_t pncclRedOpCreatePreMulSum(ncclRedOp_t *op, void *scalar, ncclDataType_t datatype, ncclScalarResidence_t residence, ncclComm_t comm);
|
| 204 |
+
|
| 205 |
+
/*
|
| 206 |
+
* ncclRedOpDestroy
|
| 207 |
+
*
|
| 208 |
+
* Destroys the reduction operator *op*. The operator must have been created by
|
| 209 |
+
* ncclRedOpCreatePreMul with the matching communicator *comm*. An operator may be
|
| 210 |
+
* destroyed as soon as the last NCCL function which is given that operator returns.
|
| 211 |
+
*/
|
| 212 |
+
ncclResult_t ncclRedOpDestroy(ncclRedOp_t op, ncclComm_t comm);
|
| 213 |
+
ncclResult_t pncclRedOpDestroy(ncclRedOp_t op, ncclComm_t comm);
|
| 214 |
+
|
| 215 |
+
/*
|
| 216 |
+
* Collective communication operations
|
| 217 |
+
*
|
| 218 |
+
* Collective communication operations must be called separately for each
|
| 219 |
+
* communicator in a communicator clique.
|
| 220 |
+
*
|
| 221 |
+
* They return when operations have been enqueued on the CUDA stream.
|
| 222 |
+
*
|
| 223 |
+
* Since they may perform inter-CPU synchronization, each call has to be done
|
| 224 |
+
* from a different thread or process, or need to use Group Semantics (see
|
| 225 |
+
* below).
|
| 226 |
+
*/
|
| 227 |
+
|
| 228 |
+
/*
|
| 229 |
+
* Reduce
|
| 230 |
+
*
|
| 231 |
+
* Reduces data arrays of length count in sendbuff into recvbuff using op
|
| 232 |
+
* operation.
|
| 233 |
+
* recvbuff may be NULL on all calls except for root device.
|
| 234 |
+
* root is the rank (not the CUDA device) where data will reside after the
|
| 235 |
+
* operation is complete.
|
| 236 |
+
*
|
| 237 |
+
* In-place operation will happen if sendbuff == recvbuff.
|
| 238 |
+
*/
|
| 239 |
+
ncclResult_t ncclReduce(const void* sendbuff, void* recvbuff, size_t count, ncclDataType_t datatype,
|
| 240 |
+
ncclRedOp_t op, int root, ncclComm_t comm, cudaStream_t stream);
|
| 241 |
+
ncclResult_t pncclReduce(const void* sendbuff, void* recvbuff, size_t count, ncclDataType_t datatype,
|
| 242 |
+
ncclRedOp_t op, int root, ncclComm_t comm, cudaStream_t stream);
|
| 243 |
+
|
| 244 |
+
/*
|
| 245 |
+
* (deprecated) Broadcast (in-place)
|
| 246 |
+
*
|
| 247 |
+
* Copies count values from root to all other devices.
|
| 248 |
+
* root is the rank (not the CUDA device) where data resides before the
|
| 249 |
+
* operation is started.
|
| 250 |
+
*
|
| 251 |
+
* This operation is implicitely in place.
|
| 252 |
+
*/
|
| 253 |
+
ncclResult_t ncclBcast(void* buff, size_t count, ncclDataType_t datatype, int root,
|
| 254 |
+
ncclComm_t comm, cudaStream_t stream);
|
| 255 |
+
ncclResult_t pncclBcast(void* buff, size_t count, ncclDataType_t datatype, int root,
|
| 256 |
+
ncclComm_t comm, cudaStream_t stream);
|
| 257 |
+
|
| 258 |
+
/*
|
| 259 |
+
* Broadcast
|
| 260 |
+
*
|
| 261 |
+
* Copies count values from root to all other devices.
|
| 262 |
+
* root is the rank (not the CUDA device) where data resides before the
|
| 263 |
+
* operation is started.
|
| 264 |
+
*
|
| 265 |
+
* In-place operation will happen if sendbuff == recvbuff.
|
| 266 |
+
*/
|
| 267 |
+
ncclResult_t ncclBroadcast(const void* sendbuff, void* recvbuff, size_t count, ncclDataType_t datatype, int root,
|
| 268 |
+
ncclComm_t comm, cudaStream_t stream);
|
| 269 |
+
ncclResult_t pncclBroadcast(const void* sendbuff, void* recvbuff, size_t count, ncclDataType_t datatype, int root,
|
| 270 |
+
ncclComm_t comm, cudaStream_t stream);
|
| 271 |
+
|
| 272 |
+
/*
|
| 273 |
+
* All-Reduce
|
| 274 |
+
*
|
| 275 |
+
* Reduces data arrays of length count in sendbuff using op operation, and
|
| 276 |
+
* leaves identical copies of result on each recvbuff.
|
| 277 |
+
*
|
| 278 |
+
* In-place operation will happen if sendbuff == recvbuff.
|
| 279 |
+
*/
|
| 280 |
+
ncclResult_t ncclAllReduce(const void* sendbuff, void* recvbuff, size_t count,
|
| 281 |
+
ncclDataType_t datatype, ncclRedOp_t op, ncclComm_t comm, cudaStream_t stream);
|
| 282 |
+
ncclResult_t pncclAllReduce(const void* sendbuff, void* recvbuff, size_t count,
|
| 283 |
+
ncclDataType_t datatype, ncclRedOp_t op, ncclComm_t comm, cudaStream_t stream);
|
| 284 |
+
|
| 285 |
+
/*
|
| 286 |
+
* Reduce-Scatter
|
| 287 |
+
*
|
| 288 |
+
* Reduces data in sendbuff using op operation and leaves reduced result
|
| 289 |
+
* scattered over the devices so that recvbuff on rank i will contain the i-th
|
| 290 |
+
* block of the result.
|
| 291 |
+
* Assumes sendcount is equal to nranks*recvcount, which means that sendbuff
|
| 292 |
+
* should have a size of at least nranks*recvcount elements.
|
| 293 |
+
*
|
| 294 |
+
* In-place operations will happen if recvbuff == sendbuff + rank * recvcount.
|
| 295 |
+
*/
|
| 296 |
+
ncclResult_t ncclReduceScatter(const void* sendbuff, void* recvbuff,
|
| 297 |
+
size_t recvcount, ncclDataType_t datatype, ncclRedOp_t op, ncclComm_t comm,
|
| 298 |
+
cudaStream_t stream);
|
| 299 |
+
ncclResult_t pncclReduceScatter(const void* sendbuff, void* recvbuff,
|
| 300 |
+
size_t recvcount, ncclDataType_t datatype, ncclRedOp_t op, ncclComm_t comm,
|
| 301 |
+
cudaStream_t stream);
|
| 302 |
+
|
| 303 |
+
/*
|
| 304 |
+
* All-Gather
|
| 305 |
+
*
|
| 306 |
+
* Each device gathers sendcount values from other GPUs into recvbuff,
|
| 307 |
+
* receiving data from rank i at offset i*sendcount.
|
| 308 |
+
* Assumes recvcount is equal to nranks*sendcount, which means that recvbuff
|
| 309 |
+
* should have a size of at least nranks*sendcount elements.
|
| 310 |
+
*
|
| 311 |
+
* In-place operations will happen if sendbuff == recvbuff + rank * sendcount.
|
| 312 |
+
*/
|
| 313 |
+
ncclResult_t ncclAllGather(const void* sendbuff, void* recvbuff, size_t sendcount,
|
| 314 |
+
ncclDataType_t datatype, ncclComm_t comm, cudaStream_t stream);
|
| 315 |
+
ncclResult_t pncclAllGather(const void* sendbuff, void* recvbuff, size_t sendcount,
|
| 316 |
+
ncclDataType_t datatype, ncclComm_t comm, cudaStream_t stream);
|
| 317 |
+
|
| 318 |
+
/*
|
| 319 |
+
* Send
|
| 320 |
+
*
|
| 321 |
+
* Send data from sendbuff to rank peer.
|
| 322 |
+
*
|
| 323 |
+
* Rank peer needs to call ncclRecv with the same datatype and the same count from this
|
| 324 |
+
* rank.
|
| 325 |
+
*
|
| 326 |
+
* This operation is blocking for the GPU. If multiple ncclSend and ncclRecv operations
|
| 327 |
+
* need to progress concurrently to complete, they must be fused within a ncclGroupStart/
|
| 328 |
+
* ncclGroupEnd section.
|
| 329 |
+
*/
|
| 330 |
+
ncclResult_t ncclSend(const void* sendbuff, size_t count, ncclDataType_t datatype, int peer,
|
| 331 |
+
ncclComm_t comm, cudaStream_t stream);
|
| 332 |
+
ncclResult_t pncclSend(const void* sendbuff, size_t count, ncclDataType_t datatype, int peer,
|
| 333 |
+
ncclComm_t comm, cudaStream_t stream);
|
| 334 |
+
|
| 335 |
+
/*
|
| 336 |
+
* Receive
|
| 337 |
+
*
|
| 338 |
+
* Receive data from rank peer into recvbuff.
|
| 339 |
+
*
|
| 340 |
+
* Rank peer needs to call ncclSend with the same datatype and the same count to this
|
| 341 |
+
* rank.
|
| 342 |
+
*
|
| 343 |
+
* This operation is blocking for the GPU. If multiple ncclSend and ncclRecv operations
|
| 344 |
+
* need to progress concurrently to complete, they must be fused within a ncclGroupStart/
|
| 345 |
+
* ncclGroupEnd section.
|
| 346 |
+
*/
|
| 347 |
+
ncclResult_t pncclRecv(void* recvbuff, size_t count, ncclDataType_t datatype, int peer,
|
| 348 |
+
ncclComm_t comm, cudaStream_t stream);
|
| 349 |
+
ncclResult_t ncclRecv(void* recvbuff, size_t count, ncclDataType_t datatype, int peer,
|
| 350 |
+
ncclComm_t comm, cudaStream_t stream);
|
| 351 |
+
|
| 352 |
+
/*
|
| 353 |
+
* Group semantics
|
| 354 |
+
*
|
| 355 |
+
* When managing multiple GPUs from a single thread, and since NCCL collective
|
| 356 |
+
* calls may perform inter-CPU synchronization, we need to "group" calls for
|
| 357 |
+
* different ranks/devices into a single call.
|
| 358 |
+
*
|
| 359 |
+
* Grouping NCCL calls as being part of the same collective operation is done
|
| 360 |
+
* using ncclGroupStart and ncclGroupEnd. ncclGroupStart will enqueue all
|
| 361 |
+
* collective calls until the ncclGroupEnd call, which will wait for all calls
|
| 362 |
+
* to be complete. Note that for collective communication, ncclGroupEnd only
|
| 363 |
+
* guarantees that the operations are enqueued on the streams, not that
|
| 364 |
+
* the operation is effectively done.
|
| 365 |
+
*
|
| 366 |
+
* Both collective communication and ncclCommInitRank can be used in conjunction
|
| 367 |
+
* of ncclGroupStart/ncclGroupEnd, but not together.
|
| 368 |
+
*
|
| 369 |
+
* Group semantics also allow to fuse multiple operations on the same device
|
| 370 |
+
* to improve performance (for aggregated collective calls), or to permit
|
| 371 |
+
* concurrent progress of multiple send/receive operations.
|
| 372 |
+
*/
|
| 373 |
+
|
| 374 |
+
/*
|
| 375 |
+
* Group Start
|
| 376 |
+
*
|
| 377 |
+
* Start a group call. All calls to NCCL until ncclGroupEnd will be fused into
|
| 378 |
+
* a single NCCL operation. Nothing will be started on the CUDA stream until
|
| 379 |
+
* ncclGroupEnd.
|
| 380 |
+
*/
|
| 381 |
+
ncclResult_t ncclGroupStart();
|
| 382 |
+
ncclResult_t pncclGroupStart();
|
| 383 |
+
|
| 384 |
+
/*
|
| 385 |
+
* Group End
|
| 386 |
+
*
|
| 387 |
+
* End a group call. Start a fused NCCL operation consisting of all calls since
|
| 388 |
+
* ncclGroupStart. Operations on the CUDA stream depending on the NCCL operations
|
| 389 |
+
* need to be called after ncclGroupEnd.
|
| 390 |
+
*/
|
| 391 |
+
ncclResult_t ncclGroupEnd();
|
| 392 |
+
ncclResult_t pncclGroupEnd();
|
| 393 |
+
|
| 394 |
+
#ifdef __cplusplus
|
| 395 |
+
} // end extern "C"
|
| 396 |
+
#endif
|
| 397 |
+
|
| 398 |
+
#endif // end include guard
|
wemm/lib/python3.10/site-packages/nvidia/nccl/include/nccl_net.h
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*************************************************************************
|
| 2 |
+
* Copyright (c) 2017-2022, NVIDIA CORPORATION. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* See LICENSE.txt for license information
|
| 5 |
+
************************************************************************/
|
| 6 |
+
|
| 7 |
+
#ifndef NCCL_NET_H_
|
| 8 |
+
#define NCCL_NET_H_
|
| 9 |
+
|
| 10 |
+
#include "nccl.h"
|
| 11 |
+
#include <stdint.h>
|
| 12 |
+
|
| 13 |
+
#define NCCL_NET_HANDLE_MAXSIZE 128
|
| 14 |
+
|
| 15 |
+
#define NCCL_PTR_HOST 0x1
|
| 16 |
+
#define NCCL_PTR_CUDA 0x2
|
| 17 |
+
#define NCCL_PTR_DMABUF 0x4
|
| 18 |
+
|
| 19 |
+
// Maximum number of requests per comm object
|
| 20 |
+
#define NCCL_NET_MAX_REQUESTS 8
|
| 21 |
+
|
| 22 |
+
typedef enum {NCCL_LOG_NONE=0, NCCL_LOG_VERSION=1, NCCL_LOG_WARN=2, NCCL_LOG_INFO=3, NCCL_LOG_ABORT=4, NCCL_LOG_TRACE=5} ncclDebugLogLevel;
|
| 23 |
+
typedef enum {NCCL_INIT=1, NCCL_COLL=2, NCCL_P2P=4, NCCL_SHM=8, NCCL_NET=16, NCCL_GRAPH=32, NCCL_TUNING=64, NCCL_ENV=128, NCCL_ALLOC=256, NCCL_CALL=512, NCCL_ALL=~0} ncclDebugLogSubSys;
|
| 24 |
+
|
| 25 |
+
typedef void (*ncclDebugLogger_t)(ncclDebugLogLevel level, unsigned long flags, const char *file, int line, const char *fmt, ...);
|
| 26 |
+
|
| 27 |
+
typedef struct {
|
| 28 |
+
char* name; // Used mostly for logging.
|
| 29 |
+
char* pciPath; // Path to the PCI device in /sys.
|
| 30 |
+
uint64_t guid; // Unique identifier for the NIC chip. Important for
|
| 31 |
+
// cards with multiple PCI functions (Physical or virtual).
|
| 32 |
+
int ptrSupport; // [NCCL_PTR_HOST|NCCL_PTR_CUDA|NCCL_PTR_DMABUF]
|
| 33 |
+
int speed; // Port speed in Mbps.
|
| 34 |
+
int port; // Port number.
|
| 35 |
+
float latency; // Network latency
|
| 36 |
+
int maxComms; // Maximum number of comms we can create
|
| 37 |
+
int maxRecvs; // Maximum number of grouped receives.
|
| 38 |
+
}ncclNetProperties_v6_t;
|
| 39 |
+
|
| 40 |
+
typedef ncclNetProperties_v6_t ncclNetProperties_t;
|
| 41 |
+
|
| 42 |
+
typedef struct {
|
| 43 |
+
// Name of the network (mainly for logs)
|
| 44 |
+
const char* name;
|
| 45 |
+
// Initialize the network.
|
| 46 |
+
ncclResult_t (*init)(ncclDebugLogger_t logFunction);
|
| 47 |
+
// Return the number of adapters.
|
| 48 |
+
ncclResult_t (*devices)(int* ndev);
|
| 49 |
+
// Get various device properties.
|
| 50 |
+
ncclResult_t (*getProperties)(int dev, ncclNetProperties_v6_t* props);
|
| 51 |
+
// Create a receiving object and provide a handle to connect to it. The
|
| 52 |
+
// handle can be up to NCCL_NET_HANDLE_MAXSIZE bytes and will be exchanged
|
| 53 |
+
// between ranks to create a connection.
|
| 54 |
+
ncclResult_t (*listen)(int dev, void* handle, void** listenComm);
|
| 55 |
+
// Connect to a handle and return a sending comm object for that peer.
|
| 56 |
+
// This call must not block for the connection to be established, and instead
|
| 57 |
+
// should return successfully with sendComm == NULL with the expectation that
|
| 58 |
+
// it will be called again until sendComm != NULL.
|
| 59 |
+
ncclResult_t (*connect)(int dev, void* handle, void** sendComm);
|
| 60 |
+
// Finalize connection establishment after remote peer has called connect.
|
| 61 |
+
// This call must not block for the connection to be established, and instead
|
| 62 |
+
// should return successfully with recvComm == NULL with the expectation that
|
| 63 |
+
// it will be called again until recvComm != NULL.
|
| 64 |
+
ncclResult_t (*accept)(void* listenComm, void** recvComm);
|
| 65 |
+
// Register/Deregister memory. Comm can be either a sendComm or a recvComm.
|
| 66 |
+
// Type is either NCCL_PTR_HOST or NCCL_PTR_CUDA.
|
| 67 |
+
ncclResult_t (*regMr)(void* comm, void* data, int size, int type, void** mhandle);
|
| 68 |
+
/* DMA-BUF support */
|
| 69 |
+
ncclResult_t (*regMrDmaBuf)(void* comm, void* data, size_t size, int type, uint64_t offset, int fd, void** mhandle);
|
| 70 |
+
ncclResult_t (*deregMr)(void* comm, void* mhandle);
|
| 71 |
+
// Asynchronous send to a peer.
|
| 72 |
+
// May return request == NULL if the call cannot be performed (or would block)
|
| 73 |
+
ncclResult_t (*isend)(void* sendComm, void* data, int size, int tag, void* mhandle, void** request);
|
| 74 |
+
// Asynchronous recv from a peer.
|
| 75 |
+
// May return request == NULL if the call cannot be performed (or would block)
|
| 76 |
+
ncclResult_t (*irecv)(void* recvComm, int n, void** data, int* sizes, int* tags, void** mhandles, void** request);
|
| 77 |
+
// Perform a flush/fence to make sure all data received with NCCL_PTR_CUDA is
|
| 78 |
+
// visible to the GPU
|
| 79 |
+
ncclResult_t (*iflush)(void* recvComm, int n, void** data, int* sizes, void** mhandles, void** request);
|
| 80 |
+
// Test whether a request is complete. If size is not NULL, it returns the
|
| 81 |
+
// number of bytes sent/received.
|
| 82 |
+
ncclResult_t (*test)(void* request, int* done, int* sizes);
|
| 83 |
+
// Close and free send/recv comm objects
|
| 84 |
+
ncclResult_t (*closeSend)(void* sendComm);
|
| 85 |
+
ncclResult_t (*closeRecv)(void* recvComm);
|
| 86 |
+
ncclResult_t (*closeListen)(void* listenComm);
|
| 87 |
+
} ncclNet_v6_t;
|
| 88 |
+
|
| 89 |
+
typedef ncclNet_v6_t ncclNet_t;
|
| 90 |
+
|
| 91 |
+
#define NCCL_PLUGIN_SYMBOL ncclNetPlugin_v6
|
| 92 |
+
|
| 93 |
+
typedef struct {
|
| 94 |
+
// Name of the collective network (mainly for logs)
|
| 95 |
+
const char* name;
|
| 96 |
+
// Initialize the collective network.
|
| 97 |
+
ncclResult_t (*init)(ncclDebugLogger_t logFunction);
|
| 98 |
+
// Return the number of adapters capable of doing collective operations.
|
| 99 |
+
// If ndev returns 0, all other functions might be set to NULL.
|
| 100 |
+
ncclResult_t (*devices)(int* ndev);
|
| 101 |
+
// Get various device properties.
|
| 102 |
+
ncclResult_t (*getProperties)(int dev, ncclNetProperties_v6_t* props);
|
| 103 |
+
// Create a receiving object and provide a handle to connect to it. The
|
| 104 |
+
// handle can be up to NCCL_NET_HANDLE_MAXSIZE bytes and will be exchanged
|
| 105 |
+
// between ranks to create connections.
|
| 106 |
+
ncclResult_t (*listen)(int dev, void* handle, void** listenComm);
|
| 107 |
+
// Create a group for collective operations. handles have been created
|
| 108 |
+
// using listen() above. rank indicates caller's rank in the collective network.
|
| 109 |
+
ncclResult_t (*connect)(void* handles[], int nranks, int rank, void* listenComm, void** collComm);
|
| 110 |
+
// Returns whether a reduction operation on a data type is supported.
|
| 111 |
+
// 1 for supported, 0 otherwise.
|
| 112 |
+
ncclResult_t (*reduceSupport)(ncclDataType_t dataType, ncclRedOp_t redOp, int* supported);
|
| 113 |
+
// Register/Deregister memory. Type is either NCCL_PTR_HOST or NCCL_PTR_CUDA.
|
| 114 |
+
ncclResult_t (*regMr)(void* collComm, void* data, int size, int type, void** mhandle);
|
| 115 |
+
/* DMA-BUF support */
|
| 116 |
+
ncclResult_t (*regMrDmaBuf)(void* collComm, void* data, size_t size, int type, uint64_t offset, int fd, void** mhandle);
|
| 117 |
+
ncclResult_t (*deregMr)(void* collComm, void* mhandle);
|
| 118 |
+
// Performs an asynchronous allreduce operation on the collective group.
|
| 119 |
+
// May return request == NULL if the call cannot be performed (or would block).
|
| 120 |
+
ncclResult_t (*iallreduce)(void* collComm, void* sendData, void* recvData, int count,
|
| 121 |
+
ncclDataType_t dataType, ncclRedOp_t redOp, void* sendMhandle, void* recvMhandle, void** request);
|
| 122 |
+
// Perform a flush/fence to make sure all data received with NCCL_PTR_CUDA is
|
| 123 |
+
// visible to the GPU
|
| 124 |
+
ncclResult_t (*iflush)(void* collComm, void* data, int size, void* mhandle, void** request);
|
| 125 |
+
// Test whether a request is complete. If size is not NULL, it returns the
|
| 126 |
+
// number of bytes sent/received.
|
| 127 |
+
ncclResult_t (*test)(void* request, int* done, int* size);
|
| 128 |
+
// Close and free collective comm objects
|
| 129 |
+
ncclResult_t (*closeColl)(void* collComm);
|
| 130 |
+
ncclResult_t (*closeListen)(void* listenComm);
|
| 131 |
+
} ncclCollNet_v6_t;
|
| 132 |
+
|
| 133 |
+
typedef ncclCollNet_v6_t ncclCollNet_t;
|
| 134 |
+
|
| 135 |
+
#define NCCL_COLLNET_PLUGIN_SYMBOL ncclCollNetPlugin_v6
|
| 136 |
+
|
| 137 |
+
// v5 struct for backwards compatibility
|
| 138 |
+
typedef struct {
|
| 139 |
+
// Name of the network (mainly for logs)
|
| 140 |
+
const char* name;
|
| 141 |
+
// Initialize the network.
|
| 142 |
+
ncclResult_t (*init)(ncclDebugLogger_t logFunction);
|
| 143 |
+
// Return the number of adapters.
|
| 144 |
+
ncclResult_t (*devices)(int* ndev);
|
| 145 |
+
// Get various device properties.
|
| 146 |
+
ncclResult_t (*getProperties)(int dev, ncclNetProperties_v6_t* props);
|
| 147 |
+
// Create a receiving object and provide a handle to connect to it. The
|
| 148 |
+
// handle can be up to NCCL_NET_HANDLE_MAXSIZE bytes and will be exchanged
|
| 149 |
+
// between ranks to create a connection.
|
| 150 |
+
ncclResult_t (*listen)(int dev, void* handle, void** listenComm);
|
| 151 |
+
// Connect to a handle and return a sending comm object for that peer.
|
| 152 |
+
// This call must not block for the connection to be established, and instead
|
| 153 |
+
// should return successfully with sendComm == NULL with the expectation that
|
| 154 |
+
// it will be called again until sendComm != NULL.
|
| 155 |
+
ncclResult_t (*connect)(int dev, void* handle, void** sendComm);
|
| 156 |
+
// Finalize connection establishment after remote peer has called connect.
|
| 157 |
+
// This call must not block for the connection to be established, and instead
|
| 158 |
+
// should return successfully with recvComm == NULL with the expectation that
|
| 159 |
+
// it will be called again until recvComm != NULL.
|
| 160 |
+
ncclResult_t (*accept)(void* listenComm, void** recvComm);
|
| 161 |
+
// Register/Deregister memory. Comm can be either a sendComm or a recvComm.
|
| 162 |
+
// Type is either NCCL_PTR_HOST or NCCL_PTR_CUDA.
|
| 163 |
+
ncclResult_t (*regMr)(void* comm, void* data, int size, int type, void** mhandle);
|
| 164 |
+
ncclResult_t (*deregMr)(void* comm, void* mhandle);
|
| 165 |
+
// Asynchronous send to a peer.
|
| 166 |
+
// May return request == NULL if the call cannot be performed (or would block)
|
| 167 |
+
ncclResult_t (*isend)(void* sendComm, void* data, int size, int tag, void* mhandle, void** request);
|
| 168 |
+
// Asynchronous recv from a peer.
|
| 169 |
+
// May return request == NULL if the call cannot be performed (or would block)
|
| 170 |
+
ncclResult_t (*irecv)(void* recvComm, int n, void** data, int* sizes, int* tags, void** mhandles, void** request);
|
| 171 |
+
// Perform a flush/fence to make sure all data received with NCCL_PTR_CUDA is
|
| 172 |
+
// visible to the GPU
|
| 173 |
+
ncclResult_t (*iflush)(void* recvComm, int n, void** data, int* sizes, void** mhandles, void** request);
|
| 174 |
+
// Test whether a request is complete. If size is not NULL, it returns the
|
| 175 |
+
// number of bytes sent/received.
|
| 176 |
+
ncclResult_t (*test)(void* request, int* done, int* sizes);
|
| 177 |
+
// Close and free send/recv comm objects
|
| 178 |
+
ncclResult_t (*closeSend)(void* sendComm);
|
| 179 |
+
ncclResult_t (*closeRecv)(void* recvComm);
|
| 180 |
+
ncclResult_t (*closeListen)(void* listenComm);
|
| 181 |
+
} ncclNet_v5_t;
|
| 182 |
+
|
| 183 |
+
// v5 struct for backwards compatibility
|
| 184 |
+
typedef struct {
|
| 185 |
+
// Name of the collective network (mainly for logs)
|
| 186 |
+
const char* name;
|
| 187 |
+
// Initialize the collective network.
|
| 188 |
+
ncclResult_t (*init)(ncclDebugLogger_t logFunction);
|
| 189 |
+
// Return the number of adapters capable of doing collective operations.
|
| 190 |
+
// If ndev returns 0, all other functions might be set to NULL.
|
| 191 |
+
ncclResult_t (*devices)(int* ndev);
|
| 192 |
+
// Get various device properties.
|
| 193 |
+
ncclResult_t (*getProperties)(int dev, ncclNetProperties_v6_t* props);
|
| 194 |
+
// Create a receiving object and provide a handle to connect to it. The
|
| 195 |
+
// handle can be up to NCCL_NET_HANDLE_MAXSIZE bytes and will be exchanged
|
| 196 |
+
// between ranks to create connections.
|
| 197 |
+
ncclResult_t (*listen)(int dev, void* handle, void** listenComm);
|
| 198 |
+
// Create a group for collective operations. handles have been created
|
| 199 |
+
// using listen() above. rank indicates caller's rank in the collective network.
|
| 200 |
+
ncclResult_t (*connect)(void* handles[], int nranks, int rank, void* listenComm, void** collComm);
|
| 201 |
+
// Returns whether a reduction operation on a data type is supported.
|
| 202 |
+
// 1 for supported, 0 otherwise.
|
| 203 |
+
ncclResult_t (*reduceSupport)(ncclDataType_t dataType, ncclRedOp_t redOp, int* supported);
|
| 204 |
+
// Register/Deregister memory. Type is either NCCL_PTR_HOST or NCCL_PTR_CUDA.
|
| 205 |
+
ncclResult_t (*regMr)(void* collComm, void* data, int size, int type, void** mhandle);
|
| 206 |
+
ncclResult_t (*deregMr)(void* collComm, void* mhandle);
|
| 207 |
+
// Performs an asynchronous allreduce operation on the collective group.
|
| 208 |
+
// May return request == NULL if the call cannot be performed (or would block).
|
| 209 |
+
ncclResult_t (*iallreduce)(void* collComm, void* sendData, void* recvData, int count,
|
| 210 |
+
ncclDataType_t dataType, ncclRedOp_t redOp, void* sendMhandle, void* recvMhandle, void** request);
|
| 211 |
+
// Perform a flush/fence to make sure all data received with NCCL_PTR_CUDA is
|
| 212 |
+
// visible to the GPU
|
| 213 |
+
ncclResult_t (*iflush)(void* collComm, void* data, int size, void* mhandle, void** request);
|
| 214 |
+
// Test whether a request is complete. If size is not NULL, it returns the
|
| 215 |
+
// number of bytes sent/received.
|
| 216 |
+
ncclResult_t (*test)(void* request, int* done, int* size);
|
| 217 |
+
// Close and free collective comm objects
|
| 218 |
+
ncclResult_t (*closeColl)(void* collComm);
|
| 219 |
+
ncclResult_t (*closeListen)(void* listenComm);
|
| 220 |
+
} ncclCollNet_v5_t;
|
| 221 |
+
|
| 222 |
+
// v4 struct for backwards compatibility
|
| 223 |
+
typedef struct {
|
| 224 |
+
char* name; // Used mostly for logging.
|
| 225 |
+
char* pciPath; // Path to the PCI device in /sys.
|
| 226 |
+
uint64_t guid; // Unique identifier for the NIC chip. Important for
|
| 227 |
+
// cards with multiple PCI functions (Physical or virtual).
|
| 228 |
+
int ptrSupport; // NCCL_PTR_HOST or NCCL_PTR_HOST|NCCL_PTR_CUDA
|
| 229 |
+
int speed; // Port speed in Mbps.
|
| 230 |
+
int port; // Port number.
|
| 231 |
+
int maxComms; // Maximum number of comms we can create
|
| 232 |
+
} ncclNetProperties_v4_t;
|
| 233 |
+
|
| 234 |
+
// v4 struct for backwards compatibility
|
| 235 |
+
typedef struct {
|
| 236 |
+
// Name of the network (mainly for logs)
|
| 237 |
+
const char* name;
|
| 238 |
+
// Initialize the network.
|
| 239 |
+
ncclResult_t (*init)(ncclDebugLogger_t logFunction);
|
| 240 |
+
// Return the number of adapters.
|
| 241 |
+
ncclResult_t (*devices)(int* ndev);
|
| 242 |
+
// Get various device properties.
|
| 243 |
+
ncclResult_t (*getProperties)(int dev, ncclNetProperties_v4_t* props);
|
| 244 |
+
// Create a receiving object and provide a handle to connect to it. The
|
| 245 |
+
// handle can be up to NCCL_NET_HANDLE_MAXSIZE bytes and will be exchanged
|
| 246 |
+
// between ranks to create a connection.
|
| 247 |
+
ncclResult_t (*listen)(int dev, void* handle, void** listenComm);
|
| 248 |
+
// Connect to a handle and return a sending comm object for that peer.
|
| 249 |
+
ncclResult_t (*connect)(int dev, void* handle, void** sendComm);
|
| 250 |
+
// Finalize connection establishment after remote peer has called connectHandle
|
| 251 |
+
ncclResult_t (*accept)(void* listenComm, void** recvComm);
|
| 252 |
+
// Register/Deregister memory. Comm can be either a sendComm or a recvComm.
|
| 253 |
+
// Type is either NCCL_PTR_HOST or NCCL_PTR_CUDA.
|
| 254 |
+
ncclResult_t (*regMr)(void* comm, void* data, int size, int type, void** mhandle);
|
| 255 |
+
ncclResult_t (*deregMr)(void* comm, void* mhandle);
|
| 256 |
+
// Asynchronous send to a peer.
|
| 257 |
+
// May return request == NULL if the call cannot be performed (or would block)
|
| 258 |
+
ncclResult_t (*isend)(void* sendComm, void* data, int size, void* mhandle, void** request);
|
| 259 |
+
// Asynchronous recv from a peer.
|
| 260 |
+
// May return request == NULL if the call cannot be performed (or would block)
|
| 261 |
+
ncclResult_t (*irecv)(void* recvComm, void* data, int size, void* mhandle, void** request);
|
| 262 |
+
// Perform a flush/fence to make sure all data received with NCCL_PTR_CUDA is
|
| 263 |
+
// visible to the GPU
|
| 264 |
+
ncclResult_t (*iflush)(void* recvComm, void* data, int size, void* mhandle, void** request);
|
| 265 |
+
// Test whether a request is complete. If size is not NULL, it returns the
|
| 266 |
+
// number of bytes sent/received.
|
| 267 |
+
ncclResult_t (*test)(void* request, int* done, int* size);
|
| 268 |
+
// Close and free send/recv comm objects
|
| 269 |
+
ncclResult_t (*closeSend)(void* sendComm);
|
| 270 |
+
ncclResult_t (*closeRecv)(void* recvComm);
|
| 271 |
+
ncclResult_t (*closeListen)(void* listenComm);
|
| 272 |
+
} ncclNet_v4_t;
|
| 273 |
+
|
| 274 |
+
// v4 struct for backwards compatibility
|
| 275 |
+
typedef struct {
|
| 276 |
+
// Name of the collective network (mainly for logs)
|
| 277 |
+
const char* name;
|
| 278 |
+
// Initialize the collective network.
|
| 279 |
+
ncclResult_t (*init)(ncclDebugLogger_t logFunction);
|
| 280 |
+
// Return the number of adapters capable of doing collective operations.
|
| 281 |
+
// If ndev returns 0, all other functions might be set to NULL.
|
| 282 |
+
ncclResult_t (*devices)(int* ndev);
|
| 283 |
+
// Get various device properties.
|
| 284 |
+
ncclResult_t (*getProperties)(int dev, ncclNetProperties_v4_t* props);
|
| 285 |
+
// Create a receiving object and provide a handle to connect to it. The
|
| 286 |
+
// handle can be up to NCCL_NET_HANDLE_MAXSIZE bytes and will be exchanged
|
| 287 |
+
// between ranks to create connections.
|
| 288 |
+
ncclResult_t (*listen)(int dev, void* handle, void** listenComm);
|
| 289 |
+
// Create a group for collective operations. handles have been created
|
| 290 |
+
// using listen() above. rank indicates caller's rank in the collective network.
|
| 291 |
+
ncclResult_t (*connect)(void* handles[], int nranks, int rank, void* listenComm, void** collComm);
|
| 292 |
+
// Returns whether a reduction operation on a data type is supported.
|
| 293 |
+
// 1 for supported, 0 otherwise.
|
| 294 |
+
ncclResult_t (*reduceSupport)(ncclDataType_t dataType, ncclRedOp_t redOp, int* supported);
|
| 295 |
+
// Register/Deregister memory. Type is either NCCL_PTR_HOST or NCCL_PTR_CUDA.
|
| 296 |
+
ncclResult_t (*regMr)(void* collComm, void* data, int size, int type, void** mhandle);
|
| 297 |
+
ncclResult_t (*deregMr)(void* collComm, void* mhandle);
|
| 298 |
+
// Performs an asynchronous allreduce operation on the collective group.
|
| 299 |
+
// May return request == NULL if the call cannot be performed (or would block).
|
| 300 |
+
ncclResult_t (*iallreduce)(void* collComm, void* sendData, void* recvData, int count,
|
| 301 |
+
ncclDataType_t dataType, ncclRedOp_t redOp, void* sendMhandle, void* recvMhandle, void** request);
|
| 302 |
+
// Perform a flush/fence to make sure all data received with NCCL_PTR_CUDA is
|
| 303 |
+
// visible to the GPU
|
| 304 |
+
ncclResult_t (*iflush)(void* collComm, void* data, int size, void* mhandle, void** request);
|
| 305 |
+
// Test whether a request is complete. If size is not NULL, it returns the
|
| 306 |
+
// number of bytes sent/received.
|
| 307 |
+
ncclResult_t (*test)(void* request, int* done, int* size);
|
| 308 |
+
// Close and free collective comm objects
|
| 309 |
+
ncclResult_t (*closeColl)(void* collComm);
|
| 310 |
+
ncclResult_t (*closeListen)(void* listenComm);
|
| 311 |
+
} ncclCollNet_v4_t;
|
| 312 |
+
|
| 313 |
+
#endif // end include guard
|
wemm/lib/python3.10/site-packages/nvidia/nccl/lib/__init__.py
ADDED
|
File without changes
|
wemm/lib/python3.10/site-packages/nvidia/nccl/lib/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (165 Bytes). View file
|
|
|
wemm/lib/python3.10/site-packages/nvidia/nvjitlink/__init__.py
ADDED
|
File without changes
|
wemm/lib/python3.10/site-packages/nvidia/nvjitlink/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (166 Bytes). View file
|
|
|
wemm/lib/python3.10/site-packages/nvidia/nvjitlink/include/__init__.py
ADDED
|
File without changes
|
wemm/lib/python3.10/site-packages/nvidia/nvjitlink/include/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (174 Bytes). View file
|
|
|
wemm/lib/python3.10/site-packages/nvidia/nvjitlink/include/nvJitLink.h
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* NVIDIA_COPYRIGHT_BEGIN
|
| 3 |
+
*
|
| 4 |
+
* Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved.
|
| 5 |
+
*
|
| 6 |
+
* NVIDIA CORPORATION and its licensors retain all intellectual property
|
| 7 |
+
* and proprietary rights in and to this software, related documentation
|
| 8 |
+
* and any modifications thereto. Any use, reproduction, disclosure or
|
| 9 |
+
* distribution of this software and related documentation without an express
|
| 10 |
+
* license agreement from NVIDIA CORPORATION is strictly prohibited.
|
| 11 |
+
*
|
| 12 |
+
* NVIDIA_COPYRIGHT_END
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
#ifndef nvJitLink_INCLUDED
|
| 16 |
+
#define nvJitLink_INCLUDED
|
| 17 |
+
|
| 18 |
+
#ifdef __cplusplus
|
| 19 |
+
extern "C" {
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
#include <stdint.h>
|
| 23 |
+
#include <stdlib.h>
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
*
|
| 27 |
+
* \defgroup error Error codes
|
| 28 |
+
*
|
| 29 |
+
*/
|
| 30 |
+
|
| 31 |
+
/** \ingroup error
|
| 32 |
+
*
|
| 33 |
+
* \brief The enumerated type nvJitLinkResult defines API call result codes.
|
| 34 |
+
* nvJitLink APIs return nvJitLinkResult codes to indicate the result.
|
| 35 |
+
*/
|
| 36 |
+
|
| 37 |
+
typedef enum {
|
| 38 |
+
NVJITLINK_SUCCESS = 0,
|
| 39 |
+
NVJITLINK_ERROR_UNRECOGNIZED_OPTION,
|
| 40 |
+
NVJITLINK_ERROR_MISSING_ARCH, // -arch=sm_NN option not specified
|
| 41 |
+
NVJITLINK_ERROR_INVALID_INPUT,
|
| 42 |
+
NVJITLINK_ERROR_PTX_COMPILE,
|
| 43 |
+
NVJITLINK_ERROR_NVVM_COMPILE,
|
| 44 |
+
NVJITLINK_ERROR_INTERNAL,
|
| 45 |
+
NVJITLINK_ERROR_THREADPOOL,
|
| 46 |
+
NVJITLINK_ERROR_UNRECOGNIZED_INPUT,
|
| 47 |
+
#ifdef NEW_ERROR_CODES // These error codes will appear in a future CUDA release.
|
| 48 |
+
NVJITLINK_ERROR_NULL_INPUT,
|
| 49 |
+
NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS,
|
| 50 |
+
NVJITLINK_ERROR_INCORRECT_INPUT_TYPE,
|
| 51 |
+
NVJITLINK_ERROR_ARCH_MISMATCH,
|
| 52 |
+
NVJITLINK_ERROR_OUTDATED_LIBRARY,
|
| 53 |
+
NVJITLINK_ERROR_MISSING_FATBIN
|
| 54 |
+
#endif
|
| 55 |
+
} nvJitLinkResult;
|
| 56 |
+
|
| 57 |
+
#ifndef NEW_ERROR_CODES // To avoid breaking compatibility, we map them to existing error codes for now.
|
| 58 |
+
#define NVJITLINK_ERROR_NULL_INPUT NVJITLINK_ERROR_INVALID_INPUT
|
| 59 |
+
#define NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS NVJITLINK_ERROR_INVALID_INPUT
|
| 60 |
+
#define NVJITLINK_ERROR_INCORRECT_INPUT_TYPE NVJITLINK_ERROR_INVALID_INPUT
|
| 61 |
+
#define NVJITLINK_ERROR_ARCH_MISMATCH NVJITLINK_ERROR_INTERNAL
|
| 62 |
+
#define NVJITLINK_ERROR_OUTDATED_LIBRARY NVJITLINK_ERROR_INTERNAL
|
| 63 |
+
#define NVJITLINK_ERROR_MISSING_FATBIN NVJITLINK_ERROR_INVALID_INPUT
|
| 64 |
+
#endif
|
| 65 |
+
|
| 66 |
+
/**
|
| 67 |
+
*
|
| 68 |
+
* \defgroup linking Linking
|
| 69 |
+
*
|
| 70 |
+
*/
|
| 71 |
+
|
| 72 |
+
/** \ingroup linking
|
| 73 |
+
*
|
| 74 |
+
* \brief The enumerated type nvJitLinkInputType defines the kind of inputs
|
| 75 |
+
* that can be passed to nvJitLinkAdd* APIs.
|
| 76 |
+
*/
|
| 77 |
+
|
| 78 |
+
typedef enum {
|
| 79 |
+
NVJITLINK_INPUT_NONE = 0, // error
|
| 80 |
+
NVJITLINK_INPUT_CUBIN = 1,
|
| 81 |
+
NVJITLINK_INPUT_PTX,
|
| 82 |
+
NVJITLINK_INPUT_LTOIR,
|
| 83 |
+
NVJITLINK_INPUT_FATBIN,
|
| 84 |
+
NVJITLINK_INPUT_OBJECT,
|
| 85 |
+
NVJITLINK_INPUT_LIBRARY,
|
| 86 |
+
NVJITLINK_INPUT_ANY = 10 // will dynamically determine one of above types
|
| 87 |
+
} nvJitLinkInputType;
|
| 88 |
+
|
| 89 |
+
/**
|
| 90 |
+
* \defgroup options Supported Link Options
|
| 91 |
+
*
|
| 92 |
+
* nvJitLink supports the link options below.
|
| 93 |
+
* Option names are prefixed with a single dash (\c -).
|
| 94 |
+
* Options that take a value have an assignment operator (\c =)
|
| 95 |
+
* followed by the option value, with no spaces, e.g. \c "-arch=sm_90".
|
| 96 |
+
*
|
| 97 |
+
* The supported options are:
|
| 98 |
+
* - \c -arch=sm_<N\> \n
|
| 99 |
+
* Pass SM architecture value. See nvcc for valid values of <N\>.
|
| 100 |
+
* Can use compute_<N\> value instead if only generating PTX.
|
| 101 |
+
* This is a required option.
|
| 102 |
+
* - \c -maxrregcount=<N\> \n
|
| 103 |
+
* Maximum register count.
|
| 104 |
+
* - \c -time \n
|
| 105 |
+
* Print timing information to InfoLog.
|
| 106 |
+
* - \c -verbose \n
|
| 107 |
+
* Print verbose messages to InfoLog.
|
| 108 |
+
* - \c -lto \n
|
| 109 |
+
* Do link time optimization.
|
| 110 |
+
* - \c -ptx \n
|
| 111 |
+
* Emit ptx after linking instead of cubin; only supported with \c -lto
|
| 112 |
+
* - \c -O<N\> \n
|
| 113 |
+
* Optimization level. Only 0 and 3 are accepted.
|
| 114 |
+
* - \c -g \n
|
| 115 |
+
* Generate debug information.
|
| 116 |
+
* - \c -lineinfo \n
|
| 117 |
+
* Generate line information.
|
| 118 |
+
* - \c -ftz=<n\> \n
|
| 119 |
+
* Flush to zero.
|
| 120 |
+
* - \c -prec-div=<n\> \n
|
| 121 |
+
* Precise divide.
|
| 122 |
+
* - \c -prec-sqrt=<n\> \n
|
| 123 |
+
* Precise square root.
|
| 124 |
+
* - \c -fma=<n\> \n
|
| 125 |
+
* Fast multiply add.
|
| 126 |
+
* - \c -kernels-used=<name\> \n
|
| 127 |
+
* Pass list of kernels that are used; any not in the list can be removed.
|
| 128 |
+
* This option can be specified multiple times.
|
| 129 |
+
* - \c -variables-used=<name\> \n
|
| 130 |
+
* Pass list of variables that are used; any not in the list can be removed.
|
| 131 |
+
* This option can be specified multiple times.
|
| 132 |
+
* - \c -optimize-unused-variables \n
|
| 133 |
+
* Normally device code optimization is limited by not knowing what the
|
| 134 |
+
* host code references. With this option it can assume that if a variable
|
| 135 |
+
* is not referenced in device code then it can be removed.
|
| 136 |
+
* - \c -Xptxas=<opt\> \n
|
| 137 |
+
* Pass <opt\> to ptxas. This option can be called multiple times.
|
| 138 |
+
* - \c -split-compile=<N\> \n
|
| 139 |
+
* Split compilation maximum thread count. Use 0 to use all available processors.
|
| 140 |
+
* Value of 1 disables split compilation (default).
|
| 141 |
+
* - \c -split-compile-extended=<N\> \n
|
| 142 |
+
* [Experimental] A more aggressive form of split compilation.
|
| 143 |
+
* Accepts a maximum thread count value. Use 0 to use all available processors.
|
| 144 |
+
* Value of 1 disables extended split compilation (default).
|
| 145 |
+
* - \c -jump-table-density=<N\> \n
|
| 146 |
+
* When doing LTO, specify the case density percentage in switch statements,
|
| 147 |
+
* and use it as a minimal threshold to determine whether jump table(brx.idx
|
| 148 |
+
* instruction) will be used to implement a switch statement. Default
|
| 149 |
+
* value is 101. The percentage ranges from 0 to 101 inclusively.
|
| 150 |
+
*/
|
| 151 |
+
|
| 152 |
+
/**
|
| 153 |
+
* \ingroup linking
|
| 154 |
+
* \brief nvJitLinkHandle is the unit of linking, and an opaque handle for
|
| 155 |
+
* a program.
|
| 156 |
+
*
|
| 157 |
+
* To link inputs, an instance of nvJitLinkHandle must be created first with
|
| 158 |
+
* nvJitLinkCreate().
|
| 159 |
+
*/
|
| 160 |
+
|
| 161 |
+
typedef struct nvJitLink* nvJitLinkHandle; // opaque handle
|
| 162 |
+
|
| 163 |
+
// For versioning we will have separate API version for each library version
|
| 164 |
+
|
| 165 |
+
extern nvJitLinkResult __nvJitLinkCreate_12_4(
|
| 166 |
+
nvJitLinkHandle *handle,
|
| 167 |
+
uint32_t numOptions,
|
| 168 |
+
const char **options);
|
| 169 |
+
/**
|
| 170 |
+
* \ingroup linking
|
| 171 |
+
* \brief nvJitLinkCreate creates an instance of nvJitLinkHandle with the
|
| 172 |
+
* given input options, and sets the output parameter \p handle.
|
| 173 |
+
*
|
| 174 |
+
* \param [out] handle Address of nvJitLink handle.
|
| 175 |
+
* \param [in] numOptions Number of options passed.
|
| 176 |
+
* \param [in] options Array of size \p numOptions of option strings.
|
| 177 |
+
* \return
|
| 178 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 179 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_UNRECOGNIZED_OPTION\endlink
|
| 180 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_MISSING_ARCH\endlink
|
| 181 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 182 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 183 |
+
*
|
| 184 |
+
* It supports options listed in \ref options.
|
| 185 |
+
*
|
| 186 |
+
* \see nvJitLinkDestroy
|
| 187 |
+
*/
|
| 188 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 189 |
+
static inline nvJitLinkResult nvJitLinkCreate(
|
| 190 |
+
nvJitLinkHandle *handle,
|
| 191 |
+
uint32_t numOptions,
|
| 192 |
+
const char **options)
|
| 193 |
+
{
|
| 194 |
+
return __nvJitLinkCreate_12_4 (handle, numOptions, options);
|
| 195 |
+
}
|
| 196 |
+
#endif
|
| 197 |
+
|
| 198 |
+
extern nvJitLinkResult __nvJitLinkDestroy_12_4 (nvJitLinkHandle *handle);
|
| 199 |
+
/**
|
| 200 |
+
* \ingroup linking
|
| 201 |
+
* \brief nvJitLinkDestroy frees the memory associated with the given handle
|
| 202 |
+
* and sets it to NULL.
|
| 203 |
+
*
|
| 204 |
+
* \param [in] handle Address of nvJitLink handle.
|
| 205 |
+
* \return
|
| 206 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 207 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 208 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 209 |
+
*
|
| 210 |
+
* \see nvJitLinkCreate
|
| 211 |
+
*/
|
| 212 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 213 |
+
static inline nvJitLinkResult nvJitLinkDestroy (nvJitLinkHandle *handle)
|
| 214 |
+
{
|
| 215 |
+
return __nvJitLinkDestroy_12_4 (handle);
|
| 216 |
+
}
|
| 217 |
+
#endif
|
| 218 |
+
|
| 219 |
+
extern nvJitLinkResult __nvJitLinkAddData_12_4(
|
| 220 |
+
nvJitLinkHandle handle,
|
| 221 |
+
nvJitLinkInputType inputType,
|
| 222 |
+
const void *data,
|
| 223 |
+
size_t size,
|
| 224 |
+
const char *name); // name can be null
|
| 225 |
+
/**
|
| 226 |
+
* \ingroup linking
|
| 227 |
+
* \brief nvJitLinkAddData adds data image to the link.
|
| 228 |
+
*
|
| 229 |
+
* \param [in] handle nvJitLink handle.
|
| 230 |
+
* \param [in] inputType kind of input.
|
| 231 |
+
* \param [in] data pointer to data image in memory.
|
| 232 |
+
* \param [in] size size of the data.
|
| 233 |
+
* \param [in] name name of input object.
|
| 234 |
+
* \return
|
| 235 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 236 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 237 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 238 |
+
*/
|
| 239 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 240 |
+
static inline nvJitLinkResult nvJitLinkAddData(
|
| 241 |
+
nvJitLinkHandle handle,
|
| 242 |
+
nvJitLinkInputType inputType,
|
| 243 |
+
const void *data,
|
| 244 |
+
size_t size,
|
| 245 |
+
const char *name) // name can be null
|
| 246 |
+
{
|
| 247 |
+
return __nvJitLinkAddData_12_4 (handle, inputType, data, size, name);
|
| 248 |
+
}
|
| 249 |
+
#endif
|
| 250 |
+
|
| 251 |
+
extern nvJitLinkResult __nvJitLinkAddFile_12_4(
|
| 252 |
+
nvJitLinkHandle handle,
|
| 253 |
+
nvJitLinkInputType inputType,
|
| 254 |
+
const char *fileName); // includes path to file
|
| 255 |
+
/**
|
| 256 |
+
* \ingroup linking
|
| 257 |
+
* \brief nvJitLinkAddFile reads data from file and links it in.
|
| 258 |
+
*
|
| 259 |
+
* \param [in] handle nvJitLink handle.
|
| 260 |
+
* \param [in] inputType kind of input.
|
| 261 |
+
* \param [in] fileName name of file.
|
| 262 |
+
* \return
|
| 263 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 264 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 265 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 266 |
+
*/
|
| 267 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 268 |
+
static inline nvJitLinkResult nvJitLinkAddFile(
|
| 269 |
+
nvJitLinkHandle handle,
|
| 270 |
+
nvJitLinkInputType inputType,
|
| 271 |
+
const char *fileName) // includes path to file
|
| 272 |
+
{
|
| 273 |
+
return __nvJitLinkAddFile_12_4 (handle, inputType, fileName);
|
| 274 |
+
}
|
| 275 |
+
#endif
|
| 276 |
+
|
| 277 |
+
extern nvJitLinkResult __nvJitLinkComplete_12_4 (nvJitLinkHandle handle);
|
| 278 |
+
/**
|
| 279 |
+
* \ingroup linking
|
| 280 |
+
* \brief nvJitLinkComplete does the actual link.
|
| 281 |
+
*
|
| 282 |
+
* \param [in] handle nvJitLink handle.
|
| 283 |
+
* \return
|
| 284 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 285 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 286 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 287 |
+
*/
|
| 288 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 289 |
+
static inline nvJitLinkResult nvJitLinkComplete (nvJitLinkHandle handle)
|
| 290 |
+
{
|
| 291 |
+
return __nvJitLinkComplete_12_4 (handle);
|
| 292 |
+
}
|
| 293 |
+
#endif
|
| 294 |
+
|
| 295 |
+
extern nvJitLinkResult __nvJitLinkGetLinkedCubinSize_12_4(
|
| 296 |
+
nvJitLinkHandle handle,
|
| 297 |
+
size_t *size);
|
| 298 |
+
/**
|
| 299 |
+
* \ingroup linking
|
| 300 |
+
* \brief nvJitLinkGetLinkedCubinSize gets the size of the linked cubin.
|
| 301 |
+
*
|
| 302 |
+
* \param [in] handle nvJitLink handle.
|
| 303 |
+
* \param [out] size Size of the linked cubin.
|
| 304 |
+
* \return
|
| 305 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 306 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 307 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 308 |
+
*
|
| 309 |
+
* \see nvJitLinkGetLinkedCubin
|
| 310 |
+
*/
|
| 311 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 312 |
+
static inline nvJitLinkResult nvJitLinkGetLinkedCubinSize(
|
| 313 |
+
nvJitLinkHandle handle,
|
| 314 |
+
size_t *size)
|
| 315 |
+
{
|
| 316 |
+
return __nvJitLinkGetLinkedCubinSize_12_4 (handle, size);
|
| 317 |
+
}
|
| 318 |
+
#endif
|
| 319 |
+
|
| 320 |
+
extern nvJitLinkResult __nvJitLinkGetLinkedCubin_12_4(
|
| 321 |
+
nvJitLinkHandle handle,
|
| 322 |
+
void *cubin);
|
| 323 |
+
/**
|
| 324 |
+
* \ingroup linking
|
| 325 |
+
* \brief nvJitLinkGetLinkedCubin gets the linked cubin.
|
| 326 |
+
*
|
| 327 |
+
* \param [in] handle nvJitLink handle.
|
| 328 |
+
* \param [out] cubin The linked cubin.
|
| 329 |
+
* \return
|
| 330 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 331 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 332 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 333 |
+
*
|
| 334 |
+
* User is responsible for allocating enough space to hold the \p cubin.
|
| 335 |
+
* \see nvJitLinkGetLinkedCubinSize
|
| 336 |
+
*/
|
| 337 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 338 |
+
static inline nvJitLinkResult nvJitLinkGetLinkedCubin(
|
| 339 |
+
nvJitLinkHandle handle,
|
| 340 |
+
void *cubin)
|
| 341 |
+
{
|
| 342 |
+
return __nvJitLinkGetLinkedCubin_12_4 (handle, cubin);
|
| 343 |
+
}
|
| 344 |
+
#endif
|
| 345 |
+
|
| 346 |
+
extern nvJitLinkResult __nvJitLinkGetLinkedPtxSize_12_4(
|
| 347 |
+
nvJitLinkHandle handle,
|
| 348 |
+
size_t *size);
|
| 349 |
+
/**
|
| 350 |
+
* \ingroup linking
|
| 351 |
+
* \brief nvJitLinkGetLinkedPtxSize gets the size of the linked ptx.
|
| 352 |
+
*
|
| 353 |
+
* \param [in] handle nvJitLink handle.
|
| 354 |
+
* \param [out] size Size of the linked PTX.
|
| 355 |
+
* \return
|
| 356 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 357 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 358 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 359 |
+
*
|
| 360 |
+
* Linked PTX is only available when using the \c -lto option.
|
| 361 |
+
* \see nvJitLinkGetLinkedPtx
|
| 362 |
+
*/
|
| 363 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 364 |
+
static inline nvJitLinkResult nvJitLinkGetLinkedPtxSize(
|
| 365 |
+
nvJitLinkHandle handle,
|
| 366 |
+
size_t *size)
|
| 367 |
+
{
|
| 368 |
+
return __nvJitLinkGetLinkedPtxSize_12_4 (handle, size);
|
| 369 |
+
}
|
| 370 |
+
#endif
|
| 371 |
+
|
| 372 |
+
extern nvJitLinkResult __nvJitLinkGetLinkedPtx_12_4(
|
| 373 |
+
nvJitLinkHandle handle,
|
| 374 |
+
char *ptx);
|
| 375 |
+
/**
|
| 376 |
+
* \ingroup linking
|
| 377 |
+
* \brief nvJitLinkGetLinkedPtx gets the linked ptx.
|
| 378 |
+
*
|
| 379 |
+
* \param [in] handle nvJitLink handle.
|
| 380 |
+
* \param [out] ptx The linked PTX.
|
| 381 |
+
* \return
|
| 382 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 383 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 384 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 385 |
+
*
|
| 386 |
+
* Linked PTX is only available when using the \c -lto option.
|
| 387 |
+
* User is responsible for allocating enough space to hold the \p ptx.
|
| 388 |
+
* \see nvJitLinkGetLinkedPtxSize
|
| 389 |
+
*/
|
| 390 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 391 |
+
static inline nvJitLinkResult nvJitLinkGetLinkedPtx(
|
| 392 |
+
nvJitLinkHandle handle,
|
| 393 |
+
char *ptx)
|
| 394 |
+
{
|
| 395 |
+
return __nvJitLinkGetLinkedPtx_12_4 (handle, ptx);
|
| 396 |
+
}
|
| 397 |
+
#endif
|
| 398 |
+
|
| 399 |
+
extern nvJitLinkResult __nvJitLinkGetErrorLogSize_12_4(
|
| 400 |
+
nvJitLinkHandle handle,
|
| 401 |
+
size_t *size);
|
| 402 |
+
/**
|
| 403 |
+
* \ingroup linking
|
| 404 |
+
* \brief nvJitLinkGetErrorLogSize gets the size of the error log.
|
| 405 |
+
*
|
| 406 |
+
* \param [in] handle nvJitLink handle.
|
| 407 |
+
* \param [out] size Size of the error log.
|
| 408 |
+
* \return
|
| 409 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 410 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 411 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 412 |
+
*
|
| 413 |
+
* \see nvJitLinkGetErrorLog
|
| 414 |
+
*/
|
| 415 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 416 |
+
static inline nvJitLinkResult nvJitLinkGetErrorLogSize(
|
| 417 |
+
nvJitLinkHandle handle,
|
| 418 |
+
size_t *size)
|
| 419 |
+
{
|
| 420 |
+
return __nvJitLinkGetErrorLogSize_12_4 (handle, size);
|
| 421 |
+
}
|
| 422 |
+
#endif
|
| 423 |
+
|
| 424 |
+
extern nvJitLinkResult __nvJitLinkGetErrorLog_12_4(
|
| 425 |
+
nvJitLinkHandle handle,
|
| 426 |
+
char *log);
|
| 427 |
+
/**
|
| 428 |
+
* \ingroup linking
|
| 429 |
+
* \brief nvJitLinkGetErrorLog puts any error messages in the log.
|
| 430 |
+
*
|
| 431 |
+
* \param [in] handle nvJitLink handle.
|
| 432 |
+
* \param [out] log The error log.
|
| 433 |
+
* \return
|
| 434 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 435 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 436 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 437 |
+
*
|
| 438 |
+
* User is responsible for allocating enough space to hold the \p log.
|
| 439 |
+
* \see nvJitLinkGetErrorLogSize
|
| 440 |
+
*/
|
| 441 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 442 |
+
static inline nvJitLinkResult nvJitLinkGetErrorLog(
|
| 443 |
+
nvJitLinkHandle handle,
|
| 444 |
+
char *log)
|
| 445 |
+
{
|
| 446 |
+
return __nvJitLinkGetErrorLog_12_4 (handle, log);
|
| 447 |
+
}
|
| 448 |
+
#endif
|
| 449 |
+
|
| 450 |
+
extern nvJitLinkResult __nvJitLinkGetInfoLogSize_12_4(
|
| 451 |
+
nvJitLinkHandle handle,
|
| 452 |
+
size_t *size);
|
| 453 |
+
/**
|
| 454 |
+
* \ingroup linking
|
| 455 |
+
* \brief nvJitLinkGetInfoLogSize gets the size of the info log.
|
| 456 |
+
*
|
| 457 |
+
* \param [in] handle nvJitLink handle.
|
| 458 |
+
* \param [out] size Size of the info log.
|
| 459 |
+
* \return
|
| 460 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 461 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 462 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 463 |
+
*
|
| 464 |
+
* \see nvJitLinkGetInfoLog
|
| 465 |
+
*/
|
| 466 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 467 |
+
static inline nvJitLinkResult nvJitLinkGetInfoLogSize(
|
| 468 |
+
nvJitLinkHandle handle,
|
| 469 |
+
size_t *size)
|
| 470 |
+
{
|
| 471 |
+
return __nvJitLinkGetInfoLogSize_12_4 (handle, size);
|
| 472 |
+
}
|
| 473 |
+
#endif
|
| 474 |
+
|
| 475 |
+
extern nvJitLinkResult __nvJitLinkGetInfoLog_12_4(
|
| 476 |
+
nvJitLinkHandle handle,
|
| 477 |
+
char *log);
|
| 478 |
+
/**
|
| 479 |
+
* \ingroup linking
|
| 480 |
+
* \brief nvJitLinkGetInfoLog puts any info messages in the log.
|
| 481 |
+
*
|
| 482 |
+
* \param [in] handle nvJitLink handle.
|
| 483 |
+
* \param [out] log The info log.
|
| 484 |
+
* \return
|
| 485 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 486 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 487 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 488 |
+
*
|
| 489 |
+
* User is responsible for allocating enough space to hold the \p log.
|
| 490 |
+
* \see nvJitLinkGetInfoLogSize
|
| 491 |
+
*/
|
| 492 |
+
#ifndef NVJITLINK_NO_INLINE
|
| 493 |
+
static inline nvJitLinkResult nvJitLinkGetInfoLog(
|
| 494 |
+
nvJitLinkHandle handle,
|
| 495 |
+
char *log)
|
| 496 |
+
{
|
| 497 |
+
return __nvJitLinkGetInfoLog_12_4 (handle, log);
|
| 498 |
+
}
|
| 499 |
+
#endif
|
| 500 |
+
|
| 501 |
+
/**
|
| 502 |
+
* \ingroup linking
|
| 503 |
+
* \brief nvJitLinkVersion returns the current version of nvJitLink.
|
| 504 |
+
*
|
| 505 |
+
* \param [out] major The major version.
|
| 506 |
+
* \param [out] minor The minor version.
|
| 507 |
+
* \return
|
| 508 |
+
* - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
|
| 509 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
|
| 510 |
+
* - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
|
| 511 |
+
*
|
| 512 |
+
*/
|
| 513 |
+
extern nvJitLinkResult nvJitLinkVersion(
|
| 514 |
+
unsigned int *major,
|
| 515 |
+
unsigned int *minor);
|
| 516 |
+
|
| 517 |
+
#ifdef __cplusplus
|
| 518 |
+
}
|
| 519 |
+
#endif
|
| 520 |
+
|
| 521 |
+
#endif // nvJitLink_INCLUDED
|
| 522 |
+
|
wemm/lib/python3.10/site-packages/nvidia/nvjitlink/lib/__init__.py
ADDED
|
File without changes
|
wemm/lib/python3.10/site-packages/nvidia/nvjitlink/lib/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (170 Bytes). View file
|
|
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/__init__.py
ADDED
|
File without changes
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (161 Bytes). View file
|
|
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/__init__.py
ADDED
|
File without changes
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (169 Bytes). View file
|
|
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvToolsExt.h
ADDED
|
@@ -0,0 +1,1561 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2009-2017 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO USER:
|
| 5 |
+
*
|
| 6 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 11 |
+
* of a form of NVIDIA software license agreement.
|
| 12 |
+
*
|
| 13 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 14 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 15 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 16 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 17 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 18 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 19 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 20 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 21 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 22 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 23 |
+
*
|
| 24 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 25 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 26 |
+
* "commercial computer software" and "commercial computer software
|
| 27 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 28 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 29 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 30 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 31 |
+
* source code with only those rights set forth herein.
|
| 32 |
+
*
|
| 33 |
+
* Any use of this source code in individual and commercial software must
|
| 34 |
+
* include, in the user documentation and internal comments to the code,
|
| 35 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
/** \file nvToolsExt.h
|
| 39 |
+
*/
|
| 40 |
+
|
| 41 |
+
/* ========================================================================= */
|
| 42 |
+
/** \mainpage
|
| 43 |
+
* \tableofcontents
|
| 44 |
+
* \section INTRODUCTION Introduction
|
| 45 |
+
*
|
| 46 |
+
* The NVIDIA Tools Extension library is a set of functions that a
|
| 47 |
+
* developer can use to provide additional information to tools.
|
| 48 |
+
* The additional information is used by the tool to improve
|
| 49 |
+
* analysis and visualization of data.
|
| 50 |
+
*
|
| 51 |
+
* The library introduces close to zero overhead if no tool is
|
| 52 |
+
* attached to the application. The overhead when a tool is
|
| 53 |
+
* attached is specific to the tool.
|
| 54 |
+
*
|
| 55 |
+
* \section INITIALIZATION_SECTION Initialization
|
| 56 |
+
*
|
| 57 |
+
* Typically the tool's library that plugs into NVTX is indirectly
|
| 58 |
+
* loaded via enviromental properties that are platform specific.
|
| 59 |
+
* For some platform or special cases, the user may be required
|
| 60 |
+
* to instead explicity initialize instead though. This can also
|
| 61 |
+
* be helpful to control when the API loads a tool's library instead
|
| 62 |
+
* of what would typically be the first function call to emit info.
|
| 63 |
+
* For these rare case, see \ref INITIALIZATION for additional information.
|
| 64 |
+
*
|
| 65 |
+
* \section MARKERS_AND_RANGES Markers and Ranges
|
| 66 |
+
*
|
| 67 |
+
* Markers and ranges are used to describe events at a specific time (markers)
|
| 68 |
+
* or over a time span (ranges) during the execution of the application
|
| 69 |
+
* respectively.
|
| 70 |
+
*
|
| 71 |
+
* \subsection MARKERS Markers
|
| 72 |
+
*
|
| 73 |
+
* Markers denote specific moments in time.
|
| 74 |
+
*
|
| 75 |
+
*
|
| 76 |
+
* See \ref DOMAINS and \ref EVENT_ATTRIBUTES for additional information on
|
| 77 |
+
* how to specify the domain.
|
| 78 |
+
*
|
| 79 |
+
* \subsection THREAD_RANGES Thread Ranges
|
| 80 |
+
*
|
| 81 |
+
* Thread ranges denote nested time ranges. Nesting is maintained per thread
|
| 82 |
+
* per domain and does not require any additional correlation mechanism. The
|
| 83 |
+
* duration of a thread range is defined by the corresponding pair of
|
| 84 |
+
* nvtxRangePush* to nvtxRangePop API calls.
|
| 85 |
+
*
|
| 86 |
+
* See \ref DOMAINS and \ref EVENT_ATTRIBUTES for additional information on
|
| 87 |
+
* how to specify the domain.
|
| 88 |
+
*
|
| 89 |
+
* \subsection PROCESS_RANGES Process Ranges
|
| 90 |
+
*
|
| 91 |
+
* Process ranges denote a time span that can expose arbitrary concurrency, as
|
| 92 |
+
* opposed to thread ranges that only support nesting. In addition the range
|
| 93 |
+
* start event can happen on a different thread than the end marker. For the
|
| 94 |
+
* correlation of a start/end pair an unique correlation ID is used that is
|
| 95 |
+
* returned from the start API call and needs to be passed into the end API
|
| 96 |
+
* call.
|
| 97 |
+
*
|
| 98 |
+
* \subsection EVENT_ATTRIBUTES Event Attributes
|
| 99 |
+
*
|
| 100 |
+
* \ref MARKERS_AND_RANGES can be annotated with various attributes to provide
|
| 101 |
+
* additional information for an event or to guide the tool's visualization of
|
| 102 |
+
* the data. Each of the attributes is optional and if left unused the
|
| 103 |
+
* attributes fall back to a default value. The attributes include:
|
| 104 |
+
* - color
|
| 105 |
+
* - category
|
| 106 |
+
*
|
| 107 |
+
* To specify any attribute other than the text message, the \ref
|
| 108 |
+
* EVENT_ATTRIBUTE_STRUCTURE "Event Attribute Structure" must be used.
|
| 109 |
+
*
|
| 110 |
+
* \section DOMAINS Domains
|
| 111 |
+
*
|
| 112 |
+
* Domains enable developers to scope annotations. By default all events and
|
| 113 |
+
* annotations are in the default domain. Additional domains can be registered.
|
| 114 |
+
* This allows developers to scope markers, ranges, and resources names to
|
| 115 |
+
* avoid conflicts.
|
| 116 |
+
*
|
| 117 |
+
* The function ::nvtxDomainCreateA or ::nvtxDomainCreateW is used to create
|
| 118 |
+
* a named domain.
|
| 119 |
+
*
|
| 120 |
+
* Each domain maintains its own
|
| 121 |
+
* - categories
|
| 122 |
+
* - thread range stacks
|
| 123 |
+
* - registered strings
|
| 124 |
+
*
|
| 125 |
+
* The function ::nvtxDomainDestroy marks the end of the domain. Destroying
|
| 126 |
+
* a domain unregisters and destroys all objects associated with it such as
|
| 127 |
+
* registered strings, resource objects, named categories, and started ranges.
|
| 128 |
+
*
|
| 129 |
+
* \section RESOURCE_NAMING Resource Naming
|
| 130 |
+
*
|
| 131 |
+
* This section covers calls that allow to annotate objects with user-provided
|
| 132 |
+
* names in order to allow for a better analysis of complex trace data. All of
|
| 133 |
+
* the functions take the handle or the ID of the object to name and the name.
|
| 134 |
+
* The functions can be called multiple times during the execution of an
|
| 135 |
+
* application, however, in that case it is implementation dependent which
|
| 136 |
+
* name will be reported by the tool.
|
| 137 |
+
*
|
| 138 |
+
* \subsection CATEGORY_NAMING Category Naming
|
| 139 |
+
*
|
| 140 |
+
* Some function in this library support associating an integer category
|
| 141 |
+
* to enable filtering and sorting. The category naming functions allow
|
| 142 |
+
* the application to associate a user friendly name with the integer
|
| 143 |
+
* category. Support for domains have been added in NVTX_VERSION_2 to
|
| 144 |
+
* avoid collisions when domains are developed independantly.
|
| 145 |
+
*
|
| 146 |
+
* \subsection RESOURCE_OBJECTS Resource Objects
|
| 147 |
+
*
|
| 148 |
+
* Resource objects are a generic mechanism for attaching data to an application
|
| 149 |
+
* resource. The identifier field makes the association to a pointer or handle,
|
| 150 |
+
* while the type field helps provide deeper understanding of the identifier as
|
| 151 |
+
* well as enabling differentiation in cases where handles generated by different
|
| 152 |
+
* APIs may collide. The resource object may also have an associated message to
|
| 153 |
+
* associate with the application resource, enabling further annotation of this
|
| 154 |
+
* object and how it is used.
|
| 155 |
+
*
|
| 156 |
+
* The resource object was introduced in NVTX_VERSION_2 to supersede existing naming
|
| 157 |
+
* functions and allow the application resource identified by those functions to be
|
| 158 |
+
* associated to a domain. The other naming functions are still supported for backward
|
| 159 |
+
* compatibility but will be associated only to the default domain.
|
| 160 |
+
*
|
| 161 |
+
* \subsection RESOURCE_NAMING_OS Resource Naming
|
| 162 |
+
*
|
| 163 |
+
* Some operating system resources creation APIs do not support providing a user friendly
|
| 164 |
+
* name, such as some OS thread creation APIs. This API support resource naming though
|
| 165 |
+
* both through resource objects and functions following the pattern
|
| 166 |
+
* nvtxName[RESOURCE_TYPE][A|W](identifier, name). Resource objects introduced in NVTX_VERSION 2
|
| 167 |
+
* supersede the other functions with a a more general method of assigning names to OS resources,
|
| 168 |
+
* along with associating them to domains too. The older nvtxName* functions are only associated
|
| 169 |
+
* with the default domain.
|
| 170 |
+
* \section EXTENSIONS Optional Extensions
|
| 171 |
+
* Optional extensions will either appear within the existing sections the extend or appear
|
| 172 |
+
* in the "Related Pages" when they introduce new concepts.
|
| 173 |
+
*/
|
| 174 |
+
|
| 175 |
+
#ifndef NVTOOLSEXT_H_
|
| 176 |
+
#define NVTOOLSEXT_H_
|
| 177 |
+
|
| 178 |
+
#if defined(_MSC_VER)
|
| 179 |
+
#ifdef NVTX_EXPORTS
|
| 180 |
+
#define NVTX_DECLSPEC
|
| 181 |
+
#else
|
| 182 |
+
#define NVTX_DECLSPEC __declspec(dllimport)
|
| 183 |
+
#endif /* NVTX_EXPORTS */
|
| 184 |
+
#define NVTX_API __stdcall
|
| 185 |
+
#define NVTX_INLINE_STATIC __inline static
|
| 186 |
+
#else /*defined(__GNUC__)*/
|
| 187 |
+
#define NVTX_DECLSPEC
|
| 188 |
+
#define NVTX_API
|
| 189 |
+
#define NVTX_INLINE_STATIC inline static
|
| 190 |
+
#endif /* Platform */
|
| 191 |
+
|
| 192 |
+
/**
|
| 193 |
+
* The nvToolsExt library depends on stdint.h. If the build tool chain in use
|
| 194 |
+
* does not include stdint.h then define NVTX_STDINT_TYPES_ALREADY_DEFINED
|
| 195 |
+
* and define the following types:
|
| 196 |
+
* <ul>
|
| 197 |
+
* <li>uint8_t
|
| 198 |
+
* <li>int8_t
|
| 199 |
+
* <li>uint16_t
|
| 200 |
+
* <li>int16_t
|
| 201 |
+
* <li>uint32_t
|
| 202 |
+
* <li>int32_t
|
| 203 |
+
* <li>uint64_t
|
| 204 |
+
* <li>int64_t
|
| 205 |
+
* <li>uintptr_t
|
| 206 |
+
* <li>intptr_t
|
| 207 |
+
* </ul>
|
| 208 |
+
#define NVTX_STDINT_TYPES_ALREADY_DEFINED if you are using your own header file.
|
| 209 |
+
*/
|
| 210 |
+
#ifndef NVTX_STDINT_TYPES_ALREADY_DEFINED
|
| 211 |
+
#include <stdint.h>
|
| 212 |
+
#endif
|
| 213 |
+
|
| 214 |
+
#include <stddef.h>
|
| 215 |
+
|
| 216 |
+
#ifdef __cplusplus
|
| 217 |
+
extern "C" {
|
| 218 |
+
#endif /* __cplusplus */
|
| 219 |
+
|
| 220 |
+
/**
|
| 221 |
+
* Tools Extension API version
|
| 222 |
+
*/
|
| 223 |
+
#define NVTX_VERSION 2
|
| 224 |
+
|
| 225 |
+
/**
|
| 226 |
+
* Size of the nvtxEventAttributes_t structure.
|
| 227 |
+
*/
|
| 228 |
+
#define NVTX_EVENT_ATTRIB_STRUCT_SIZE ( (uint16_t)( sizeof(nvtxEventAttributes_t) ) )
|
| 229 |
+
|
| 230 |
+
/**
|
| 231 |
+
* Size of the nvtxInitializationAttributes_t structure.
|
| 232 |
+
*/
|
| 233 |
+
#define NVTX_INITIALIZATION_ATTRIB_STRUCT_SIZE ( (uint16_t)( sizeof(nvtxInitializationAttributes_t) ) )
|
| 234 |
+
|
| 235 |
+
#define NVTX_NO_PUSH_POP_TRACKING ((int)-2)
|
| 236 |
+
|
| 237 |
+
typedef uint64_t nvtxRangeId_t;
|
| 238 |
+
|
| 239 |
+
|
| 240 |
+
/* \brief String Handle Structure.
|
| 241 |
+
* \anchor STRING_HANDLE_STRUCTURE
|
| 242 |
+
*
|
| 243 |
+
* This structure is opaque to the user and is used as a handle to reference
|
| 244 |
+
* a string. The tools will return a pointer through the API for the application
|
| 245 |
+
* to hold on it's behalf to reference the string in the future.
|
| 246 |
+
*
|
| 247 |
+
*/
|
| 248 |
+
typedef struct nvtxStringHandle* nvtxStringHandle_t;
|
| 249 |
+
|
| 250 |
+
/* \brief Domain Handle Structure.
|
| 251 |
+
* \anchor DOMAIN_HANDLE_STRUCTURE
|
| 252 |
+
*
|
| 253 |
+
* This structure is opaque to the user and is used as a handle to reference
|
| 254 |
+
* a domain. The tools will return a pointer through the API for the application
|
| 255 |
+
* to hold on its behalf to reference the domain in the future.
|
| 256 |
+
*
|
| 257 |
+
*/
|
| 258 |
+
typedef struct nvtxDomainHandle* nvtxDomainHandle_t;
|
| 259 |
+
|
| 260 |
+
|
| 261 |
+
|
| 262 |
+
|
| 263 |
+
|
| 264 |
+
|
| 265 |
+
/* ========================================================================= */
|
| 266 |
+
/** \defgroup GENERAL General
|
| 267 |
+
* @{
|
| 268 |
+
*/
|
| 269 |
+
|
| 270 |
+
/** ---------------------------------------------------------------------------
|
| 271 |
+
* Color Types
|
| 272 |
+
* ------------------------------------------------------------------------- */
|
| 273 |
+
typedef enum nvtxColorType_t
|
| 274 |
+
{
|
| 275 |
+
NVTX_COLOR_UNKNOWN = 0, /**< Color attribute is unused. */
|
| 276 |
+
NVTX_COLOR_ARGB = 1 /**< An ARGB color is provided. */
|
| 277 |
+
} nvtxColorType_t;
|
| 278 |
+
|
| 279 |
+
/** ---------------------------------------------------------------------------
|
| 280 |
+
* Message Types
|
| 281 |
+
* ------------------------------------------------------------------------- */
|
| 282 |
+
typedef enum nvtxMessageType_t
|
| 283 |
+
{
|
| 284 |
+
NVTX_MESSAGE_UNKNOWN = 0, /**< Message payload is unused. */
|
| 285 |
+
NVTX_MESSAGE_TYPE_ASCII = 1, /**< A character sequence is used as payload. */
|
| 286 |
+
NVTX_MESSAGE_TYPE_UNICODE = 2, /**< A wide character sequence is used as payload. */
|
| 287 |
+
/* NVTX_VERSION_2 */
|
| 288 |
+
NVTX_MESSAGE_TYPE_REGISTERED = 3 /**< A unique string handle that was registered
|
| 289 |
+
with \ref nvtxDomainRegisterStringA() or
|
| 290 |
+
\ref nvtxDomainRegisterStringW(). */
|
| 291 |
+
} nvtxMessageType_t;
|
| 292 |
+
|
| 293 |
+
typedef union nvtxMessageValue_t
|
| 294 |
+
{
|
| 295 |
+
const char* ascii;
|
| 296 |
+
const wchar_t* unicode;
|
| 297 |
+
/* NVTX_VERSION_2 */
|
| 298 |
+
nvtxStringHandle_t registered;
|
| 299 |
+
} nvtxMessageValue_t;
|
| 300 |
+
|
| 301 |
+
|
| 302 |
+
/** @} */ /*END defgroup*/
|
| 303 |
+
|
| 304 |
+
/* ========================================================================= */
|
| 305 |
+
/** \defgroup INITIALIZATION Initialization
|
| 306 |
+
* @{
|
| 307 |
+
* Typically the tool's library that plugs into NVTX is indirectly
|
| 308 |
+
* loaded via enviromental properties that are platform specific.
|
| 309 |
+
* For some platform or special cases, the user may be required
|
| 310 |
+
* to instead explicity initialize instead though. This can also
|
| 311 |
+
* be helpful to control when the API loads a tool's library instead
|
| 312 |
+
* of what would typically be the first function call to emit info.
|
| 313 |
+
*/
|
| 314 |
+
|
| 315 |
+
/** ---------------------------------------------------------------------------
|
| 316 |
+
* Initialization Modes
|
| 317 |
+
* ------------------------------------------------------------------------- */
|
| 318 |
+
typedef enum nvtxInitializationMode_t
|
| 319 |
+
{
|
| 320 |
+
NVTX_INITIALIZATION_MODE_UNKNOWN = 0, /**< A platform that supports indirect initialization will attempt this style, otherwise expect failure. */
|
| 321 |
+
NVTX_INITIALIZATION_MODE_CALLBACK_V1 = 1, /**< A function pointer conforming to NVTX_VERSION=1 will be used. */
|
| 322 |
+
NVTX_INITIALIZATION_MODE_CALLBACK_V2 = 2, /**< A function pointer conforming to NVTX_VERSION=2 will be used. */
|
| 323 |
+
NVTX_INITIALIZATION_MODE_SIZE
|
| 324 |
+
} nvtxInitializationMode_t;
|
| 325 |
+
|
| 326 |
+
|
| 327 |
+
/** \brief Initialization Attribute Structure.
|
| 328 |
+
* \anchor INITIALIZATION_ATTRIBUTE_STRUCTURE
|
| 329 |
+
*
|
| 330 |
+
* This structure is used to describe the attributes used for initialization
|
| 331 |
+
* of the NVTX API.
|
| 332 |
+
*
|
| 333 |
+
* \par Initializing the Attributes
|
| 334 |
+
*
|
| 335 |
+
* The caller should always perform the following three tasks when using
|
| 336 |
+
* attributes:
|
| 337 |
+
* <ul>
|
| 338 |
+
* <li>Zero the structure
|
| 339 |
+
* <li>Set the version field
|
| 340 |
+
* <li>Set the size field
|
| 341 |
+
* </ul>
|
| 342 |
+
*
|
| 343 |
+
* Zeroing the structure sets all the event attributes types and values
|
| 344 |
+
* to the default value.
|
| 345 |
+
*
|
| 346 |
+
* The version and size field are used by the Tools Extension
|
| 347 |
+
* implementation to handle multiple versions of the attributes structure.
|
| 348 |
+
* NVTX_INITIALIZATION_ATTRIB_STRUCT_SIZE may be used for the size.
|
| 349 |
+
*
|
| 350 |
+
* It is recommended that the caller use one of the following to methods
|
| 351 |
+
* to initialize the event attributes structure:
|
| 352 |
+
*
|
| 353 |
+
* \par Method 1: Initializing nvtxInitializationAttributes_t for future compatibility
|
| 354 |
+
* \code
|
| 355 |
+
* nvtxInitializationAttributes_t initAttribs = {0};
|
| 356 |
+
* initAttribs.version = NVTX_VERSION;
|
| 357 |
+
* initAttribs.size = NVTX_INITIALIZATION_ATTRIB_STRUCT_SIZE;
|
| 358 |
+
* \endcode
|
| 359 |
+
*
|
| 360 |
+
* \par Method 2: Initializing nvtxInitializationAttributes_t for a specific version
|
| 361 |
+
* \code
|
| 362 |
+
* nvtxInitializationAttributes_t initAttribs = {0};
|
| 363 |
+
* initAttribs.version =2;
|
| 364 |
+
* initAttribs.size = (uint16_t)(sizeof(nvtxInitializationAttributes_v2));
|
| 365 |
+
* \endcode
|
| 366 |
+
*
|
| 367 |
+
* If the caller uses Method 1 it is critical that the entire binary
|
| 368 |
+
* layout of the structure be configured to 0 so that all fields
|
| 369 |
+
* are initialized to the default value.
|
| 370 |
+
*
|
| 371 |
+
* The caller should either use both NVTX_VERSION and
|
| 372 |
+
* NVTX_INITIALIZATION_ATTRIB_STRUCT_SIZE (Method 1) or use explicit values
|
| 373 |
+
* and a versioned type (Method 2). Using a mix of the two methods
|
| 374 |
+
* will likely cause either source level incompatibility or binary
|
| 375 |
+
* incompatibility in the future.
|
| 376 |
+
*
|
| 377 |
+
* \par Settings Attribute Types and Values
|
| 378 |
+
*
|
| 379 |
+
*
|
| 380 |
+
* \par Example:
|
| 381 |
+
* \code
|
| 382 |
+
* // Initialize
|
| 383 |
+
* nvtxInitializationAttributes_t initAttribs = {0};
|
| 384 |
+
* initAttribs.version = NVTX_VERSION;
|
| 385 |
+
* initAttribs.size = NVTX_INITIALIZATION_ATTRIB_STRUCT_SIZE;
|
| 386 |
+
*
|
| 387 |
+
* // Configure the Attributes
|
| 388 |
+
* initAttribs.mode = NVTX_INITIALIZATION_MODE_CALLBACK_V2;
|
| 389 |
+
* initAttribs.fnptr = InitializeInjectionNvtx2;
|
| 390 |
+
* \endcode
|
| 391 |
+
|
| 392 |
+
* \sa
|
| 393 |
+
* ::nvtxInitializationMode_t
|
| 394 |
+
* ::nvtxInitialize
|
| 395 |
+
*/
|
| 396 |
+
typedef struct nvtxInitializationAttributes_v2
|
| 397 |
+
{
|
| 398 |
+
/**
|
| 399 |
+
* \brief Version flag of the structure.
|
| 400 |
+
*
|
| 401 |
+
* Needs to be set to NVTX_VERSION to indicate the version of NVTX APIs
|
| 402 |
+
* supported in this header file. This can optionally be overridden to
|
| 403 |
+
* another version of the tools extension library.
|
| 404 |
+
*/
|
| 405 |
+
uint16_t version;
|
| 406 |
+
|
| 407 |
+
/**
|
| 408 |
+
* \brief Size of the structure.
|
| 409 |
+
*
|
| 410 |
+
* Needs to be set to the size in bytes of the event attribute
|
| 411 |
+
* structure used to specify the event.
|
| 412 |
+
*/
|
| 413 |
+
uint16_t size;
|
| 414 |
+
|
| 415 |
+
/**
|
| 416 |
+
* \brief Mode of initialization.
|
| 417 |
+
*
|
| 418 |
+
* The mode of initialization dictates the overall behavior and which
|
| 419 |
+
* attributes in this struct will be used.
|
| 420 |
+
*
|
| 421 |
+
* Default Value is NVTX_INITIALIZATION_MODE_UNKNOWN = 0
|
| 422 |
+
* \sa
|
| 423 |
+
* ::nvtxInitializationMode_t
|
| 424 |
+
*/
|
| 425 |
+
uint32_t mode;
|
| 426 |
+
|
| 427 |
+
/**
|
| 428 |
+
* \brief Function pointer used for initialization if the mode requires
|
| 429 |
+
*
|
| 430 |
+
* The user has retrieved this function pointer from the tool library
|
| 431 |
+
* and would like to use it to initialize. The mode must be set to a
|
| 432 |
+
* NVTX_INITIALIZATION_MODE_CALLBACK_V# for this to be used. The mode
|
| 433 |
+
* will dictate the expectations for this member. The function signature
|
| 434 |
+
* will be cast from void(*)() to the appropriate signature for the mode.
|
| 435 |
+
* the expected behavior of the function will also depend on the mode
|
| 436 |
+
* beyond the simple function signature.
|
| 437 |
+
*
|
| 438 |
+
* Default Value is NVTX_INITIALIZATION_MODE_UNKNOWN which will either
|
| 439 |
+
* initialize based on external properties or fail if not supported on
|
| 440 |
+
* the given platform.
|
| 441 |
+
|
| 442 |
+
* \sa
|
| 443 |
+
* ::nvtxInitializationMode_t
|
| 444 |
+
*/
|
| 445 |
+
void(*fnptr)(void);
|
| 446 |
+
|
| 447 |
+
} nvtxInitializationAttributes_v2;
|
| 448 |
+
|
| 449 |
+
typedef struct nvtxInitializationAttributes_v2 nvtxInitializationAttributes_t;
|
| 450 |
+
|
| 451 |
+
|
| 452 |
+
/* ------------------------------------------------------------------------- */
|
| 453 |
+
/** \brief Force initialization (optional on most platforms)
|
| 454 |
+
*
|
| 455 |
+
* Force NVTX library to initialize. On some platform NVTX will implicit initialize
|
| 456 |
+
* upon the first function call into an NVTX API.
|
| 457 |
+
*
|
| 458 |
+
* \return Result codes are simplest to assume NVTX_SUCCESS or !NVTX_SUCCESS
|
| 459 |
+
*
|
| 460 |
+
* \param initAttrib - The initialization attribute structure
|
| 461 |
+
*
|
| 462 |
+
* \sa
|
| 463 |
+
* ::nvtxInitializationAttributes_t
|
| 464 |
+
*
|
| 465 |
+
* \version \NVTX_VERSION_2
|
| 466 |
+
* @{ */
|
| 467 |
+
NVTX_DECLSPEC int NVTX_API nvtxInitialize(const nvtxInitializationAttributes_t* initAttrib);
|
| 468 |
+
/** @} */
|
| 469 |
+
|
| 470 |
+
|
| 471 |
+
/** @} */ /*END defgroup*/
|
| 472 |
+
|
| 473 |
+
/* ========================================================================= */
|
| 474 |
+
/** \defgroup EVENT_ATTRIBUTES Event Attributes
|
| 475 |
+
* @{
|
| 476 |
+
*/
|
| 477 |
+
|
| 478 |
+
/** ---------------------------------------------------------------------------
|
| 479 |
+
* Payload Types
|
| 480 |
+
* ------------------------------------------------------------------------- */
|
| 481 |
+
typedef enum nvtxPayloadType_t
|
| 482 |
+
{
|
| 483 |
+
NVTX_PAYLOAD_UNKNOWN = 0, /**< Color payload is unused. */
|
| 484 |
+
NVTX_PAYLOAD_TYPE_UNSIGNED_INT64 = 1, /**< A 64 bit unsigned integer value is used as payload. */
|
| 485 |
+
NVTX_PAYLOAD_TYPE_INT64 = 2, /**< A 64 bit signed integer value is used as payload. */
|
| 486 |
+
NVTX_PAYLOAD_TYPE_DOUBLE = 3, /**< A 64 bit floating point value is used as payload. */
|
| 487 |
+
/* NVTX_VERSION_2 */
|
| 488 |
+
NVTX_PAYLOAD_TYPE_UNSIGNED_INT32 = 4, /**< A 32 bit floating point value is used as payload. */
|
| 489 |
+
NVTX_PAYLOAD_TYPE_INT32 = 5, /**< A 32 bit floating point value is used as payload. */
|
| 490 |
+
NVTX_PAYLOAD_TYPE_FLOAT = 6 /**< A 32 bit floating point value is used as payload. */
|
| 491 |
+
} nvtxPayloadType_t;
|
| 492 |
+
|
| 493 |
+
/** \brief Event Attribute Structure.
|
| 494 |
+
* \anchor EVENT_ATTRIBUTE_STRUCTURE
|
| 495 |
+
*
|
| 496 |
+
* This structure is used to describe the attributes of an event. The layout of
|
| 497 |
+
* the structure is defined by a specific version of the tools extension
|
| 498 |
+
* library and can change between different versions of the Tools Extension
|
| 499 |
+
* library.
|
| 500 |
+
*
|
| 501 |
+
* \par Initializing the Attributes
|
| 502 |
+
*
|
| 503 |
+
* The caller should always perform the following three tasks when using
|
| 504 |
+
* attributes:
|
| 505 |
+
* <ul>
|
| 506 |
+
* <li>Zero the structure
|
| 507 |
+
* <li>Set the version field
|
| 508 |
+
* <li>Set the size field
|
| 509 |
+
* </ul>
|
| 510 |
+
*
|
| 511 |
+
* Zeroing the structure sets all the event attributes types and values
|
| 512 |
+
* to the default value.
|
| 513 |
+
*
|
| 514 |
+
* The version and size field are used by the Tools Extension
|
| 515 |
+
* implementation to handle multiple versions of the attributes structure.
|
| 516 |
+
*
|
| 517 |
+
* It is recommended that the caller use one of the following to methods
|
| 518 |
+
* to initialize the event attributes structure:
|
| 519 |
+
*
|
| 520 |
+
* \par Method 1: Initializing nvtxEventAttributes for future compatibility
|
| 521 |
+
* \code
|
| 522 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 523 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 524 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 525 |
+
* \endcode
|
| 526 |
+
*
|
| 527 |
+
* \par Method 2: Initializing nvtxEventAttributes for a specific version
|
| 528 |
+
* \code
|
| 529 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 530 |
+
* eventAttrib.version = 1;
|
| 531 |
+
* eventAttrib.size = (uint16_t)(sizeof(nvtxEventAttributes_v1));
|
| 532 |
+
* \endcode
|
| 533 |
+
*
|
| 534 |
+
* If the caller uses Method 1 it is critical that the entire binary
|
| 535 |
+
* layout of the structure be configured to 0 so that all fields
|
| 536 |
+
* are initialized to the default value.
|
| 537 |
+
*
|
| 538 |
+
* The caller should either use both NVTX_VERSION and
|
| 539 |
+
* NVTX_EVENT_ATTRIB_STRUCT_SIZE (Method 1) or use explicit values
|
| 540 |
+
* and a versioned type (Method 2). Using a mix of the two methods
|
| 541 |
+
* will likely cause either source level incompatibility or binary
|
| 542 |
+
* incompatibility in the future.
|
| 543 |
+
*
|
| 544 |
+
* \par Settings Attribute Types and Values
|
| 545 |
+
*
|
| 546 |
+
*
|
| 547 |
+
* \par Example:
|
| 548 |
+
* \code
|
| 549 |
+
* // Initialize
|
| 550 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 551 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 552 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 553 |
+
*
|
| 554 |
+
* // Configure the Attributes
|
| 555 |
+
* eventAttrib.colorType = NVTX_COLOR_ARGB;
|
| 556 |
+
* eventAttrib.color = 0xFF880000;
|
| 557 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 558 |
+
* eventAttrib.message.ascii = "Example";
|
| 559 |
+
* \endcode
|
| 560 |
+
*
|
| 561 |
+
* In the example the caller does not have to set the value of
|
| 562 |
+
* \ref ::nvtxEventAttributes_v2::category or
|
| 563 |
+
* \ref ::nvtxEventAttributes_v2::payload as these fields were set to
|
| 564 |
+
* the default value by {0}.
|
| 565 |
+
* \sa
|
| 566 |
+
* ::nvtxDomainMarkEx
|
| 567 |
+
* ::nvtxDomainRangeStartEx
|
| 568 |
+
* ::nvtxDomainRangePushEx
|
| 569 |
+
*/
|
| 570 |
+
typedef struct nvtxEventAttributes_v2
|
| 571 |
+
{
|
| 572 |
+
/**
|
| 573 |
+
* \brief Version flag of the structure.
|
| 574 |
+
*
|
| 575 |
+
* Needs to be set to NVTX_VERSION to indicate the version of NVTX APIs
|
| 576 |
+
* supported in this header file. This can optionally be overridden to
|
| 577 |
+
* another version of the tools extension library.
|
| 578 |
+
*/
|
| 579 |
+
uint16_t version;
|
| 580 |
+
|
| 581 |
+
/**
|
| 582 |
+
* \brief Size of the structure.
|
| 583 |
+
*
|
| 584 |
+
* Needs to be set to the size in bytes of the event attribute
|
| 585 |
+
* structure used to specify the event.
|
| 586 |
+
*/
|
| 587 |
+
uint16_t size;
|
| 588 |
+
|
| 589 |
+
/**
|
| 590 |
+
* \brief ID of the category the event is assigned to.
|
| 591 |
+
*
|
| 592 |
+
* A category is a user-controlled ID that can be used to group
|
| 593 |
+
* events. The tool may use category IDs to improve filtering or
|
| 594 |
+
* enable grouping of events in the same category. The functions
|
| 595 |
+
* \ref ::nvtxNameCategoryA or \ref ::nvtxNameCategoryW can be used
|
| 596 |
+
* to name a category.
|
| 597 |
+
*
|
| 598 |
+
* Default Value is 0
|
| 599 |
+
*/
|
| 600 |
+
uint32_t category;
|
| 601 |
+
|
| 602 |
+
/** \brief Color type specified in this attribute structure.
|
| 603 |
+
*
|
| 604 |
+
* Defines the color format of the attribute structure's \ref COLOR_FIELD
|
| 605 |
+
* "color" field.
|
| 606 |
+
*
|
| 607 |
+
* Default Value is NVTX_COLOR_UNKNOWN
|
| 608 |
+
*/
|
| 609 |
+
int32_t colorType; /* nvtxColorType_t */
|
| 610 |
+
|
| 611 |
+
/** \brief Color assigned to this event. \anchor COLOR_FIELD
|
| 612 |
+
*
|
| 613 |
+
* The color that the tool should use to visualize the event.
|
| 614 |
+
*/
|
| 615 |
+
uint32_t color;
|
| 616 |
+
|
| 617 |
+
/**
|
| 618 |
+
* \brief Payload type specified in this attribute structure.
|
| 619 |
+
*
|
| 620 |
+
* Defines the payload format of the attribute structure's \ref PAYLOAD_FIELD
|
| 621 |
+
* "payload" field.
|
| 622 |
+
*
|
| 623 |
+
* Default Value is NVTX_PAYLOAD_UNKNOWN
|
| 624 |
+
*/
|
| 625 |
+
int32_t payloadType; /* nvtxPayloadType_t */
|
| 626 |
+
|
| 627 |
+
int32_t reserved0;
|
| 628 |
+
|
| 629 |
+
/**
|
| 630 |
+
* \brief Payload assigned to this event. \anchor PAYLOAD_FIELD
|
| 631 |
+
*
|
| 632 |
+
* A numerical value that can be used to annotate an event. The tool could
|
| 633 |
+
* use the payload data to reconstruct graphs and diagrams.
|
| 634 |
+
*/
|
| 635 |
+
union payload_t
|
| 636 |
+
{
|
| 637 |
+
uint64_t ullValue;
|
| 638 |
+
int64_t llValue;
|
| 639 |
+
double dValue;
|
| 640 |
+
/* NVTX_VERSION_2 */
|
| 641 |
+
uint32_t uiValue;
|
| 642 |
+
int32_t iValue;
|
| 643 |
+
float fValue;
|
| 644 |
+
} payload;
|
| 645 |
+
|
| 646 |
+
/** \brief Message type specified in this attribute structure.
|
| 647 |
+
*
|
| 648 |
+
* Defines the message format of the attribute structure's \ref MESSAGE_FIELD
|
| 649 |
+
* "message" field.
|
| 650 |
+
*
|
| 651 |
+
* Default Value is NVTX_MESSAGE_UNKNOWN
|
| 652 |
+
*/
|
| 653 |
+
int32_t messageType; /* nvtxMessageType_t */
|
| 654 |
+
|
| 655 |
+
/** \brief Message assigned to this attribute structure. \anchor MESSAGE_FIELD
|
| 656 |
+
*
|
| 657 |
+
* The text message that is attached to an event.
|
| 658 |
+
*/
|
| 659 |
+
nvtxMessageValue_t message;
|
| 660 |
+
|
| 661 |
+
} nvtxEventAttributes_v2;
|
| 662 |
+
|
| 663 |
+
typedef struct nvtxEventAttributes_v2 nvtxEventAttributes_t;
|
| 664 |
+
|
| 665 |
+
/** @} */ /*END defgroup*/
|
| 666 |
+
/* ========================================================================= */
|
| 667 |
+
/** \defgroup MARKERS_AND_RANGES Markers and Ranges
|
| 668 |
+
*
|
| 669 |
+
* See \ref MARKERS_AND_RANGES for more details
|
| 670 |
+
*
|
| 671 |
+
* @{
|
| 672 |
+
*/
|
| 673 |
+
|
| 674 |
+
/** \name Marker */
|
| 675 |
+
|
| 676 |
+
/* ------------------------------------------------------------------------- */
|
| 677 |
+
/** \brief Marks an instantaneous event in the application.
|
| 678 |
+
*
|
| 679 |
+
* A marker can contain a text message or specify additional information
|
| 680 |
+
* using the event attributes structure. These attributes include a text
|
| 681 |
+
* message, color, category, and a payload. Each of the attributes is optional
|
| 682 |
+
* and can only be sent out using the \ref nvtxDomainMarkEx function.
|
| 683 |
+
*
|
| 684 |
+
* nvtxDomainMarkEx(NULL, event) is equivalent to calling
|
| 685 |
+
* nvtxMarkEx(event).
|
| 686 |
+
*
|
| 687 |
+
* \param domain - The domain of scoping the category.
|
| 688 |
+
* \param eventAttrib - The event attribute structure defining the marker's
|
| 689 |
+
* attribute types and attribute values.
|
| 690 |
+
*
|
| 691 |
+
* \sa
|
| 692 |
+
* ::nvtxMarkEx
|
| 693 |
+
*
|
| 694 |
+
* \version \NVTX_VERSION_2
|
| 695 |
+
* @{ */
|
| 696 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainMarkEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib);
|
| 697 |
+
/** @} */
|
| 698 |
+
|
| 699 |
+
/* ------------------------------------------------------------------------- */
|
| 700 |
+
/** \brief Marks an instantaneous event in the application.
|
| 701 |
+
*
|
| 702 |
+
* A marker can contain a text message or specify additional information
|
| 703 |
+
* using the event attributes structure. These attributes include a text
|
| 704 |
+
* message, color, category, and a payload. Each of the attributes is optional
|
| 705 |
+
* and can only be sent out using the \ref nvtxMarkEx function.
|
| 706 |
+
* If \ref nvtxMarkA or \ref nvtxMarkW are used to specify the marker
|
| 707 |
+
* or if an attribute is unspecified then a default value will be used.
|
| 708 |
+
*
|
| 709 |
+
* \param eventAttrib - The event attribute structure defining the marker's
|
| 710 |
+
* attribute types and attribute values.
|
| 711 |
+
*
|
| 712 |
+
* \par Example:
|
| 713 |
+
* \code
|
| 714 |
+
* // zero the structure
|
| 715 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 716 |
+
* // set the version and the size information
|
| 717 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 718 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 719 |
+
* // configure the attributes. 0 is the default for all attributes.
|
| 720 |
+
* eventAttrib.colorType = NVTX_COLOR_ARGB;
|
| 721 |
+
* eventAttrib.color = 0xFF880000;
|
| 722 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 723 |
+
* eventAttrib.message.ascii = "Example nvtxMarkEx";
|
| 724 |
+
* nvtxMarkEx(&eventAttrib);
|
| 725 |
+
* \endcode
|
| 726 |
+
*
|
| 727 |
+
* \sa
|
| 728 |
+
* ::nvtxDomainMarkEx
|
| 729 |
+
*
|
| 730 |
+
* \version \NVTX_VERSION_1
|
| 731 |
+
* @{ */
|
| 732 |
+
NVTX_DECLSPEC void NVTX_API nvtxMarkEx(const nvtxEventAttributes_t* eventAttrib);
|
| 733 |
+
/** @} */
|
| 734 |
+
|
| 735 |
+
/* ------------------------------------------------------------------------- */
|
| 736 |
+
/** \brief Marks an instantaneous event in the application.
|
| 737 |
+
*
|
| 738 |
+
* A marker created using \ref nvtxMarkA or \ref nvtxMarkW contains only a
|
| 739 |
+
* text message.
|
| 740 |
+
*
|
| 741 |
+
* \param message - The message associated to this marker event.
|
| 742 |
+
*
|
| 743 |
+
* \par Example:
|
| 744 |
+
* \code
|
| 745 |
+
* nvtxMarkA("Example nvtxMarkA");
|
| 746 |
+
* nvtxMarkW(L"Example nvtxMarkW");
|
| 747 |
+
* \endcode
|
| 748 |
+
*
|
| 749 |
+
* \sa
|
| 750 |
+
* ::nvtxDomainMarkEx
|
| 751 |
+
* ::nvtxMarkEx
|
| 752 |
+
*
|
| 753 |
+
* \version \NVTX_VERSION_0
|
| 754 |
+
* @{ */
|
| 755 |
+
NVTX_DECLSPEC void NVTX_API nvtxMarkA(const char* message);
|
| 756 |
+
NVTX_DECLSPEC void NVTX_API nvtxMarkW(const wchar_t* message);
|
| 757 |
+
/** @} */
|
| 758 |
+
|
| 759 |
+
|
| 760 |
+
/** \name Process Ranges */
|
| 761 |
+
|
| 762 |
+
/* ------------------------------------------------------------------------- */
|
| 763 |
+
/** \brief Starts a process range in a domain.
|
| 764 |
+
*
|
| 765 |
+
* \param domain - The domain of scoping the category.
|
| 766 |
+
* \param eventAttrib - The event attribute structure defining the range's
|
| 767 |
+
* attribute types and attribute values.
|
| 768 |
+
*
|
| 769 |
+
* \return The unique ID used to correlate a pair of Start and End events.
|
| 770 |
+
*
|
| 771 |
+
* \remarks Ranges defined by Start/End can overlap.
|
| 772 |
+
*
|
| 773 |
+
* \par Example:
|
| 774 |
+
* \code
|
| 775 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("my domain");
|
| 776 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 777 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 778 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 779 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 780 |
+
* eventAttrib.message.ascii = "my range";
|
| 781 |
+
* nvtxRangeId_t rangeId = nvtxDomainRangeStartEx(&eventAttrib);
|
| 782 |
+
* // ...
|
| 783 |
+
* nvtxDomainRangeEnd(rangeId);
|
| 784 |
+
* \endcode
|
| 785 |
+
*
|
| 786 |
+
* \sa
|
| 787 |
+
* ::nvtxDomainRangeEnd
|
| 788 |
+
*
|
| 789 |
+
* \version \NVTX_VERSION_2
|
| 790 |
+
* @{ */
|
| 791 |
+
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxDomainRangeStartEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib);
|
| 792 |
+
/** @} */
|
| 793 |
+
|
| 794 |
+
/* ------------------------------------------------------------------------- */
|
| 795 |
+
/** \brief Starts a process range.
|
| 796 |
+
*
|
| 797 |
+
* \param eventAttrib - The event attribute structure defining the range's
|
| 798 |
+
* attribute types and attribute values.
|
| 799 |
+
*
|
| 800 |
+
* \return The unique ID used to correlate a pair of Start and End events.
|
| 801 |
+
*
|
| 802 |
+
* \remarks Ranges defined by Start/End can overlap.
|
| 803 |
+
*
|
| 804 |
+
* \par Example:
|
| 805 |
+
* \code
|
| 806 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 807 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 808 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 809 |
+
* eventAttrib.category = 3;
|
| 810 |
+
* eventAttrib.colorType = NVTX_COLOR_ARGB;
|
| 811 |
+
* eventAttrib.color = 0xFF0088FF;
|
| 812 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 813 |
+
* eventAttrib.message.ascii = "Example Range";
|
| 814 |
+
* nvtxRangeId_t rangeId = nvtxRangeStartEx(&eventAttrib);
|
| 815 |
+
* // ...
|
| 816 |
+
* nvtxRangeEnd(rangeId);
|
| 817 |
+
* \endcode
|
| 818 |
+
*
|
| 819 |
+
* \sa
|
| 820 |
+
* ::nvtxRangeEnd
|
| 821 |
+
* ::nvtxDomainRangeStartEx
|
| 822 |
+
*
|
| 823 |
+
* \version \NVTX_VERSION_1
|
| 824 |
+
* @{ */
|
| 825 |
+
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartEx(const nvtxEventAttributes_t* eventAttrib);
|
| 826 |
+
/** @} */
|
| 827 |
+
|
| 828 |
+
/* ------------------------------------------------------------------------- */
|
| 829 |
+
/** \brief Starts a process range.
|
| 830 |
+
*
|
| 831 |
+
* \param message - The event message associated to this range event.
|
| 832 |
+
*
|
| 833 |
+
* \return The unique ID used to correlate a pair of Start and End events.
|
| 834 |
+
*
|
| 835 |
+
* \remarks Ranges defined by Start/End can overlap.
|
| 836 |
+
*
|
| 837 |
+
* \par Example:
|
| 838 |
+
* \code
|
| 839 |
+
* nvtxRangeId_t r1 = nvtxRangeStartA("Range 1");
|
| 840 |
+
* nvtxRangeId_t r2 = nvtxRangeStartW(L"Range 2");
|
| 841 |
+
* nvtxRangeEnd(r1);
|
| 842 |
+
* nvtxRangeEnd(r2);
|
| 843 |
+
* \endcode
|
| 844 |
+
*
|
| 845 |
+
* \sa
|
| 846 |
+
* ::nvtxRangeEnd
|
| 847 |
+
* ::nvtxRangeStartEx
|
| 848 |
+
* ::nvtxDomainRangeStartEx
|
| 849 |
+
*
|
| 850 |
+
* \version \NVTX_VERSION_0
|
| 851 |
+
* @{ */
|
| 852 |
+
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartA(const char* message);
|
| 853 |
+
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartW(const wchar_t* message);
|
| 854 |
+
/** @} */
|
| 855 |
+
|
| 856 |
+
/* ------------------------------------------------------------------------- */
|
| 857 |
+
/** \brief Ends a process range.
|
| 858 |
+
*
|
| 859 |
+
* \param domain - The domain
|
| 860 |
+
* \param id - The correlation ID returned from a nvtxRangeStart call.
|
| 861 |
+
*
|
| 862 |
+
* \remarks This function is offered completeness but is an alias for ::nvtxRangeEnd.
|
| 863 |
+
* It does not need a domain param since that is associated iwth the range ID at ::nvtxDomainRangeStartEx
|
| 864 |
+
*
|
| 865 |
+
* \par Example:
|
| 866 |
+
* \code
|
| 867 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("my domain");
|
| 868 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 869 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 870 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 871 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 872 |
+
* eventAttrib.message.ascii = "my range";
|
| 873 |
+
* nvtxRangeId_t rangeId = nvtxDomainRangeStartEx(&eventAttrib);
|
| 874 |
+
* // ...
|
| 875 |
+
* nvtxDomainRangeEnd(rangeId);
|
| 876 |
+
* \endcode
|
| 877 |
+
*
|
| 878 |
+
* \sa
|
| 879 |
+
* ::nvtxDomainRangeStartEx
|
| 880 |
+
*
|
| 881 |
+
* \version \NVTX_VERSION_2
|
| 882 |
+
* @{ */
|
| 883 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainRangeEnd(nvtxDomainHandle_t domain, nvtxRangeId_t id);
|
| 884 |
+
/** @} */
|
| 885 |
+
|
| 886 |
+
/* ------------------------------------------------------------------------- */
|
| 887 |
+
/** \brief Ends a process range.
|
| 888 |
+
*
|
| 889 |
+
* \param id - The correlation ID returned from an nvtxRangeStart call.
|
| 890 |
+
*
|
| 891 |
+
* \sa
|
| 892 |
+
* ::nvtxDomainRangeStartEx
|
| 893 |
+
* ::nvtxRangeStartEx
|
| 894 |
+
* ::nvtxRangeStartA
|
| 895 |
+
* ::nvtxRangeStartW
|
| 896 |
+
*
|
| 897 |
+
* \version \NVTX_VERSION_0
|
| 898 |
+
* @{ */
|
| 899 |
+
NVTX_DECLSPEC void NVTX_API nvtxRangeEnd(nvtxRangeId_t id);
|
| 900 |
+
/** @} */
|
| 901 |
+
|
| 902 |
+
/** \name Thread Ranges */
|
| 903 |
+
|
| 904 |
+
/* ------------------------------------------------------------------------- */
|
| 905 |
+
/** \brief Starts a nested thread range.
|
| 906 |
+
*
|
| 907 |
+
* \param domain - The domain of scoping.
|
| 908 |
+
* \param eventAttrib - The event attribute structure defining the range's
|
| 909 |
+
* attribute types and attribute values.
|
| 910 |
+
*
|
| 911 |
+
* \return The 0 based level of range being started. This value is scoped to the domain.
|
| 912 |
+
* If an error occurs, a negative value is returned.
|
| 913 |
+
*
|
| 914 |
+
* \par Example:
|
| 915 |
+
* \code
|
| 916 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("example domain");
|
| 917 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 918 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 919 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 920 |
+
* eventAttrib.colorType = NVTX_COLOR_ARGB;
|
| 921 |
+
* eventAttrib.color = 0xFFFF0000;
|
| 922 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 923 |
+
* eventAttrib.message.ascii = "Level 0";
|
| 924 |
+
* nvtxDomainRangePushEx(domain, &eventAttrib);
|
| 925 |
+
*
|
| 926 |
+
* // Re-use eventAttrib
|
| 927 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_UNICODE;
|
| 928 |
+
* eventAttrib.message.unicode = L"Level 1";
|
| 929 |
+
* nvtxDomainRangePushEx(domain, &eventAttrib);
|
| 930 |
+
*
|
| 931 |
+
* nvtxDomainRangePop(domain); //level 1
|
| 932 |
+
* nvtxDomainRangePop(domain); //level 0
|
| 933 |
+
* \endcode
|
| 934 |
+
*
|
| 935 |
+
* \sa
|
| 936 |
+
* ::nvtxDomainRangePop
|
| 937 |
+
*
|
| 938 |
+
* \version \NVTX_VERSION_2
|
| 939 |
+
* @{ */
|
| 940 |
+
NVTX_DECLSPEC int NVTX_API nvtxDomainRangePushEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib);
|
| 941 |
+
/** @} */
|
| 942 |
+
|
| 943 |
+
/* ------------------------------------------------------------------------- */
|
| 944 |
+
/** \brief Starts a nested thread range.
|
| 945 |
+
*
|
| 946 |
+
* \param eventAttrib - The event attribute structure defining the range's
|
| 947 |
+
* attribute types and attribute values.
|
| 948 |
+
*
|
| 949 |
+
* \return The 0 based level of range being started. This level is per domain.
|
| 950 |
+
* If an error occurs a negative value is returned.
|
| 951 |
+
*
|
| 952 |
+
* \par Example:
|
| 953 |
+
* \code
|
| 954 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 955 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 956 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 957 |
+
* eventAttrib.colorType = NVTX_COLOR_ARGB;
|
| 958 |
+
* eventAttrib.color = 0xFFFF0000;
|
| 959 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 960 |
+
* eventAttrib.message.ascii = "Level 0";
|
| 961 |
+
* nvtxRangePushEx(&eventAttrib);
|
| 962 |
+
*
|
| 963 |
+
* // Re-use eventAttrib
|
| 964 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_UNICODE;
|
| 965 |
+
* eventAttrib.message.unicode = L"Level 1";
|
| 966 |
+
* nvtxRangePushEx(&eventAttrib);
|
| 967 |
+
*
|
| 968 |
+
* nvtxRangePop();
|
| 969 |
+
* nvtxRangePop();
|
| 970 |
+
* \endcode
|
| 971 |
+
*
|
| 972 |
+
* \sa
|
| 973 |
+
* ::nvtxDomainRangePushEx
|
| 974 |
+
* ::nvtxRangePop
|
| 975 |
+
*
|
| 976 |
+
* \version \NVTX_VERSION_1
|
| 977 |
+
* @{ */
|
| 978 |
+
NVTX_DECLSPEC int NVTX_API nvtxRangePushEx(const nvtxEventAttributes_t* eventAttrib);
|
| 979 |
+
/** @} */
|
| 980 |
+
|
| 981 |
+
/* ------------------------------------------------------------------------- */
|
| 982 |
+
/** \brief Starts a nested thread range.
|
| 983 |
+
*
|
| 984 |
+
* \param message - The event message associated to this range event.
|
| 985 |
+
*
|
| 986 |
+
* \return The 0 based level of range being started. If an error occurs a
|
| 987 |
+
* negative value is returned.
|
| 988 |
+
*
|
| 989 |
+
* \par Example:
|
| 990 |
+
* \code
|
| 991 |
+
* nvtxRangePushA("Level 0");
|
| 992 |
+
* nvtxRangePushW(L"Level 1");
|
| 993 |
+
* nvtxRangePop();
|
| 994 |
+
* nvtxRangePop();
|
| 995 |
+
* \endcode
|
| 996 |
+
*
|
| 997 |
+
* \sa
|
| 998 |
+
* ::nvtxDomainRangePushEx
|
| 999 |
+
* ::nvtxRangePop
|
| 1000 |
+
*
|
| 1001 |
+
* \version \NVTX_VERSION_0
|
| 1002 |
+
* @{ */
|
| 1003 |
+
NVTX_DECLSPEC int NVTX_API nvtxRangePushA(const char* message);
|
| 1004 |
+
NVTX_DECLSPEC int NVTX_API nvtxRangePushW(const wchar_t* message);
|
| 1005 |
+
/** @} */
|
| 1006 |
+
|
| 1007 |
+
|
| 1008 |
+
/* ------------------------------------------------------------------------- */
|
| 1009 |
+
/** \brief Ends a nested thread range.
|
| 1010 |
+
*
|
| 1011 |
+
* \return The level of the range being ended. If an error occurs a negative
|
| 1012 |
+
* value is returned on the current thread.
|
| 1013 |
+
*
|
| 1014 |
+
* \par Example:
|
| 1015 |
+
* \code
|
| 1016 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreate("example library");
|
| 1017 |
+
* nvtxDomainRangePushA(domain, "Level 0");
|
| 1018 |
+
* nvtxDomainRangePushW(domain, L"Level 1");
|
| 1019 |
+
* nvtxDomainRangePop(domain);
|
| 1020 |
+
* nvtxDomainRangePop(domain);
|
| 1021 |
+
* \endcode
|
| 1022 |
+
*
|
| 1023 |
+
* \sa
|
| 1024 |
+
* ::nvtxRangePushEx
|
| 1025 |
+
* ::nvtxRangePushA
|
| 1026 |
+
* ::nvtxRangePushW
|
| 1027 |
+
*
|
| 1028 |
+
* \version \NVTX_VERSION_2
|
| 1029 |
+
* @{ */
|
| 1030 |
+
NVTX_DECLSPEC int NVTX_API nvtxDomainRangePop(nvtxDomainHandle_t domain);
|
| 1031 |
+
/** @} */
|
| 1032 |
+
|
| 1033 |
+
/* ------------------------------------------------------------------------- */
|
| 1034 |
+
/** \brief Ends a nested thread range.
|
| 1035 |
+
*
|
| 1036 |
+
* \return The level of the range being ended. If an error occurs a negative
|
| 1037 |
+
* value is returned on the current thread.
|
| 1038 |
+
*
|
| 1039 |
+
* \par Example:
|
| 1040 |
+
* \code
|
| 1041 |
+
* nvtxRangePushA("Level 0");
|
| 1042 |
+
* nvtxRangePushW(L"Level 1");
|
| 1043 |
+
* nvtxRangePop();
|
| 1044 |
+
* nvtxRangePop();
|
| 1045 |
+
* \endcode
|
| 1046 |
+
*
|
| 1047 |
+
* \sa
|
| 1048 |
+
* ::nvtxRangePushEx
|
| 1049 |
+
* ::nvtxRangePushA
|
| 1050 |
+
* ::nvtxRangePushW
|
| 1051 |
+
*
|
| 1052 |
+
* \version \NVTX_VERSION_0
|
| 1053 |
+
* @{ */
|
| 1054 |
+
NVTX_DECLSPEC int NVTX_API nvtxRangePop(void);
|
| 1055 |
+
/** @} */
|
| 1056 |
+
|
| 1057 |
+
|
| 1058 |
+
/** @} */ /*END defgroup*/
|
| 1059 |
+
/* ========================================================================= */
|
| 1060 |
+
/** \defgroup RESOURCE_NAMING Resource Naming
|
| 1061 |
+
*
|
| 1062 |
+
* See \ref RESOURCE_NAMING for more details
|
| 1063 |
+
*
|
| 1064 |
+
* @{
|
| 1065 |
+
*/
|
| 1066 |
+
|
| 1067 |
+
|
| 1068 |
+
/* ------------------------------------------------------------------------- */
|
| 1069 |
+
/** \name Functions for Generic Resource Naming*/
|
| 1070 |
+
/* ------------------------------------------------------------------------- */
|
| 1071 |
+
|
| 1072 |
+
/* ------------------------------------------------------------------------- */
|
| 1073 |
+
/** \cond SHOW_HIDDEN
|
| 1074 |
+
* \brief Resource typing helpers.
|
| 1075 |
+
*
|
| 1076 |
+
* Classes are used to make it easy to create a series of resource types
|
| 1077 |
+
* per API without collisions
|
| 1078 |
+
*/
|
| 1079 |
+
#define NVTX_RESOURCE_MAKE_TYPE(CLASS, INDEX) ((((uint32_t)(NVTX_RESOURCE_CLASS_ ## CLASS))<<16)|((uint32_t)(INDEX)))
|
| 1080 |
+
#define NVTX_RESOURCE_CLASS_GENERIC 1
|
| 1081 |
+
/** \endcond */
|
| 1082 |
+
|
| 1083 |
+
/* ------------------------------------------------------------------------- */
|
| 1084 |
+
/** \brief Generic resource type for when a resource class is not available.
|
| 1085 |
+
*
|
| 1086 |
+
* \sa
|
| 1087 |
+
* ::nvtxDomainResourceCreate
|
| 1088 |
+
*
|
| 1089 |
+
* \version \NVTX_VERSION_2
|
| 1090 |
+
*/
|
| 1091 |
+
typedef enum nvtxResourceGenericType_t
|
| 1092 |
+
{
|
| 1093 |
+
NVTX_RESOURCE_TYPE_UNKNOWN = 0,
|
| 1094 |
+
NVTX_RESOURCE_TYPE_GENERIC_POINTER = NVTX_RESOURCE_MAKE_TYPE(GENERIC, 1), /**< Generic pointer assumed to have no collisions with other pointers. */
|
| 1095 |
+
NVTX_RESOURCE_TYPE_GENERIC_HANDLE = NVTX_RESOURCE_MAKE_TYPE(GENERIC, 2), /**< Generic handle assumed to have no collisions with other handles. */
|
| 1096 |
+
NVTX_RESOURCE_TYPE_GENERIC_THREAD_NATIVE = NVTX_RESOURCE_MAKE_TYPE(GENERIC, 3), /**< OS native thread identifier. */
|
| 1097 |
+
NVTX_RESOURCE_TYPE_GENERIC_THREAD_POSIX = NVTX_RESOURCE_MAKE_TYPE(GENERIC, 4) /**< POSIX pthread identifier. */
|
| 1098 |
+
} nvtxResourceGenericType_t;
|
| 1099 |
+
|
| 1100 |
+
|
| 1101 |
+
|
| 1102 |
+
/** \brief Resource Attribute Structure.
|
| 1103 |
+
* \anchor RESOURCE_ATTRIBUTE_STRUCTURE
|
| 1104 |
+
*
|
| 1105 |
+
* This structure is used to describe the attributes of a resource. The layout of
|
| 1106 |
+
* the structure is defined by a specific version of the tools extension
|
| 1107 |
+
* library and can change between different versions of the Tools Extension
|
| 1108 |
+
* library.
|
| 1109 |
+
*
|
| 1110 |
+
* \par Initializing the Attributes
|
| 1111 |
+
*
|
| 1112 |
+
* The caller should always perform the following three tasks when using
|
| 1113 |
+
* attributes:
|
| 1114 |
+
* <ul>
|
| 1115 |
+
* <li>Zero the structure
|
| 1116 |
+
* <li>Set the version field
|
| 1117 |
+
* <li>Set the size field
|
| 1118 |
+
* </ul>
|
| 1119 |
+
*
|
| 1120 |
+
* Zeroing the structure sets all the resource attributes types and values
|
| 1121 |
+
* to the default value.
|
| 1122 |
+
*
|
| 1123 |
+
* The version and size field are used by the Tools Extension
|
| 1124 |
+
* implementation to handle multiple versions of the attributes structure.
|
| 1125 |
+
*
|
| 1126 |
+
* It is recommended that the caller use one of the following to methods
|
| 1127 |
+
* to initialize the event attributes structure:
|
| 1128 |
+
*
|
| 1129 |
+
* \par Method 1: Initializing nvtxEventAttributes for future compatibility
|
| 1130 |
+
* \code
|
| 1131 |
+
* nvtxResourceAttributes_t attribs = {0};
|
| 1132 |
+
* attribs.version = NVTX_VERSION;
|
| 1133 |
+
* attribs.size = NVTX_RESOURCE_ATTRIB_STRUCT_SIZE;
|
| 1134 |
+
* \endcode
|
| 1135 |
+
*
|
| 1136 |
+
* \par Method 2: Initializing nvtxEventAttributes for a specific version
|
| 1137 |
+
* \code
|
| 1138 |
+
* nvtxResourceAttributes_v0 attribs = {0};
|
| 1139 |
+
* attribs.version = 2;
|
| 1140 |
+
* attribs.size = (uint16_t)(sizeof(nvtxResourceAttributes_v0));
|
| 1141 |
+
* \endcode
|
| 1142 |
+
*
|
| 1143 |
+
* If the caller uses Method 1 it is critical that the entire binary
|
| 1144 |
+
* layout of the structure be configured to 0 so that all fields
|
| 1145 |
+
* are initialized to the default value.
|
| 1146 |
+
*
|
| 1147 |
+
* The caller should either use both NVTX_VERSION and
|
| 1148 |
+
* NVTX_RESOURCE_ATTRIB_STRUCT_SIZE (Method 1) or use explicit values
|
| 1149 |
+
* and a versioned type (Method 2). Using a mix of the two methods
|
| 1150 |
+
* will likely cause either source level incompatibility or binary
|
| 1151 |
+
* incompatibility in the future.
|
| 1152 |
+
*
|
| 1153 |
+
* \par Settings Attribute Types and Values
|
| 1154 |
+
*
|
| 1155 |
+
*
|
| 1156 |
+
* \par Example:
|
| 1157 |
+
* \code
|
| 1158 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("example domain");
|
| 1159 |
+
*
|
| 1160 |
+
* // Initialize
|
| 1161 |
+
* nvtxResourceAttributes_t attribs = {0};
|
| 1162 |
+
* attribs.version = NVTX_VERSION;
|
| 1163 |
+
* attribs.size = NVTX_RESOURCE_ATTRIB_STRUCT_SIZE;
|
| 1164 |
+
*
|
| 1165 |
+
* // Configure the Attributes
|
| 1166 |
+
* attribs.identifierType = NVTX_RESOURCE_TYPE_GENERIC_POINTER;
|
| 1167 |
+
* attribs.identifier.pValue = (const void*)pMutex;
|
| 1168 |
+
* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 1169 |
+
* attribs.message.ascii = "Single thread access to database.";
|
| 1170 |
+
*
|
| 1171 |
+
* nvtxResourceHandle_t handle = nvtxDomainResourceCreate(domain, attribs);
|
| 1172 |
+
* \endcode
|
| 1173 |
+
*
|
| 1174 |
+
* \sa
|
| 1175 |
+
* ::nvtxDomainResourceCreate
|
| 1176 |
+
*/
|
| 1177 |
+
typedef struct nvtxResourceAttributes_v0
|
| 1178 |
+
{
|
| 1179 |
+
/**
|
| 1180 |
+
* \brief Version flag of the structure.
|
| 1181 |
+
*
|
| 1182 |
+
* Needs to be set to NVTX_VERSION to indicate the version of NVTX APIs
|
| 1183 |
+
* supported in this header file. This can optionally be overridden to
|
| 1184 |
+
* another version of the tools extension library.
|
| 1185 |
+
*/
|
| 1186 |
+
uint16_t version;
|
| 1187 |
+
|
| 1188 |
+
/**
|
| 1189 |
+
* \brief Size of the structure.
|
| 1190 |
+
*
|
| 1191 |
+
* Needs to be set to the size in bytes of this attribute
|
| 1192 |
+
* structure.
|
| 1193 |
+
*/
|
| 1194 |
+
uint16_t size;
|
| 1195 |
+
|
| 1196 |
+
/**
|
| 1197 |
+
* \brief Identifier type specifies how to interpret the identifier field
|
| 1198 |
+
*
|
| 1199 |
+
* Defines the identifier format of the attribute structure's \ref RESOURCE_IDENTIFIER_FIELD
|
| 1200 |
+
* "identifier" field.
|
| 1201 |
+
*
|
| 1202 |
+
* Default Value is NVTX_RESOURCE_TYPE_UNKNOWN
|
| 1203 |
+
*/
|
| 1204 |
+
int32_t identifierType; /* values from enums following the pattern nvtxResource[name]Type_t */
|
| 1205 |
+
|
| 1206 |
+
/**
|
| 1207 |
+
* \brief Identifier for the resource.
|
| 1208 |
+
* \anchor RESOURCE_IDENTIFIER_FIELD
|
| 1209 |
+
*
|
| 1210 |
+
* An identifier may be a pointer or a handle to an OS or middleware API object.
|
| 1211 |
+
* The resource type will assist in avoiding collisions where handles values may collide.
|
| 1212 |
+
*/
|
| 1213 |
+
union identifier_t
|
| 1214 |
+
{
|
| 1215 |
+
const void* pValue;
|
| 1216 |
+
uint64_t ullValue;
|
| 1217 |
+
} identifier;
|
| 1218 |
+
|
| 1219 |
+
/** \brief Message type specified in this attribute structure.
|
| 1220 |
+
*
|
| 1221 |
+
* Defines the message format of the attribute structure's \ref RESOURCE_MESSAGE_FIELD
|
| 1222 |
+
* "message" field.
|
| 1223 |
+
*
|
| 1224 |
+
* Default Value is NVTX_MESSAGE_UNKNOWN
|
| 1225 |
+
*/
|
| 1226 |
+
int32_t messageType; /* nvtxMessageType_t */
|
| 1227 |
+
|
| 1228 |
+
/** \brief Message assigned to this attribute structure. \anchor RESOURCE_MESSAGE_FIELD
|
| 1229 |
+
*
|
| 1230 |
+
* The text message that is attached to a resource.
|
| 1231 |
+
*/
|
| 1232 |
+
nvtxMessageValue_t message;
|
| 1233 |
+
|
| 1234 |
+
} nvtxResourceAttributes_v0;
|
| 1235 |
+
|
| 1236 |
+
typedef struct nvtxResourceAttributes_v0 nvtxResourceAttributes_t;
|
| 1237 |
+
|
| 1238 |
+
/* \cond SHOW_HIDDEN
|
| 1239 |
+
* \version \NVTX_VERSION_2
|
| 1240 |
+
*/
|
| 1241 |
+
#define NVTX_RESOURCE_ATTRIB_STRUCT_SIZE ( (uint16_t)( sizeof(nvtxResourceAttributes_v0) ) )
|
| 1242 |
+
typedef struct nvtxResourceHandle* nvtxResourceHandle_t;
|
| 1243 |
+
/** \endcond */
|
| 1244 |
+
|
| 1245 |
+
|
| 1246 |
+
|
| 1247 |
+
/* ------------------------------------------------------------------------- */
|
| 1248 |
+
/** \brief Create a resource object to track and associate data with OS and middleware objects
|
| 1249 |
+
*
|
| 1250 |
+
* Allows users to associate an API handle or pointer with a user-provided name.
|
| 1251 |
+
*
|
| 1252 |
+
*
|
| 1253 |
+
* \param domain - Domain to own the resource object
|
| 1254 |
+
* \param attribs - Attributes to be associated with the resource
|
| 1255 |
+
*
|
| 1256 |
+
* \return A handle that represents the newly created resource object.
|
| 1257 |
+
*
|
| 1258 |
+
* \par Example:
|
| 1259 |
+
* \code
|
| 1260 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("example domain");
|
| 1261 |
+
* nvtxResourceAttributes_t attribs = {0};
|
| 1262 |
+
* attribs.version = NVTX_VERSION;
|
| 1263 |
+
* attribs.size = NVTX_RESOURCE_ATTRIB_STRUCT_SIZE;
|
| 1264 |
+
* attribs.identifierType = NVTX_RESOURCE_TYPE_GENERIC_POINTER;
|
| 1265 |
+
* attribs.identifier.pValue = (const void*)pMutex;
|
| 1266 |
+
* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 1267 |
+
* attribs.message.ascii = "Single thread access to database.";
|
| 1268 |
+
* nvtxResourceHandle_t handle = nvtxDomainResourceCreate(domain, attribs);
|
| 1269 |
+
* \endcode
|
| 1270 |
+
*
|
| 1271 |
+
* \sa
|
| 1272 |
+
* ::nvtxResourceAttributes_t
|
| 1273 |
+
* ::nvtxDomainResourceDestroy
|
| 1274 |
+
*
|
| 1275 |
+
* \version \NVTX_VERSION_2
|
| 1276 |
+
* @{ */
|
| 1277 |
+
NVTX_DECLSPEC nvtxResourceHandle_t NVTX_API nvtxDomainResourceCreate(nvtxDomainHandle_t domain, nvtxResourceAttributes_t* attribs);
|
| 1278 |
+
/** @} */
|
| 1279 |
+
|
| 1280 |
+
/* ------------------------------------------------------------------------- */
|
| 1281 |
+
/** \brief Destroy a resource object to track and associate data with OS and middleware objects
|
| 1282 |
+
*
|
| 1283 |
+
* Allows users to associate an API handle or pointer with a user-provided name.
|
| 1284 |
+
*
|
| 1285 |
+
* \param resource - Handle to the resource in which to operate.
|
| 1286 |
+
*
|
| 1287 |
+
* \par Example:
|
| 1288 |
+
* \code
|
| 1289 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("example domain");
|
| 1290 |
+
* nvtxResourceAttributes_t attribs = {0};
|
| 1291 |
+
* attribs.version = NVTX_VERSION;
|
| 1292 |
+
* attribs.size = NVTX_RESOURCE_ATTRIB_STRUCT_SIZE;
|
| 1293 |
+
* attribs.identifierType = NVTX_RESOURCE_TYPE_GENERIC_POINTER;
|
| 1294 |
+
* attribs.identifier.pValue = (const void*)pMutex;
|
| 1295 |
+
* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 1296 |
+
* attribs.message.ascii = "Single thread access to database.";
|
| 1297 |
+
* nvtxResourceHandle_t handle = nvtxDomainResourceCreate(domain, attribs);
|
| 1298 |
+
* nvtxDomainResourceDestroy(handle);
|
| 1299 |
+
* \endcode
|
| 1300 |
+
*
|
| 1301 |
+
* \sa
|
| 1302 |
+
* ::nvtxDomainResourceCreate
|
| 1303 |
+
*
|
| 1304 |
+
* \version \NVTX_VERSION_2
|
| 1305 |
+
* @{ */
|
| 1306 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainResourceDestroy(nvtxResourceHandle_t resource);
|
| 1307 |
+
/** @} */
|
| 1308 |
+
|
| 1309 |
+
|
| 1310 |
+
/** \name Functions for NVTX Category Naming*/
|
| 1311 |
+
|
| 1312 |
+
/* ------------------------------------------------------------------------- */
|
| 1313 |
+
/**
|
| 1314 |
+
* \brief Annotate an NVTX category used within a domain.
|
| 1315 |
+
*
|
| 1316 |
+
* Categories are used to group sets of events. Each category is identified
|
| 1317 |
+
* through a unique ID and that ID is passed into any of the marker/range
|
| 1318 |
+
* events to assign that event to a specific category. The nvtxDomainNameCategory
|
| 1319 |
+
* function calls allow the user to assign a name to a category ID that is
|
| 1320 |
+
* specific to the domain.
|
| 1321 |
+
*
|
| 1322 |
+
* nvtxDomainNameCategory(NULL, category, name) is equivalent to calling
|
| 1323 |
+
* nvtxNameCategory(category, name).
|
| 1324 |
+
*
|
| 1325 |
+
* \param domain - The domain of scoping the category.
|
| 1326 |
+
* \param category - The category ID to name.
|
| 1327 |
+
* \param name - The name of the category.
|
| 1328 |
+
*
|
| 1329 |
+
* \remarks The category names are tracked per domain.
|
| 1330 |
+
*
|
| 1331 |
+
* \par Example:
|
| 1332 |
+
* \code
|
| 1333 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("example");
|
| 1334 |
+
* nvtxDomainNameCategoryA(domain, 1, "Memory Allocation");
|
| 1335 |
+
* nvtxDomainNameCategoryW(domain, 2, L"Memory Transfer");
|
| 1336 |
+
* \endcode
|
| 1337 |
+
*
|
| 1338 |
+
* \version \NVTX_VERSION_2
|
| 1339 |
+
* @{ */
|
| 1340 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainNameCategoryA(nvtxDomainHandle_t domain, uint32_t category, const char* name);
|
| 1341 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainNameCategoryW(nvtxDomainHandle_t domain, uint32_t category, const wchar_t* name);
|
| 1342 |
+
/** @} */
|
| 1343 |
+
|
| 1344 |
+
/** \brief Annotate an NVTX category.
|
| 1345 |
+
*
|
| 1346 |
+
* Categories are used to group sets of events. Each category is identified
|
| 1347 |
+
* through a unique ID and that ID is passed into any of the marker/range
|
| 1348 |
+
* events to assign that event to a specific category. The nvtxNameCategory
|
| 1349 |
+
* function calls allow the user to assign a name to a category ID.
|
| 1350 |
+
*
|
| 1351 |
+
* \param category - The category ID to name.
|
| 1352 |
+
* \param name - The name of the category.
|
| 1353 |
+
*
|
| 1354 |
+
* \remarks The category names are tracked per process.
|
| 1355 |
+
*
|
| 1356 |
+
* \par Example:
|
| 1357 |
+
* \code
|
| 1358 |
+
* nvtxNameCategory(1, "Memory Allocation");
|
| 1359 |
+
* nvtxNameCategory(2, "Memory Transfer");
|
| 1360 |
+
* nvtxNameCategory(3, "Memory Object Lifetime");
|
| 1361 |
+
* \endcode
|
| 1362 |
+
*
|
| 1363 |
+
* \version \NVTX_VERSION_1
|
| 1364 |
+
* @{ */
|
| 1365 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCategoryA(uint32_t category, const char* name);
|
| 1366 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCategoryW(uint32_t category, const wchar_t* name);
|
| 1367 |
+
/** @} */
|
| 1368 |
+
|
| 1369 |
+
/** \name Functions for OS Threads Naming*/
|
| 1370 |
+
|
| 1371 |
+
/* ------------------------------------------------------------------------- */
|
| 1372 |
+
/** \brief Annotate an OS thread.
|
| 1373 |
+
*
|
| 1374 |
+
* Allows the user to name an active thread of the current process. If an
|
| 1375 |
+
* invalid thread ID is provided or a thread ID from a different process is
|
| 1376 |
+
* used the behavior of the tool is implementation dependent.
|
| 1377 |
+
*
|
| 1378 |
+
* The thread name is associated to the default domain. To support domains
|
| 1379 |
+
* use resource objects via ::nvtxDomainResourceCreate.
|
| 1380 |
+
*
|
| 1381 |
+
* \param threadId - The ID of the thread to name.
|
| 1382 |
+
* \param name - The name of the thread.
|
| 1383 |
+
*
|
| 1384 |
+
* \par Example:
|
| 1385 |
+
* \code
|
| 1386 |
+
* nvtxNameOsThread(GetCurrentThreadId(), "MAIN_THREAD");
|
| 1387 |
+
* \endcode
|
| 1388 |
+
*
|
| 1389 |
+
* \version \NVTX_VERSION_1
|
| 1390 |
+
* @{ */
|
| 1391 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameOsThreadA(uint32_t threadId, const char* name);
|
| 1392 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameOsThreadW(uint32_t threadId, const wchar_t* name);
|
| 1393 |
+
/** @} */
|
| 1394 |
+
|
| 1395 |
+
|
| 1396 |
+
/** @} */ /*END defgroup*/
|
| 1397 |
+
/* ========================================================================= */
|
| 1398 |
+
/** \defgroup STRING_REGISTRATION String Registration
|
| 1399 |
+
*
|
| 1400 |
+
* Registered strings are intended to increase performance by lowering instrumentation
|
| 1401 |
+
* overhead. String may be registered once and the handle may be passed in place of
|
| 1402 |
+
* a string where an the APIs may allow.
|
| 1403 |
+
*
|
| 1404 |
+
* See \ref STRING_REGISTRATION for more details
|
| 1405 |
+
*
|
| 1406 |
+
* @{
|
| 1407 |
+
*/
|
| 1408 |
+
|
| 1409 |
+
/* ------------------------------------------------------------------------- */
|
| 1410 |
+
/** \brief Register a string.
|
| 1411 |
+
|
| 1412 |
+
* Registers an immutable string with NVTX. Once registered the pointer used
|
| 1413 |
+
* to register the domain name can be used in nvtxEventAttributes_t
|
| 1414 |
+
* \ref MESSAGE_FIELD. This allows NVTX implementation to skip copying the
|
| 1415 |
+
* contents of the message on each event invocation.
|
| 1416 |
+
*
|
| 1417 |
+
* String registration is an optimization. It is recommended to use string
|
| 1418 |
+
* registration if the string will be passed to an event many times.
|
| 1419 |
+
*
|
| 1420 |
+
* String are not unregistered, except that by unregistering the entire domain
|
| 1421 |
+
*
|
| 1422 |
+
* \param domain - Domain handle. If NULL then the global domain is used.
|
| 1423 |
+
* \param string - A unique pointer to a sequence of characters.
|
| 1424 |
+
*
|
| 1425 |
+
* \return A handle representing the registered string.
|
| 1426 |
+
*
|
| 1427 |
+
* \par Example:
|
| 1428 |
+
* \code
|
| 1429 |
+
* nvtxDomainCreateA("com.nvidia.nvtx.example");
|
| 1430 |
+
* nvtxStringHandle_t message = nvtxDomainRegisterStringA(domain, "registered string");
|
| 1431 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 1432 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 1433 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 1434 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_REGISTERED;
|
| 1435 |
+
* eventAttrib.message.registered = message;
|
| 1436 |
+
* \endcode
|
| 1437 |
+
*
|
| 1438 |
+
* \version \NVTX_VERSION_2
|
| 1439 |
+
* @{ */
|
| 1440 |
+
NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringA(nvtxDomainHandle_t domain, const char* string);
|
| 1441 |
+
NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringW(nvtxDomainHandle_t domain, const wchar_t* string);
|
| 1442 |
+
/** @} */
|
| 1443 |
+
|
| 1444 |
+
/** @} */ /*END defgroup*/
|
| 1445 |
+
/* ========================================================================= */
|
| 1446 |
+
/** \defgroup DOMAINS Domains
|
| 1447 |
+
*
|
| 1448 |
+
* Domains are used to group events to a developer defined scope. Middleware
|
| 1449 |
+
* vendors may also scope their own events to avoid collisions with the
|
| 1450 |
+
* the application developer's events, so that the application developer may
|
| 1451 |
+
* inspect both parts and easily differentiate or filter them. By default
|
| 1452 |
+
* all events are scoped to a global domain where NULL is provided or when
|
| 1453 |
+
* using APIs provided b versions of NVTX below v2
|
| 1454 |
+
*
|
| 1455 |
+
* Domains are intended to be typically long lived objects with the intention
|
| 1456 |
+
* of logically separating events of large modules from each other such as
|
| 1457 |
+
* middleware libraries from each other and the main application.
|
| 1458 |
+
*
|
| 1459 |
+
* See \ref DOMAINS for more details
|
| 1460 |
+
*
|
| 1461 |
+
* @{
|
| 1462 |
+
*/
|
| 1463 |
+
|
| 1464 |
+
/* ------------------------------------------------------------------------- */
|
| 1465 |
+
/** \brief Register a NVTX domain.
|
| 1466 |
+
*
|
| 1467 |
+
* Domains are used to scope annotations. All NVTX_VERSION_0 and NVTX_VERSION_1
|
| 1468 |
+
* annotations are scoped to the global domain. The function nvtxDomainCreate
|
| 1469 |
+
* creates a new named domain.
|
| 1470 |
+
*
|
| 1471 |
+
* Each domain maintains its own nvtxRangePush and nvtxRangePop stack.
|
| 1472 |
+
*
|
| 1473 |
+
* \param name - A unique string representing the domain.
|
| 1474 |
+
*
|
| 1475 |
+
* \return A handle representing the domain.
|
| 1476 |
+
*
|
| 1477 |
+
* \par Example:
|
| 1478 |
+
* \code
|
| 1479 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("com.nvidia.nvtx.example");
|
| 1480 |
+
*
|
| 1481 |
+
* nvtxMarkA("nvtxMarkA to global domain");
|
| 1482 |
+
*
|
| 1483 |
+
* nvtxEventAttributes_t eventAttrib1 = {0};
|
| 1484 |
+
* eventAttrib1.version = NVTX_VERSION;
|
| 1485 |
+
* eventAttrib1.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 1486 |
+
* eventAttrib1.message.ascii = "nvtxDomainMarkEx to global domain";
|
| 1487 |
+
* nvtxDomainMarkEx(NULL, &eventAttrib1);
|
| 1488 |
+
*
|
| 1489 |
+
* nvtxEventAttributes_t eventAttrib2 = {0};
|
| 1490 |
+
* eventAttrib2.version = NVTX_VERSION;
|
| 1491 |
+
* eventAttrib2.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 1492 |
+
* eventAttrib2.message.ascii = "nvtxDomainMarkEx to com.nvidia.nvtx.example";
|
| 1493 |
+
* nvtxDomainMarkEx(domain, &eventAttrib2);
|
| 1494 |
+
* nvtxDomainDestroy(domain);
|
| 1495 |
+
* \endcode
|
| 1496 |
+
*
|
| 1497 |
+
* \sa
|
| 1498 |
+
* ::nvtxDomainDestroy
|
| 1499 |
+
*
|
| 1500 |
+
* \version \NVTX_VERSION_2
|
| 1501 |
+
* @{ */
|
| 1502 |
+
NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateA(const char* name);
|
| 1503 |
+
NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateW(const wchar_t* name);
|
| 1504 |
+
/** @} */
|
| 1505 |
+
|
| 1506 |
+
/* ------------------------------------------------------------------------- */
|
| 1507 |
+
/** \brief Unregister a NVTX domain.
|
| 1508 |
+
*
|
| 1509 |
+
* Unregisters the domain handle and frees all domain specific resources.
|
| 1510 |
+
*
|
| 1511 |
+
* \param domain - the domain handle
|
| 1512 |
+
*
|
| 1513 |
+
* \par Example:
|
| 1514 |
+
* \code
|
| 1515 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("com.nvidia.nvtx.example");
|
| 1516 |
+
* nvtxDomainDestroy(domain);
|
| 1517 |
+
* \endcode
|
| 1518 |
+
*
|
| 1519 |
+
* \sa
|
| 1520 |
+
* ::nvtxDomainCreateA
|
| 1521 |
+
* ::nvtxDomainCreateW
|
| 1522 |
+
*
|
| 1523 |
+
* \version \NVTX_VERSION_2
|
| 1524 |
+
* @{ */
|
| 1525 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainDestroy(nvtxDomainHandle_t domain);
|
| 1526 |
+
/** @} */
|
| 1527 |
+
|
| 1528 |
+
|
| 1529 |
+
/** @} */ /*END defgroup*/
|
| 1530 |
+
/* ========================================================================= */
|
| 1531 |
+
/** \cond SHOW_HIDDEN */
|
| 1532 |
+
|
| 1533 |
+
#ifdef UNICODE
|
| 1534 |
+
#define nvtxMark nvtxMarkW
|
| 1535 |
+
#define nvtxRangeStart nvtxRangeStartW
|
| 1536 |
+
#define nvtxRangePush nvtxRangePushW
|
| 1537 |
+
#define nvtxNameCategory nvtxNameCategoryW
|
| 1538 |
+
#define nvtxNameOsThread nvtxNameOsThreadW
|
| 1539 |
+
/* NVTX_VERSION_2 */
|
| 1540 |
+
#define nvtxDomainCreate nvtxDomainCreateW
|
| 1541 |
+
#define nvtxDomainRegisterString nvtxDomainRegisterStringW
|
| 1542 |
+
#define nvtxDomainNameCategory nvtxDomainNameCategoryW
|
| 1543 |
+
#else
|
| 1544 |
+
#define nvtxMark nvtxMarkA
|
| 1545 |
+
#define nvtxRangeStart nvtxRangeStartA
|
| 1546 |
+
#define nvtxRangePush nvtxRangePushA
|
| 1547 |
+
#define nvtxNameCategory nvtxNameCategoryA
|
| 1548 |
+
#define nvtxNameOsThread nvtxNameOsThreadA
|
| 1549 |
+
/* NVTX_VERSION_2 */
|
| 1550 |
+
#define nvtxDomainCreate nvtxDomainCreateA
|
| 1551 |
+
#define nvtxDomainRegisterString nvtxDomainRegisterStringA
|
| 1552 |
+
#define nvtxDomainNameCategory nvtxDomainNameCategoryA
|
| 1553 |
+
#endif
|
| 1554 |
+
|
| 1555 |
+
/** \endcond */
|
| 1556 |
+
|
| 1557 |
+
#ifdef __cplusplus
|
| 1558 |
+
}
|
| 1559 |
+
#endif /* __cplusplus */
|
| 1560 |
+
|
| 1561 |
+
#endif /* NVTOOLSEXT_H_ */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvToolsExtCuda.h
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2009-2017 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO USER:
|
| 5 |
+
*
|
| 6 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 11 |
+
* of a form of NVIDIA software license agreement.
|
| 12 |
+
*
|
| 13 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 14 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 15 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 16 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 17 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 18 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 19 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 20 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 21 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 22 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 23 |
+
*
|
| 24 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 25 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 26 |
+
* "commercial computer software" and "commercial computer software
|
| 27 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 28 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 29 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 30 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 31 |
+
* source code with only those rights set forth herein.
|
| 32 |
+
*
|
| 33 |
+
* Any use of this source code in individual and commercial software must
|
| 34 |
+
* include, in the user documentation and internal comments to the code,
|
| 35 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
#ifndef NVTOOLSEXT_CUDA_H_
|
| 39 |
+
#define NVTOOLSEXT_CUDA_H_
|
| 40 |
+
|
| 41 |
+
#include "cuda.h"
|
| 42 |
+
|
| 43 |
+
#include "nvToolsExt.h"
|
| 44 |
+
|
| 45 |
+
#ifdef __cplusplus
|
| 46 |
+
extern "C" {
|
| 47 |
+
#endif /* __cplusplus */
|
| 48 |
+
|
| 49 |
+
/* ========================================================================= */
|
| 50 |
+
/** \name Functions for CUDA Resource Naming
|
| 51 |
+
*/
|
| 52 |
+
/** \addtogroup RESOURCE_NAMING
|
| 53 |
+
* \section RESOURCE_NAMING_CUDA CUDA Resource Naming
|
| 54 |
+
*
|
| 55 |
+
* This section covers the API functions that allow to annotate CUDA resources
|
| 56 |
+
* with user-provided names.
|
| 57 |
+
*
|
| 58 |
+
* @{
|
| 59 |
+
*/
|
| 60 |
+
|
| 61 |
+
/* ------------------------------------------------------------------------- */
|
| 62 |
+
/* \cond SHOW_HIDDEN
|
| 63 |
+
* \brief Used to build a non-colliding value for resource types separated class
|
| 64 |
+
* \version \NVTX_VERSION_2
|
| 65 |
+
*/
|
| 66 |
+
#define NVTX_RESOURCE_CLASS_CUDA 4
|
| 67 |
+
/** \endcond */
|
| 68 |
+
|
| 69 |
+
/* ------------------------------------------------------------------------- */
|
| 70 |
+
/** \brief Resource types for CUDA
|
| 71 |
+
*/
|
| 72 |
+
typedef enum nvtxResourceCUDAType_t
|
| 73 |
+
{
|
| 74 |
+
NVTX_RESOURCE_TYPE_CUDA_DEVICE = NVTX_RESOURCE_MAKE_TYPE(CUDA, 1), /* CUdevice */
|
| 75 |
+
NVTX_RESOURCE_TYPE_CUDA_CONTEXT = NVTX_RESOURCE_MAKE_TYPE(CUDA, 2), /* CUcontext */
|
| 76 |
+
NVTX_RESOURCE_TYPE_CUDA_STREAM = NVTX_RESOURCE_MAKE_TYPE(CUDA, 3), /* CUstream */
|
| 77 |
+
NVTX_RESOURCE_TYPE_CUDA_EVENT = NVTX_RESOURCE_MAKE_TYPE(CUDA, 4) /* CUevent */
|
| 78 |
+
} nvtxResourceCUDAType_t;
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
/* ------------------------------------------------------------------------- */
|
| 82 |
+
/** \brief Annotates a CUDA device.
|
| 83 |
+
*
|
| 84 |
+
* Allows the user to associate a CUDA device with a user-provided name.
|
| 85 |
+
*
|
| 86 |
+
* \param device - The handle of the CUDA device to name.
|
| 87 |
+
* \param name - The name of the CUDA device.
|
| 88 |
+
*
|
| 89 |
+
* \version \NVTX_VERSION_1
|
| 90 |
+
* @{ */
|
| 91 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceA(CUdevice device, const char* name);
|
| 92 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceW(CUdevice device, const wchar_t* name);
|
| 93 |
+
/** @} */
|
| 94 |
+
|
| 95 |
+
/* ------------------------------------------------------------------------- */
|
| 96 |
+
/** \brief Annotates a CUDA context.
|
| 97 |
+
*
|
| 98 |
+
* Allows the user to associate a CUDA context with a user-provided name.
|
| 99 |
+
*
|
| 100 |
+
* \param context - The handle of the CUDA context to name.
|
| 101 |
+
* \param name - The name of the CUDA context.
|
| 102 |
+
*
|
| 103 |
+
* \par Example:
|
| 104 |
+
* \code
|
| 105 |
+
* CUresult status = cuCtxCreate( &cuContext, 0, cuDevice );
|
| 106 |
+
* if ( CUDA_SUCCESS != status )
|
| 107 |
+
* goto Error;
|
| 108 |
+
* nvtxNameCuContext(cuContext, "CTX_NAME");
|
| 109 |
+
* \endcode
|
| 110 |
+
*
|
| 111 |
+
* \version \NVTX_VERSION_1
|
| 112 |
+
* @{ */
|
| 113 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuContextA(CUcontext context, const char* name);
|
| 114 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuContextW(CUcontext context, const wchar_t* name);
|
| 115 |
+
/** @} */
|
| 116 |
+
|
| 117 |
+
/* ------------------------------------------------------------------------- */
|
| 118 |
+
/** \brief Annotates a CUDA stream.
|
| 119 |
+
*
|
| 120 |
+
* Allows the user to associate a CUDA stream with a user-provided name.
|
| 121 |
+
*
|
| 122 |
+
* \param stream - The handle of the CUDA stream to name.
|
| 123 |
+
* \param name - The name of the CUDA stream.
|
| 124 |
+
*
|
| 125 |
+
* \version \NVTX_VERSION_1
|
| 126 |
+
* @{ */
|
| 127 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamA(CUstream stream, const char* name);
|
| 128 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamW(CUstream stream, const wchar_t* name);
|
| 129 |
+
/** @} */
|
| 130 |
+
|
| 131 |
+
/* ------------------------------------------------------------------------- */
|
| 132 |
+
/** \brief Annotates a CUDA event.
|
| 133 |
+
*
|
| 134 |
+
* Allows the user to associate a CUDA event with a user-provided name.
|
| 135 |
+
*
|
| 136 |
+
* \param event - The handle of the CUDA event to name.
|
| 137 |
+
* \param name - The name of the CUDA event.
|
| 138 |
+
*
|
| 139 |
+
* \version \NVTX_VERSION_1
|
| 140 |
+
* @{ */
|
| 141 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuEventA(CUevent event, const char* name);
|
| 142 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuEventW(CUevent event, const wchar_t* name);
|
| 143 |
+
/** @} */
|
| 144 |
+
|
| 145 |
+
/** @} */ /* END RESOURCE_NAMING */
|
| 146 |
+
|
| 147 |
+
/* ========================================================================= */
|
| 148 |
+
#ifdef UNICODE
|
| 149 |
+
#define nvtxNameCuDevice nvtxNameCuDeviceW
|
| 150 |
+
#define nvtxNameCuContext nvtxNameCuContextW
|
| 151 |
+
#define nvtxNameCuStream nvtxNameCuStreamW
|
| 152 |
+
#define nvtxNameCuEvent nvtxNameCuEventW
|
| 153 |
+
#else
|
| 154 |
+
#define nvtxNameCuDevice nvtxNameCuDeviceA
|
| 155 |
+
#define nvtxNameCuContext nvtxNameCuContextA
|
| 156 |
+
#define nvtxNameCuStream nvtxNameCuStreamA
|
| 157 |
+
#define nvtxNameCuEvent nvtxNameCuEventA
|
| 158 |
+
#endif
|
| 159 |
+
|
| 160 |
+
#ifdef __cplusplus
|
| 161 |
+
}
|
| 162 |
+
#endif /* __cplusplus */
|
| 163 |
+
|
| 164 |
+
#endif /* NVTOOLSEXT_CUDA_H_ */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvToolsExtCudaRt.h
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2009-2017 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO USER:
|
| 5 |
+
*
|
| 6 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 11 |
+
* of a form of NVIDIA software license agreement.
|
| 12 |
+
*
|
| 13 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 14 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 15 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 16 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 17 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 18 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 19 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 20 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 21 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 22 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 23 |
+
*
|
| 24 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 25 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 26 |
+
* "commercial computer software" and "commercial computer software
|
| 27 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 28 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 29 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 30 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 31 |
+
* source code with only those rights set forth herein.
|
| 32 |
+
*
|
| 33 |
+
* Any use of this source code in individual and commercial software must
|
| 34 |
+
* include, in the user documentation and internal comments to the code,
|
| 35 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
#ifndef NVTOOLSEXT_CUDART_H_
|
| 39 |
+
#define NVTOOLSEXT_CUDART_H_
|
| 40 |
+
|
| 41 |
+
#include "cuda.h"
|
| 42 |
+
#include "driver_types.h"
|
| 43 |
+
|
| 44 |
+
#include "nvToolsExt.h"
|
| 45 |
+
|
| 46 |
+
#ifdef __cplusplus
|
| 47 |
+
extern "C" {
|
| 48 |
+
#endif /* __cplusplus */
|
| 49 |
+
|
| 50 |
+
/* ========================================================================= */
|
| 51 |
+
/** \name Functions for CUDA Resource Naming
|
| 52 |
+
*/
|
| 53 |
+
/** \addtogroup RESOURCE_NAMING
|
| 54 |
+
* \section RESOURCE_NAMING_CUDART CUDA Runtime Resource Naming
|
| 55 |
+
*
|
| 56 |
+
* This section covers the API functions that allow to annotate CUDA resources
|
| 57 |
+
* with user-provided names.
|
| 58 |
+
*
|
| 59 |
+
* @{
|
| 60 |
+
*/
|
| 61 |
+
|
| 62 |
+
/* ------------------------------------------------------------------------- */
|
| 63 |
+
/* \cond SHOW_HIDDEN
|
| 64 |
+
* \brief Used to build a non-colliding value for resource types separated class
|
| 65 |
+
* \version \NVTX_VERSION_2
|
| 66 |
+
*/
|
| 67 |
+
#define NVTX_RESOURCE_CLASS_CUDART 5
|
| 68 |
+
/** \endcond */
|
| 69 |
+
|
| 70 |
+
/* ------------------------------------------------------------------------- */
|
| 71 |
+
/** \brief Resource types for CUDART
|
| 72 |
+
*/
|
| 73 |
+
typedef enum nvtxResourceCUDARTType_t
|
| 74 |
+
{
|
| 75 |
+
NVTX_RESOURCE_TYPE_CUDART_DEVICE = NVTX_RESOURCE_MAKE_TYPE(CUDART, 0), /* int device */
|
| 76 |
+
NVTX_RESOURCE_TYPE_CUDART_STREAM = NVTX_RESOURCE_MAKE_TYPE(CUDART, 1), /* cudaStream_t */
|
| 77 |
+
NVTX_RESOURCE_TYPE_CUDART_EVENT = NVTX_RESOURCE_MAKE_TYPE(CUDART, 2) /* cudaEvent_t */
|
| 78 |
+
} nvtxResourceCUDARTType_t;
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
/* ------------------------------------------------------------------------- */
|
| 82 |
+
/** \brief Annotates a CUDA device.
|
| 83 |
+
*
|
| 84 |
+
* Allows the user to associate a CUDA device with a user-provided name.
|
| 85 |
+
*
|
| 86 |
+
* \param device - The id of the CUDA device to name.
|
| 87 |
+
* \param name - The name of the CUDA device.
|
| 88 |
+
*
|
| 89 |
+
* \version \NVTX_VERSION_1
|
| 90 |
+
* @{ */
|
| 91 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceA(int device, const char* name);
|
| 92 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceW(int device, const wchar_t* name);
|
| 93 |
+
/** @} */
|
| 94 |
+
|
| 95 |
+
/* ------------------------------------------------------------------------- */
|
| 96 |
+
/** \brief Annotates a CUDA stream.
|
| 97 |
+
*
|
| 98 |
+
* Allows the user to associate a CUDA stream with a user-provided name.
|
| 99 |
+
*
|
| 100 |
+
* \param stream - The handle of the CUDA stream to name.
|
| 101 |
+
* \param name - The name of the CUDA stream.
|
| 102 |
+
*
|
| 103 |
+
* \version \NVTX_VERSION_1
|
| 104 |
+
* @{ */
|
| 105 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamA(cudaStream_t stream, const char* name);
|
| 106 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamW(cudaStream_t stream, const wchar_t* name);
|
| 107 |
+
/** @} */
|
| 108 |
+
|
| 109 |
+
/* ------------------------------------------------------------------------- */
|
| 110 |
+
/** \brief Annotates a CUDA event.
|
| 111 |
+
*
|
| 112 |
+
* Allows the user to associate a CUDA event with a user-provided name.
|
| 113 |
+
*
|
| 114 |
+
* \param event - The handle of the CUDA event to name.
|
| 115 |
+
* \param name - The name of the CUDA event.
|
| 116 |
+
*
|
| 117 |
+
* \version \NVTX_VERSION_1
|
| 118 |
+
* @{ */
|
| 119 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventA(cudaEvent_t event, const char* name);
|
| 120 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventW(cudaEvent_t event, const wchar_t* name);
|
| 121 |
+
/** @} */
|
| 122 |
+
|
| 123 |
+
/** @} */ /* END RESOURCE_NAMING */
|
| 124 |
+
|
| 125 |
+
/* ========================================================================= */
|
| 126 |
+
#ifdef UNICODE
|
| 127 |
+
#define nvtxNameCudaDevice nvtxNameCudaDeviceW
|
| 128 |
+
#define nvtxNameCudaStream nvtxNameCudaStreamW
|
| 129 |
+
#define nvtxNameCudaEvent nvtxNameCudaEventW
|
| 130 |
+
#else
|
| 131 |
+
#define nvtxNameCudaDevice nvtxNameCudaDeviceA
|
| 132 |
+
#define nvtxNameCudaStream nvtxNameCudaStreamA
|
| 133 |
+
#define nvtxNameCudaEvent nvtxNameCudaEventA
|
| 134 |
+
#endif
|
| 135 |
+
|
| 136 |
+
#ifdef __cplusplus
|
| 137 |
+
}
|
| 138 |
+
#endif /* __cplusplus */
|
| 139 |
+
|
| 140 |
+
#endif /* NVTOOLSEXT_CUDART_H_ */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvToolsExtOpenCL.h
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2009-2017 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO USER:
|
| 5 |
+
*
|
| 6 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 11 |
+
* of a form of NVIDIA software license agreement.
|
| 12 |
+
*
|
| 13 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 14 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 15 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 16 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 17 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 18 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 19 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 20 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 21 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 22 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 23 |
+
*
|
| 24 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 25 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 26 |
+
* "commercial computer software" and "commercial computer software
|
| 27 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 28 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 29 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 30 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 31 |
+
* source code with only those rights set forth herein.
|
| 32 |
+
*
|
| 33 |
+
* Any use of this source code in individual and commercial software must
|
| 34 |
+
* include, in the user documentation and internal comments to the code,
|
| 35 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
#ifndef NVTOOLSEXT_OPENCL_H_
|
| 39 |
+
#define NVTOOLSEXT_OPENCL_H_
|
| 40 |
+
|
| 41 |
+
#include <CL/cl.h>
|
| 42 |
+
|
| 43 |
+
#include "nvToolsExt.h"
|
| 44 |
+
|
| 45 |
+
#ifdef __cplusplus
|
| 46 |
+
extern "C" {
|
| 47 |
+
#endif /* __cplusplus */
|
| 48 |
+
|
| 49 |
+
/* ========================================================================= */
|
| 50 |
+
/** \name Functions for OpenCL Resource Naming
|
| 51 |
+
*/
|
| 52 |
+
/** \addtogroup RESOURCE_NAMING
|
| 53 |
+
* \section RESOURCE_NAMING_OPENCL OpenCL Resource Naming
|
| 54 |
+
*
|
| 55 |
+
* This section covers the API functions that allow to annotate OpenCL resources
|
| 56 |
+
* with user-provided names.
|
| 57 |
+
*
|
| 58 |
+
* @{
|
| 59 |
+
*/
|
| 60 |
+
|
| 61 |
+
/* ------------------------------------------------------------------------- */
|
| 62 |
+
/* \cond SHOW_HIDDEN
|
| 63 |
+
* \brief Used to build a non-colliding value for resource types separated class
|
| 64 |
+
* \version \NVTX_VERSION_2
|
| 65 |
+
*/
|
| 66 |
+
#define NVTX_RESOURCE_CLASS_OPENCL 6
|
| 67 |
+
/** \endcond */
|
| 68 |
+
|
| 69 |
+
/* ------------------------------------------------------------------------- */
|
| 70 |
+
/** \brief Resource types for OpenCL
|
| 71 |
+
*/
|
| 72 |
+
typedef enum nvtxResourceOpenCLType_t
|
| 73 |
+
{
|
| 74 |
+
NVTX_RESOURCE_TYPE_OPENCL_DEVICE = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 1),
|
| 75 |
+
NVTX_RESOURCE_TYPE_OPENCL_CONTEXT = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 2),
|
| 76 |
+
NVTX_RESOURCE_TYPE_OPENCL_COMMANDQUEUE = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 3),
|
| 77 |
+
NVTX_RESOURCE_TYPE_OPENCL_MEMOBJECT = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 4),
|
| 78 |
+
NVTX_RESOURCE_TYPE_OPENCL_SAMPLER = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 5),
|
| 79 |
+
NVTX_RESOURCE_TYPE_OPENCL_PROGRAM = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 6),
|
| 80 |
+
NVTX_RESOURCE_TYPE_OPENCL_EVENT = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 7)
|
| 81 |
+
} nvtxResourceOpenCLType_t;
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
/* ------------------------------------------------------------------------- */
|
| 85 |
+
/** \brief Annotates an OpenCL device.
|
| 86 |
+
*
|
| 87 |
+
* Allows to associate an OpenCL device with a user-provided name.
|
| 88 |
+
*
|
| 89 |
+
* \param device - The handle of the OpenCL device to name.
|
| 90 |
+
* \param name - The name of the OpenCL device.
|
| 91 |
+
*
|
| 92 |
+
* \version \NVTX_VERSION_1
|
| 93 |
+
* @{ */
|
| 94 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClDeviceA(cl_device_id device, const char* name);
|
| 95 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClDeviceW(cl_device_id device, const wchar_t* name);
|
| 96 |
+
/** @} */
|
| 97 |
+
|
| 98 |
+
/* ------------------------------------------------------------------------- */
|
| 99 |
+
/** \brief Annotates an OpenCL context.
|
| 100 |
+
*
|
| 101 |
+
* Allows to associate an OpenCL context with a user-provided name.
|
| 102 |
+
*
|
| 103 |
+
* \param context - The handle of the OpenCL context to name.
|
| 104 |
+
* \param name - The name of the OpenCL context.
|
| 105 |
+
*
|
| 106 |
+
* \version \NVTX_VERSION_1
|
| 107 |
+
* @{ */
|
| 108 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClContextA(cl_context context, const char* name);
|
| 109 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClContextW(cl_context context, const wchar_t* name);
|
| 110 |
+
/** @} */
|
| 111 |
+
|
| 112 |
+
/* ------------------------------------------------------------------------- */
|
| 113 |
+
/** \brief Annotates an OpenCL command queue.
|
| 114 |
+
*
|
| 115 |
+
* Allows to associate an OpenCL command queue with a user-provided name.
|
| 116 |
+
*
|
| 117 |
+
* \param command_queue - The handle of the OpenCL command queue to name.
|
| 118 |
+
* \param name - The name of the OpenCL command queue.
|
| 119 |
+
*
|
| 120 |
+
* \version \NVTX_VERSION_1
|
| 121 |
+
* @{ */
|
| 122 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClCommandQueueA(cl_command_queue command_queue, const char* name);
|
| 123 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClCommandQueueW(cl_command_queue command_queue, const wchar_t* name);
|
| 124 |
+
/** @} */
|
| 125 |
+
|
| 126 |
+
/* ------------------------------------------------------------------------- */
|
| 127 |
+
/** \brief Annotates an OpenCL memory object.
|
| 128 |
+
*
|
| 129 |
+
* Allows to associate an OpenCL memory object with a user-provided name.
|
| 130 |
+
*
|
| 131 |
+
* \param memobj - The handle of the OpenCL memory object to name.
|
| 132 |
+
* \param name - The name of the OpenCL memory object.
|
| 133 |
+
*
|
| 134 |
+
* \version \NVTX_VERSION_1
|
| 135 |
+
* @{ */
|
| 136 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClMemObjectA(cl_mem memobj, const char* name);
|
| 137 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClMemObjectW(cl_mem memobj, const wchar_t* name);
|
| 138 |
+
/** @} */
|
| 139 |
+
|
| 140 |
+
/* ------------------------------------------------------------------------- */
|
| 141 |
+
/** \brief Annotates an OpenCL sampler.
|
| 142 |
+
*
|
| 143 |
+
* Allows to associate an OpenCL sampler with a user-provided name.
|
| 144 |
+
*
|
| 145 |
+
* \param sampler - The handle of the OpenCL sampler to name.
|
| 146 |
+
* \param name - The name of the OpenCL sampler.
|
| 147 |
+
*
|
| 148 |
+
* \version \NVTX_VERSION_1
|
| 149 |
+
* @{ */
|
| 150 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClSamplerA(cl_sampler sampler, const char* name);
|
| 151 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClSamplerW(cl_sampler sampler, const wchar_t* name);
|
| 152 |
+
/** @} */
|
| 153 |
+
|
| 154 |
+
/* ------------------------------------------------------------------------- */
|
| 155 |
+
/** \brief Annotates an OpenCL program.
|
| 156 |
+
*
|
| 157 |
+
* Allows to associate an OpenCL program with a user-provided name.
|
| 158 |
+
*
|
| 159 |
+
* \param program - The handle of the OpenCL program to name.
|
| 160 |
+
* \param name - The name of the OpenCL program.
|
| 161 |
+
*
|
| 162 |
+
* \code
|
| 163 |
+
* cpProgram = clCreateProgramWithSource(cxGPUContext, 1,
|
| 164 |
+
* (const char **) &cSourceCL, &program_length, &ciErrNum);
|
| 165 |
+
* shrCheckErrorEX(ciErrNum, CL_SUCCESS, pCleanup);
|
| 166 |
+
* nvtxNameClProgram(cpProgram, L"PROGRAM_NAME");
|
| 167 |
+
* \endcode
|
| 168 |
+
*
|
| 169 |
+
* \version \NVTX_VERSION_1
|
| 170 |
+
* @{ */
|
| 171 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClProgramA(cl_program program, const char* name);
|
| 172 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClProgramW(cl_program program, const wchar_t* name);
|
| 173 |
+
/** @} */
|
| 174 |
+
|
| 175 |
+
/* ------------------------------------------------------------------------- */
|
| 176 |
+
/** \brief Annotates an OpenCL event.
|
| 177 |
+
*
|
| 178 |
+
* Allows to associate an OpenCL event with a user-provided name.
|
| 179 |
+
*
|
| 180 |
+
* \param evnt - The handle of the OpenCL event to name.
|
| 181 |
+
* \param name - The name of the OpenCL event.
|
| 182 |
+
*
|
| 183 |
+
* \version \NVTX_VERSION_1
|
| 184 |
+
* @{ */
|
| 185 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClEventA(cl_event evnt, const char* name);
|
| 186 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClEventW(cl_event evnt, const wchar_t* name);
|
| 187 |
+
/** @} */
|
| 188 |
+
|
| 189 |
+
/** @} */ /* END RESOURCE_NAMING */
|
| 190 |
+
|
| 191 |
+
/* ========================================================================= */
|
| 192 |
+
#ifdef UNICODE
|
| 193 |
+
#define nvtxNameClDevice nvtxNameClDeviceW
|
| 194 |
+
#define nvtxNameClContext nvtxNameClContextW
|
| 195 |
+
#define nvtxNameClCommandQueue nvtxNameClCommandQueueW
|
| 196 |
+
#define nvtxNameClMemObject nvtxNameClMemObjectW
|
| 197 |
+
#define nvtxNameClSampler nvtxNameClSamplerW
|
| 198 |
+
#define nvtxNameClProgram nvtxNameClProgramW
|
| 199 |
+
#define nvtxNameClEvent nvtxNameClEventW
|
| 200 |
+
#else
|
| 201 |
+
#define nvtxNameClDevice nvtxNameClDeviceA
|
| 202 |
+
#define nvtxNameClContext nvtxNameClContextA
|
| 203 |
+
#define nvtxNameClCommandQueue nvtxNameClCommandQueueA
|
| 204 |
+
#define nvtxNameClMemObject nvtxNameClMemObjectA
|
| 205 |
+
#define nvtxNameClSampler nvtxNameClSamplerA
|
| 206 |
+
#define nvtxNameClProgram nvtxNameClProgramA
|
| 207 |
+
#define nvtxNameClEvent nvtxNameClEventA
|
| 208 |
+
#endif
|
| 209 |
+
|
| 210 |
+
#ifdef __cplusplus
|
| 211 |
+
}
|
| 212 |
+
#endif /* __cplusplus */
|
| 213 |
+
|
| 214 |
+
#endif /* NVTOOLSEXT_OPENCL_H_ */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvToolsExtSync.h
ADDED
|
@@ -0,0 +1,406 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2009-2017 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO USER:
|
| 5 |
+
*
|
| 6 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 11 |
+
* of a form of NVIDIA software license agreement.
|
| 12 |
+
*
|
| 13 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 14 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 15 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 16 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 17 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 18 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 19 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 20 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 21 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 22 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 23 |
+
*
|
| 24 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 25 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 26 |
+
* "commercial computer software" and "commercial computer software
|
| 27 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 28 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 29 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 30 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 31 |
+
* source code with only those rights set forth herein.
|
| 32 |
+
*
|
| 33 |
+
* Any use of this source code in individual and commercial software must
|
| 34 |
+
* include, in the user documentation and internal comments to the code,
|
| 35 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
#ifndef NVTOOLSEXT_SYNC_H_
|
| 39 |
+
#define NVTOOLSEXT_SYNC_H_
|
| 40 |
+
|
| 41 |
+
#include "nvToolsExt.h"
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
#ifdef __cplusplus
|
| 45 |
+
extern "C" {
|
| 46 |
+
#endif /* __cplusplus */
|
| 47 |
+
|
| 48 |
+
/* \cond SHOW_HIDDEN
|
| 49 |
+
* \version \NVTX_VERSION_2
|
| 50 |
+
*/
|
| 51 |
+
#define NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE ( (uint16_t)( sizeof(nvtxSyncUserAttributes_v0) ) )
|
| 52 |
+
/** \endcond */
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
/**
|
| 56 |
+
* \page PAGE_SYNCHRONIZATION Synchronization
|
| 57 |
+
*
|
| 58 |
+
* This section covers a subset of the API that allow users to track additional
|
| 59 |
+
* synchronization details of their application. Naming OS synchronization primitives
|
| 60 |
+
* may allow users to better understand the data collected by traced synchronization
|
| 61 |
+
* APIs. Additionally, a user defined synchronization object can allow the users to
|
| 62 |
+
* to tell the tools when the user is building their own synchronization system
|
| 63 |
+
* that do not rely on the OS to provide behaviors and instead use techniques like
|
| 64 |
+
* atomic operations and spinlocks.
|
| 65 |
+
*
|
| 66 |
+
* See module \ref SYNCHRONIZATION for details.
|
| 67 |
+
*
|
| 68 |
+
* \par Example:
|
| 69 |
+
* \code
|
| 70 |
+
* class MyMutex
|
| 71 |
+
* {
|
| 72 |
+
* volatile long bLocked;
|
| 73 |
+
* nvtxSyncUser_t hSync;
|
| 74 |
+
* public:
|
| 75 |
+
* MyMutex(const char* name, nvtxDomainHandle_t d){
|
| 76 |
+
* bLocked = 0;
|
| 77 |
+
*
|
| 78 |
+
* nvtxSyncUserAttributes_t attribs = { 0 };
|
| 79 |
+
* attribs.version = NVTX_VERSION;
|
| 80 |
+
* attribs.size = NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE;
|
| 81 |
+
* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 82 |
+
* attribs.message.ascii = name;
|
| 83 |
+
* hSync = nvtxDomainSyncUserCreate(d, &attribs);
|
| 84 |
+
* }
|
| 85 |
+
*
|
| 86 |
+
* ~MyMutex() {
|
| 87 |
+
* nvtxDomainSyncUserDestroy(hSync);
|
| 88 |
+
* }
|
| 89 |
+
*
|
| 90 |
+
* bool Lock() {
|
| 91 |
+
* nvtxDomainSyncUserAcquireStart(hSync);
|
| 92 |
+
* bool acquired = __sync_bool_compare_and_swap(&bLocked, 0, 1);//atomic compiler intrinsic
|
| 93 |
+
|
| 94 |
+
* if (acquired) {
|
| 95 |
+
* nvtxDomainSyncUserAcquireSuccess(hSync);
|
| 96 |
+
* }
|
| 97 |
+
* else {
|
| 98 |
+
* nvtxDomainSyncUserAcquireFailed(hSync);
|
| 99 |
+
* }
|
| 100 |
+
* return acquired;
|
| 101 |
+
* }
|
| 102 |
+
|
| 103 |
+
* void Unlock() {
|
| 104 |
+
* nvtxDomainSyncUserReleasing(hSync);
|
| 105 |
+
* bLocked = false;
|
| 106 |
+
* }
|
| 107 |
+
* };
|
| 108 |
+
* \endcode
|
| 109 |
+
*
|
| 110 |
+
* \version \NVTX_VERSION_2
|
| 111 |
+
*/
|
| 112 |
+
|
| 113 |
+
/* ------------------------------------------------------------------------- */
|
| 114 |
+
/* \cond SHOW_HIDDEN
|
| 115 |
+
* \brief Used to build a non-colliding value for resource types separated class
|
| 116 |
+
* \version \NVTX_VERSION_2
|
| 117 |
+
*/
|
| 118 |
+
#define NVTX_RESOURCE_CLASS_SYNC_OS 2 /**< Synchronization objects that are OS specific. */
|
| 119 |
+
#define NVTX_RESOURCE_CLASS_SYNC_PTHREAD 3 /**< Synchronization objects that are from the POSIX Threads API (pthread)*/
|
| 120 |
+
/** \endcond */
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
/* ------------------------------------------------------------------------- */
|
| 124 |
+
/** \defgroup SYNCHRONIZATION Synchronization
|
| 125 |
+
* See page \ref PAGE_SYNCHRONIZATION.
|
| 126 |
+
* @{
|
| 127 |
+
*/
|
| 128 |
+
|
| 129 |
+
/** \brief Resource type values for OSs with POSIX Thread API support
|
| 130 |
+
*/
|
| 131 |
+
typedef enum nvtxResourceSyncPosixThreadType_t
|
| 132 |
+
{
|
| 133 |
+
NVTX_RESOURCE_TYPE_SYNC_PTHREAD_MUTEX = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 1), /* pthread_mutex_t */
|
| 134 |
+
NVTX_RESOURCE_TYPE_SYNC_PTHREAD_CONDITION = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 2), /* pthread_cond_t */
|
| 135 |
+
NVTX_RESOURCE_TYPE_SYNC_PTHREAD_RWLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 3), /* pthread_rwlock_t */
|
| 136 |
+
NVTX_RESOURCE_TYPE_SYNC_PTHREAD_BARRIER = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 4), /* pthread_barrier_t */
|
| 137 |
+
NVTX_RESOURCE_TYPE_SYNC_PTHREAD_SPINLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 5), /* pthread_spinlock_t */
|
| 138 |
+
NVTX_RESOURCE_TYPE_SYNC_PTHREAD_ONCE = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 6) /* pthread_once_t */
|
| 139 |
+
} nvtxResourceSyncPosixThreadType_t;
|
| 140 |
+
|
| 141 |
+
/** \brief Resource type values for Windows OSs
|
| 142 |
+
*/
|
| 143 |
+
typedef enum nvtxResourceSyncWindowsType_t
|
| 144 |
+
{
|
| 145 |
+
NVTX_RESOURCE_TYPE_SYNC_WINDOWS_MUTEX = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 1),
|
| 146 |
+
NVTX_RESOURCE_TYPE_SYNC_WINDOWS_SEMAPHORE = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 2),
|
| 147 |
+
NVTX_RESOURCE_TYPE_SYNC_WINDOWS_EVENT = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 3),
|
| 148 |
+
NVTX_RESOURCE_TYPE_SYNC_WINDOWS_CRITICAL_SECTION = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 4),
|
| 149 |
+
NVTX_RESOURCE_TYPE_SYNC_WINDOWS_SRWLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 5)
|
| 150 |
+
} nvtxResourceSyncWindowsType_t;
|
| 151 |
+
|
| 152 |
+
/** \brief Resource type values for Linux and Linux derived OSs such as Android
|
| 153 |
+
* \sa
|
| 154 |
+
* ::nvtxResourceSyncPosixThreadType_t
|
| 155 |
+
*/
|
| 156 |
+
typedef enum nvtxResourceSyncLinuxType_t
|
| 157 |
+
{
|
| 158 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_MUTEX = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 1),
|
| 159 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_FUTEX = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 2),
|
| 160 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_SEMAPHORE = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 3),
|
| 161 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_COMPLETION = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 4),
|
| 162 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_SPINLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 5),
|
| 163 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_SEQLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 6),
|
| 164 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_RCU = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 7)
|
| 165 |
+
} nvtxResourceSyncLinuxType_t;
|
| 166 |
+
|
| 167 |
+
/** \brief Resource type values for Android come from Linux.
|
| 168 |
+
* \sa
|
| 169 |
+
* ::nvtxResourceSyncLinuxType_t
|
| 170 |
+
* ::nvtxResourceSyncPosixThreadType_t
|
| 171 |
+
*/
|
| 172 |
+
typedef enum nvtxResourceSyncLinuxType_t nvtxResourceSyncAndroidType_t;
|
| 173 |
+
|
| 174 |
+
/** \brief User Defined Synchronization Object Handle .
|
| 175 |
+
* \anchor SYNCUSER_HANDLE_STRUCTURE
|
| 176 |
+
*
|
| 177 |
+
* This structure is opaque to the user and is used as a handle to reference
|
| 178 |
+
* a user defined syncrhonization object. The tools will return a pointer through the API for the application
|
| 179 |
+
* to hold on it's behalf to reference the string in the future.
|
| 180 |
+
*
|
| 181 |
+
*/
|
| 182 |
+
typedef struct nvtxSyncUser* nvtxSyncUser_t;
|
| 183 |
+
|
| 184 |
+
/** \brief User Defined Synchronization Object Attributes Structure.
|
| 185 |
+
* \anchor USERDEF_SYNC_ATTRIBUTES_STRUCTURE
|
| 186 |
+
*
|
| 187 |
+
* This structure is used to describe the attributes of a user defined synchronization
|
| 188 |
+
* object. The layout of the structure is defined by a specific version of the tools
|
| 189 |
+
* extension library and can change between different versions of the Tools Extension
|
| 190 |
+
* library.
|
| 191 |
+
*
|
| 192 |
+
* \par Initializing the Attributes
|
| 193 |
+
*
|
| 194 |
+
* The caller should always perform the following three tasks when using
|
| 195 |
+
* attributes:
|
| 196 |
+
* <ul>
|
| 197 |
+
* <li>Zero the structure
|
| 198 |
+
* <li>Set the version field
|
| 199 |
+
* <li>Set the size field
|
| 200 |
+
* </ul>
|
| 201 |
+
*
|
| 202 |
+
* Zeroing the structure sets all the event attributes types and values
|
| 203 |
+
* to the default value.
|
| 204 |
+
*
|
| 205 |
+
* The version and size field are used by the Tools Extension
|
| 206 |
+
* implementation to handle multiple versions of the attributes structure.
|
| 207 |
+
*
|
| 208 |
+
* It is recommended that the caller use one of the following to methods
|
| 209 |
+
* to initialize the event attributes structure:
|
| 210 |
+
*
|
| 211 |
+
* \par Method 1: Initializing nvtxEventAttributes for future compatibility
|
| 212 |
+
* \code
|
| 213 |
+
* nvtxSyncUserAttributes_t attribs = {0};
|
| 214 |
+
* attribs.version = NVTX_VERSION;
|
| 215 |
+
* attribs.size = NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE;
|
| 216 |
+
* \endcode
|
| 217 |
+
*
|
| 218 |
+
* \par Method 2: Initializing nvtxSyncUserAttributes_t for a specific version
|
| 219 |
+
* \code
|
| 220 |
+
* nvtxSyncUserAttributes_t attribs = {0};
|
| 221 |
+
* attribs.version = 1;
|
| 222 |
+
* attribs.size = (uint16_t)(sizeof(nvtxSyncUserAttributes_t));
|
| 223 |
+
* \endcode
|
| 224 |
+
*
|
| 225 |
+
* If the caller uses Method 1 it is critical that the entire binary
|
| 226 |
+
* layout of the structure be configured to 0 so that all fields
|
| 227 |
+
* are initialized to the default value.
|
| 228 |
+
*
|
| 229 |
+
* The caller should either use both NVTX_VERSION and
|
| 230 |
+
* NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE (Method 1) or use explicit values
|
| 231 |
+
* and a versioned type (Method 2). Using a mix of the two methods
|
| 232 |
+
* will likely cause either source level incompatibility or binary
|
| 233 |
+
* incompatibility in the future.
|
| 234 |
+
*
|
| 235 |
+
* \par Settings Attribute Types and Values
|
| 236 |
+
*
|
| 237 |
+
*
|
| 238 |
+
* \par Example:
|
| 239 |
+
* \code
|
| 240 |
+
* // Initialize
|
| 241 |
+
* nvtxSyncUserAttributes_t attribs = {0};
|
| 242 |
+
* attribs.version = NVTX_VERSION;
|
| 243 |
+
* attribs.size = NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE;
|
| 244 |
+
*
|
| 245 |
+
* // Configure the Attributes
|
| 246 |
+
* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 247 |
+
* attribs.message.ascii = "Example";
|
| 248 |
+
* \endcode
|
| 249 |
+
*
|
| 250 |
+
* \sa
|
| 251 |
+
* ::nvtxDomainSyncUserCreate
|
| 252 |
+
*/
|
| 253 |
+
typedef struct nvtxSyncUserAttributes_v0
|
| 254 |
+
{
|
| 255 |
+
/**
|
| 256 |
+
* \brief Version flag of the structure.
|
| 257 |
+
*
|
| 258 |
+
* Needs to be set to NVTX_VERSION to indicate the version of NVTX APIs
|
| 259 |
+
* supported in this header file. This can optionally be overridden to
|
| 260 |
+
* another version of the tools extension library.
|
| 261 |
+
*/
|
| 262 |
+
uint16_t version;
|
| 263 |
+
|
| 264 |
+
/**
|
| 265 |
+
* \brief Size of the structure.
|
| 266 |
+
*
|
| 267 |
+
* Needs to be set to the size in bytes of the event attribute
|
| 268 |
+
* structure used to specify the event.
|
| 269 |
+
*/
|
| 270 |
+
uint16_t size;
|
| 271 |
+
|
| 272 |
+
/** \brief Message type specified in this attribute structure.
|
| 273 |
+
*
|
| 274 |
+
* Defines the message format of the attribute structure's \ref nvtxSyncUserAttributes_v0::message
|
| 275 |
+
* "message" field.
|
| 276 |
+
*
|
| 277 |
+
* Default Value is NVTX_MESSAGE_UNKNOWN
|
| 278 |
+
*/
|
| 279 |
+
int32_t messageType; /* nvtxMessageType_t */
|
| 280 |
+
|
| 281 |
+
/** \brief Message assigned to this attribute structure.
|
| 282 |
+
*
|
| 283 |
+
* The text message that is attached to an event.
|
| 284 |
+
*/
|
| 285 |
+
nvtxMessageValue_t message;
|
| 286 |
+
|
| 287 |
+
} nvtxSyncUserAttributes_v0;
|
| 288 |
+
|
| 289 |
+
typedef struct nvtxSyncUserAttributes_v0 nvtxSyncUserAttributes_t;
|
| 290 |
+
|
| 291 |
+
/* ------------------------------------------------------------------------- */
|
| 292 |
+
/** \brief Create a user defined synchronization object
|
| 293 |
+
* This is used to track non-OS synchronization working with spinlocks and atomics
|
| 294 |
+
*
|
| 295 |
+
* \param domain - Domain to own the resource
|
| 296 |
+
* \param attribs - A structure to assign multiple attributes to the object.
|
| 297 |
+
*
|
| 298 |
+
* \return A handle that represents the newly created user defined synchronization object.
|
| 299 |
+
*
|
| 300 |
+
* \sa
|
| 301 |
+
* ::nvtxDomainSyncUserCreate
|
| 302 |
+
* ::nvtxDomainSyncUserDestroy
|
| 303 |
+
* ::nvtxDomainSyncUserAcquireStart
|
| 304 |
+
* ::nvtxDomainSyncUserAcquireFailed
|
| 305 |
+
* ::nvtxDomainSyncUserAcquireSuccess
|
| 306 |
+
* ::nvtxDomainSyncUserReleasing
|
| 307 |
+
*
|
| 308 |
+
* \version \NVTX_VERSION_2
|
| 309 |
+
*/
|
| 310 |
+
NVTX_DECLSPEC nvtxSyncUser_t NVTX_API nvtxDomainSyncUserCreate(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t* attribs);
|
| 311 |
+
|
| 312 |
+
/* ------------------------------------------------------------------------- */
|
| 313 |
+
/** \brief Destroy a user defined synchronization object
|
| 314 |
+
* This is used to track non-OS synchronization working with spinlocks and atomics
|
| 315 |
+
*
|
| 316 |
+
* \param handle - A handle to the object to operate on.
|
| 317 |
+
*
|
| 318 |
+
* \sa
|
| 319 |
+
* ::nvtxDomainSyncUserCreate
|
| 320 |
+
* ::nvtxDomainSyncUserDestroy
|
| 321 |
+
* ::nvtxDomainSyncUserAcquireStart
|
| 322 |
+
* ::nvtxDomainSyncUserAcquireFailed
|
| 323 |
+
* ::nvtxDomainSyncUserAcquireSuccess
|
| 324 |
+
* ::nvtxDomainSyncUserReleasing
|
| 325 |
+
*
|
| 326 |
+
* \version \NVTX_VERSION_2
|
| 327 |
+
*/
|
| 328 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserDestroy(nvtxSyncUser_t handle);
|
| 329 |
+
|
| 330 |
+
/* ------------------------------------------------------------------------- */
|
| 331 |
+
/** \brief Signal to tools that an attempt to acquire a user defined synchronization object
|
| 332 |
+
*
|
| 333 |
+
* \param handle - A handle to the object to operate on.
|
| 334 |
+
*
|
| 335 |
+
* \sa
|
| 336 |
+
* ::nvtxDomainSyncUserCreate
|
| 337 |
+
* ::nvtxDomainSyncUserDestroy
|
| 338 |
+
* ::nvtxDomainSyncUserAcquireStart
|
| 339 |
+
* ::nvtxDomainSyncUserAcquireFailed
|
| 340 |
+
* ::nvtxDomainSyncUserAcquireSuccess
|
| 341 |
+
* ::nvtxDomainSyncUserReleasing
|
| 342 |
+
*
|
| 343 |
+
* \version \NVTX_VERSION_2
|
| 344 |
+
*/
|
| 345 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireStart(nvtxSyncUser_t handle);
|
| 346 |
+
|
| 347 |
+
/* ------------------------------------------------------------------------- */
|
| 348 |
+
/** \brief Signal to tools of failure in acquiring a user defined synchronization object
|
| 349 |
+
* This should be called after \ref nvtxDomainSyncUserAcquireStart
|
| 350 |
+
*
|
| 351 |
+
* \param handle - A handle to the object to operate on.
|
| 352 |
+
*
|
| 353 |
+
* \sa
|
| 354 |
+
* ::nvtxDomainSyncUserCreate
|
| 355 |
+
* ::nvtxDomainSyncUserDestroy
|
| 356 |
+
* ::nvtxDomainSyncUserAcquireStart
|
| 357 |
+
* ::nvtxDomainSyncUserAcquireFailed
|
| 358 |
+
* ::nvtxDomainSyncUserAcquireSuccess
|
| 359 |
+
* ::nvtxDomainSyncUserReleasing
|
| 360 |
+
*
|
| 361 |
+
* \version \NVTX_VERSION_2
|
| 362 |
+
*/NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireFailed(nvtxSyncUser_t handle);
|
| 363 |
+
|
| 364 |
+
/* ------------------------------------------------------------------------- */
|
| 365 |
+
/** \brief Signal to tools of success in acquiring a user defined synchronization object
|
| 366 |
+
* This should be called after \ref nvtxDomainSyncUserAcquireStart.
|
| 367 |
+
*
|
| 368 |
+
* \param handle - A handle to the object to operate on.
|
| 369 |
+
*
|
| 370 |
+
* \sa
|
| 371 |
+
* ::nvtxDomainSyncUserCreate
|
| 372 |
+
* ::nvtxDomainSyncUserDestroy
|
| 373 |
+
* ::nvtxDomainSyncUserAcquireStart
|
| 374 |
+
* ::nvtxDomainSyncUserAcquireFailed
|
| 375 |
+
* ::nvtxDomainSyncUserAcquireSuccess
|
| 376 |
+
* ::nvtxDomainSyncUserReleasing
|
| 377 |
+
*
|
| 378 |
+
* \version \NVTX_VERSION_2
|
| 379 |
+
*/NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireSuccess(nvtxSyncUser_t handle);
|
| 380 |
+
|
| 381 |
+
/* ------------------------------------------------------------------------- */
|
| 382 |
+
/** \brief Signal to tools of releasing a reservation on user defined synchronization object
|
| 383 |
+
* This should be called after \ref nvtxDomainSyncUserAcquireSuccess.
|
| 384 |
+
*
|
| 385 |
+
* \param handle - A handle to the object to operate on.
|
| 386 |
+
*
|
| 387 |
+
* \sa
|
| 388 |
+
* ::nvtxDomainSyncUserCreate
|
| 389 |
+
* ::nvtxDomainSyncUserDestroy
|
| 390 |
+
* ::nvtxDomainSyncUserAcquireStart
|
| 391 |
+
* ::nvtxDomainSyncUserAcquireFailed
|
| 392 |
+
* ::nvtxDomainSyncUserAcquireSuccess
|
| 393 |
+
* ::nvtxDomainSyncUserReleasing
|
| 394 |
+
*
|
| 395 |
+
* \version \NVTX_VERSION_2
|
| 396 |
+
*/
|
| 397 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserReleasing(nvtxSyncUser_t handle);
|
| 398 |
+
|
| 399 |
+
|
| 400 |
+
/** @} */ /*END defgroup*/
|
| 401 |
+
|
| 402 |
+
#ifdef __cplusplus
|
| 403 |
+
}
|
| 404 |
+
#endif /* __cplusplus */
|
| 405 |
+
|
| 406 |
+
#endif /* NVTOOLSEXT_SYNC_H_ */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvToolsExt.h
ADDED
|
@@ -0,0 +1,1499 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2009-2016 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO USER:
|
| 5 |
+
*
|
| 6 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 11 |
+
* of a form of NVIDIA software license agreement.
|
| 12 |
+
*
|
| 13 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 14 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 15 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 16 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 17 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 18 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 19 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 20 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 21 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 22 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 23 |
+
*
|
| 24 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 25 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 26 |
+
* "commercial computer software" and "commercial computer software
|
| 27 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 28 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 29 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 30 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 31 |
+
* source code with only those rights set forth herein.
|
| 32 |
+
*
|
| 33 |
+
* Any use of this source code in individual and commercial software must
|
| 34 |
+
* include, in the user documentation and internal comments to the code,
|
| 35 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
/** \file nvToolsExt.h
|
| 39 |
+
*/
|
| 40 |
+
|
| 41 |
+
/* ========================================================================= */
|
| 42 |
+
/** \mainpage
|
| 43 |
+
* \tableofcontents
|
| 44 |
+
* \section INTRODUCTION Introduction
|
| 45 |
+
*
|
| 46 |
+
* The NVIDIA Tools Extension library is a set of functions that a
|
| 47 |
+
* developer can use to provide additional information to tools.
|
| 48 |
+
* The additional information is used by the tool to improve
|
| 49 |
+
* analysis and visualization of data.
|
| 50 |
+
*
|
| 51 |
+
* The library introduces close to zero overhead if no tool is
|
| 52 |
+
* attached to the application. The overhead when a tool is
|
| 53 |
+
* attached is specific to the tool.
|
| 54 |
+
*
|
| 55 |
+
* \section INITIALIZATION_SECTION Initialization
|
| 56 |
+
*
|
| 57 |
+
* Typically the tool's library that plugs into NVTX is indirectly
|
| 58 |
+
* loaded via enviromental properties that are platform specific.
|
| 59 |
+
* For some platform or special cases, the user may be required
|
| 60 |
+
* to instead explicity initialize instead though. This can also
|
| 61 |
+
* be helpful to control when the API loads a tool's library instead
|
| 62 |
+
* of what would typically be the first function call to emit info.
|
| 63 |
+
* For these rare case, see \ref INITIALIZATION for additional information.
|
| 64 |
+
*
|
| 65 |
+
* \section MARKERS_AND_RANGES Markers and Ranges
|
| 66 |
+
*
|
| 67 |
+
* Markers and ranges are used to describe events at a specific time (markers)
|
| 68 |
+
* or over a time span (ranges) during the execution of the application
|
| 69 |
+
* respectively.
|
| 70 |
+
*
|
| 71 |
+
* \subsection MARKERS Markers
|
| 72 |
+
*
|
| 73 |
+
* Markers denote specific moments in time.
|
| 74 |
+
*
|
| 75 |
+
*
|
| 76 |
+
* See \ref DOMAINS and \ref EVENT_ATTRIBUTES for additional information on
|
| 77 |
+
* how to specify the domain.
|
| 78 |
+
*
|
| 79 |
+
* \subsection THREAD_RANGES Thread Ranges
|
| 80 |
+
*
|
| 81 |
+
* Thread ranges denote nested time ranges. Nesting is maintained per thread
|
| 82 |
+
* per domain and does not require any additional correlation mechanism. The
|
| 83 |
+
* duration of a thread range is defined by the corresponding pair of
|
| 84 |
+
* nvtxRangePush* to nvtxRangePop API calls.
|
| 85 |
+
*
|
| 86 |
+
* See \ref DOMAINS and \ref EVENT_ATTRIBUTES for additional information on
|
| 87 |
+
* how to specify the domain.
|
| 88 |
+
*
|
| 89 |
+
* \subsection PROCESS_RANGES Process Ranges
|
| 90 |
+
*
|
| 91 |
+
* Process ranges denote a time span that can expose arbitrary concurrency, as
|
| 92 |
+
* opposed to thread ranges that only support nesting. In addition the range
|
| 93 |
+
* start event can happen on a different thread than the end marker. For the
|
| 94 |
+
* correlation of a start/end pair an unique correlation ID is used that is
|
| 95 |
+
* returned from the start API call and needs to be passed into the end API
|
| 96 |
+
* call.
|
| 97 |
+
*
|
| 98 |
+
* \subsection EVENT_ATTRIBUTES Event Attributes
|
| 99 |
+
*
|
| 100 |
+
* \ref MARKERS_AND_RANGES can be annotated with various attributes to provide
|
| 101 |
+
* additional information for an event or to guide the tool's visualization of
|
| 102 |
+
* the data. Each of the attributes is optional and if left unused the
|
| 103 |
+
* attributes fall back to a default value. The attributes include:
|
| 104 |
+
* - color
|
| 105 |
+
* - category
|
| 106 |
+
*
|
| 107 |
+
* To specify any attribute other than the text message, the \ref
|
| 108 |
+
* EVENT_ATTRIBUTE_STRUCTURE "Event Attribute Structure" must be used.
|
| 109 |
+
*
|
| 110 |
+
* \section DOMAINS Domains
|
| 111 |
+
*
|
| 112 |
+
* Domains enable developers to scope annotations. By default all events and
|
| 113 |
+
* annotations are in the default domain. Additional domains can be registered.
|
| 114 |
+
* This allows developers to scope markers, ranges, and resources names to
|
| 115 |
+
* avoid conflicts.
|
| 116 |
+
*
|
| 117 |
+
* The function ::nvtxDomainCreateA or ::nvtxDomainCreateW is used to create
|
| 118 |
+
* a named domain.
|
| 119 |
+
*
|
| 120 |
+
* Each domain maintains its own
|
| 121 |
+
* - categories
|
| 122 |
+
* - thread range stacks
|
| 123 |
+
* - registered strings
|
| 124 |
+
*
|
| 125 |
+
* The function ::nvtxDomainDestroy marks the end of the domain. Destroying
|
| 126 |
+
* a domain unregisters and destroys all objects associated with it such as
|
| 127 |
+
* registered strings, resource objects, named categories, and started ranges.
|
| 128 |
+
*
|
| 129 |
+
* \section RESOURCE_NAMING Resource Naming
|
| 130 |
+
*
|
| 131 |
+
* This section covers calls that allow to annotate objects with user-provided
|
| 132 |
+
* names in order to allow for a better analysis of complex trace data. All of
|
| 133 |
+
* the functions take the handle or the ID of the object to name and the name.
|
| 134 |
+
* The functions can be called multiple times during the execution of an
|
| 135 |
+
* application, however, in that case it is implementation dependent which
|
| 136 |
+
* name will be reported by the tool.
|
| 137 |
+
*
|
| 138 |
+
* \subsection CATEGORY_NAMING Category Naming
|
| 139 |
+
*
|
| 140 |
+
* Some function in this library support associating an integer category
|
| 141 |
+
* to enable filtering and sorting. The category naming functions allow
|
| 142 |
+
* the application to associate a user friendly name with the integer
|
| 143 |
+
* category. Support for domains have been added in NVTX_VERSION_2 to
|
| 144 |
+
* avoid collisions when domains are developed independantly.
|
| 145 |
+
*
|
| 146 |
+
* \subsection RESOURCE_OBJECTS Resource Objects
|
| 147 |
+
*
|
| 148 |
+
* Resource objects are a generic mechanism for attaching data to an application
|
| 149 |
+
* resource. The identifier field makes the association to a pointer or handle,
|
| 150 |
+
* while the type field helps provide deeper understanding of the identifier as
|
| 151 |
+
* well as enabling differentiation in cases where handles generated by different
|
| 152 |
+
* APIs may collide. The resource object may also have an associated message to
|
| 153 |
+
* associate with the application resource, enabling further annotation of this
|
| 154 |
+
* object and how it is used.
|
| 155 |
+
*
|
| 156 |
+
* The resource object was introduced in NVTX_VERSION_2 to supersede existing naming
|
| 157 |
+
* functions and allow the application resource identified by those functions to be
|
| 158 |
+
* associated to a domain. The other naming functions are still supported for backward
|
| 159 |
+
* compatibility but will be associated only to the default domain.
|
| 160 |
+
*
|
| 161 |
+
* \subsection RESOURCE_NAMING_OS Resource Naming
|
| 162 |
+
*
|
| 163 |
+
* Some operating system resources creation APIs do not support providing a user friendly
|
| 164 |
+
* name, such as some OS thread creation APIs. This API support resource naming though
|
| 165 |
+
* both through resource objects and functions following the pattern
|
| 166 |
+
* nvtxName[RESOURCE_TYPE][A|W](identifier, name). Resource objects introduced in NVTX_VERSION 2
|
| 167 |
+
* supersede the other functions with a a more general method of assigning names to OS resources,
|
| 168 |
+
* along with associating them to domains too. The older nvtxName* functions are only associated
|
| 169 |
+
* with the default domain.
|
| 170 |
+
* \section EXTENSIONS Optional Extensions
|
| 171 |
+
* Optional extensions will either appear within the existing sections the extend or appear
|
| 172 |
+
* in the "Related Pages" when they introduce new concepts.
|
| 173 |
+
*/
|
| 174 |
+
|
| 175 |
+
/**
|
| 176 |
+
* Tools Extension API version
|
| 177 |
+
*/
|
| 178 |
+
#if defined(NVTX_VERSION) && NVTX_VERSION < 3
|
| 179 |
+
#error "Trying to #include NVTX version 3 in a source file where an older NVTX version has already been included. If you are not directly using NVTX (the NVIDIA Tools Extension library), you are getting this error because libraries you are using have included different versions of NVTX. Suggested solutions are: (1) reorder #includes so the newest NVTX version is included first, (2) avoid using the conflicting libraries in the same .c/.cpp file, or (3) update the library using the older NVTX version to use the newer version instead."
|
| 180 |
+
#endif
|
| 181 |
+
|
| 182 |
+
/* Header guard */
|
| 183 |
+
#if !defined(NVTX_VERSION)
|
| 184 |
+
#define NVTX_VERSION 3
|
| 185 |
+
|
| 186 |
+
#if defined(_MSC_VER)
|
| 187 |
+
#define NVTX_API __stdcall
|
| 188 |
+
#define NVTX_INLINE_STATIC __inline static
|
| 189 |
+
#else /*defined(__GNUC__)*/
|
| 190 |
+
#define NVTX_API
|
| 191 |
+
#define NVTX_INLINE_STATIC inline static
|
| 192 |
+
#endif /* Platform */
|
| 193 |
+
|
| 194 |
+
#if defined(NVTX_NO_IMPL)
|
| 195 |
+
/* When omitting implementation, avoid declaring functions inline */
|
| 196 |
+
/* without definitions, since this causes compiler warnings. */
|
| 197 |
+
#define NVTX_DECLSPEC
|
| 198 |
+
#elif defined(NVTX_EXPORT_API)
|
| 199 |
+
/* Allow overriding definition of NVTX_DECLSPEC when exporting API. */
|
| 200 |
+
/* Default is empty, meaning non-inline with external linkage. */
|
| 201 |
+
#if !defined(NVTX_DECLSPEC)
|
| 202 |
+
#define NVTX_DECLSPEC
|
| 203 |
+
#endif
|
| 204 |
+
#else
|
| 205 |
+
/* Normal NVTX usage defines the NVTX API inline with static */
|
| 206 |
+
/* (internal) linkage. */
|
| 207 |
+
#define NVTX_DECLSPEC NVTX_INLINE_STATIC
|
| 208 |
+
#endif
|
| 209 |
+
|
| 210 |
+
#include "nvtxDetail/nvtxLinkOnce.h"
|
| 211 |
+
|
| 212 |
+
#define NVTX_VERSIONED_IDENTIFIER_L3(NAME, VERSION) NAME##_v##VERSION
|
| 213 |
+
#define NVTX_VERSIONED_IDENTIFIER_L2(NAME, VERSION) NVTX_VERSIONED_IDENTIFIER_L3(NAME, VERSION)
|
| 214 |
+
#define NVTX_VERSIONED_IDENTIFIER(NAME) NVTX_VERSIONED_IDENTIFIER_L2(NAME, NVTX_VERSION)
|
| 215 |
+
|
| 216 |
+
/**
|
| 217 |
+
* The nvToolsExt library depends on stdint.h. If the build tool chain in use
|
| 218 |
+
* does not include stdint.h then define NVTX_STDINT_TYPES_ALREADY_DEFINED
|
| 219 |
+
* and define the following types:
|
| 220 |
+
* <ul>
|
| 221 |
+
* <li>uint8_t
|
| 222 |
+
* <li>int8_t
|
| 223 |
+
* <li>uint16_t
|
| 224 |
+
* <li>int16_t
|
| 225 |
+
* <li>uint32_t
|
| 226 |
+
* <li>int32_t
|
| 227 |
+
* <li>uint64_t
|
| 228 |
+
* <li>int64_t
|
| 229 |
+
* <li>uintptr_t
|
| 230 |
+
* <li>intptr_t
|
| 231 |
+
* </ul>
|
| 232 |
+
* #define NVTX_STDINT_TYPES_ALREADY_DEFINED if you are using your own header file.
|
| 233 |
+
*/
|
| 234 |
+
#ifndef NVTX_STDINT_TYPES_ALREADY_DEFINED
|
| 235 |
+
#include <stdint.h>
|
| 236 |
+
#endif
|
| 237 |
+
|
| 238 |
+
#include <stddef.h>
|
| 239 |
+
|
| 240 |
+
#ifdef __cplusplus
|
| 241 |
+
extern "C" {
|
| 242 |
+
#endif /* __cplusplus */
|
| 243 |
+
|
| 244 |
+
/**
|
| 245 |
+
* Result Codes
|
| 246 |
+
*/
|
| 247 |
+
|
| 248 |
+
#define NVTX_SUCCESS 0
|
| 249 |
+
#define NVTX_FAIL 1
|
| 250 |
+
#define NVTX_ERR_INIT_LOAD_PROPERTY 2
|
| 251 |
+
#define NVTX_ERR_INIT_ACCESS_LIBRARY 3
|
| 252 |
+
#define NVTX_ERR_INIT_LOAD_LIBRARY 4
|
| 253 |
+
#define NVTX_ERR_INIT_MISSING_LIBRARY_ENTRY_POINT 5
|
| 254 |
+
#define NVTX_ERR_INIT_FAILED_LIBRARY_ENTRY_POINT 6
|
| 255 |
+
#define NVTX_ERR_NO_INJECTION_LIBRARY_AVAILABLE 7
|
| 256 |
+
|
| 257 |
+
/**
|
| 258 |
+
* Size of the nvtxEventAttributes_t structure.
|
| 259 |
+
*/
|
| 260 |
+
#define NVTX_EVENT_ATTRIB_STRUCT_SIZE ( (uint16_t)( sizeof(nvtxEventAttributes_t) ) )
|
| 261 |
+
|
| 262 |
+
#define NVTX_NO_PUSH_POP_TRACKING ((int)-2)
|
| 263 |
+
|
| 264 |
+
typedef uint64_t nvtxRangeId_t;
|
| 265 |
+
|
| 266 |
+
/* Forward declaration of opaque domain registration structure */
|
| 267 |
+
struct nvtxDomainRegistration_st;
|
| 268 |
+
typedef struct nvtxDomainRegistration_st nvtxDomainRegistration;
|
| 269 |
+
|
| 270 |
+
/* \brief Domain Handle Structure.
|
| 271 |
+
* \anchor DOMAIN_HANDLE_STRUCTURE
|
| 272 |
+
*
|
| 273 |
+
* This structure is opaque to the user and is used as a handle to reference
|
| 274 |
+
* a domain. This type is returned from tools when using the NVTX API to
|
| 275 |
+
* create a domain.
|
| 276 |
+
*
|
| 277 |
+
*/
|
| 278 |
+
typedef nvtxDomainRegistration* nvtxDomainHandle_t;
|
| 279 |
+
|
| 280 |
+
/* Forward declaration of opaque string registration structure */
|
| 281 |
+
struct nvtxStringRegistration_st;
|
| 282 |
+
typedef struct nvtxStringRegistration_st nvtxStringRegistration;
|
| 283 |
+
|
| 284 |
+
/* \brief Registered String Handle Structure.
|
| 285 |
+
* \anchor REGISTERED_STRING_HANDLE_STRUCTURE
|
| 286 |
+
*
|
| 287 |
+
* This structure is opaque to the user and is used as a handle to reference
|
| 288 |
+
* a registered string. This type is returned from tools when using the NVTX
|
| 289 |
+
* API to create a registered string.
|
| 290 |
+
*
|
| 291 |
+
*/
|
| 292 |
+
typedef nvtxStringRegistration* nvtxStringHandle_t;
|
| 293 |
+
|
| 294 |
+
/* ========================================================================= */
|
| 295 |
+
/** \defgroup GENERAL General
|
| 296 |
+
* @{
|
| 297 |
+
*/
|
| 298 |
+
|
| 299 |
+
/** ---------------------------------------------------------------------------
|
| 300 |
+
* Color Types
|
| 301 |
+
* ------------------------------------------------------------------------- */
|
| 302 |
+
typedef enum nvtxColorType_t
|
| 303 |
+
{
|
| 304 |
+
NVTX_COLOR_UNKNOWN = 0, /**< Color attribute is unused. */
|
| 305 |
+
NVTX_COLOR_ARGB = 1 /**< An ARGB color is provided. */
|
| 306 |
+
} nvtxColorType_t;
|
| 307 |
+
|
| 308 |
+
/** ---------------------------------------------------------------------------
|
| 309 |
+
* Message Types
|
| 310 |
+
* ------------------------------------------------------------------------- */
|
| 311 |
+
typedef enum nvtxMessageType_t
|
| 312 |
+
{
|
| 313 |
+
NVTX_MESSAGE_UNKNOWN = 0, /**< Message payload is unused. */
|
| 314 |
+
NVTX_MESSAGE_TYPE_ASCII = 1, /**< A character sequence is used as payload. */
|
| 315 |
+
NVTX_MESSAGE_TYPE_UNICODE = 2, /**< A wide character sequence is used as payload. */
|
| 316 |
+
/* NVTX_VERSION_2 */
|
| 317 |
+
NVTX_MESSAGE_TYPE_REGISTERED = 3, /**< A unique string handle that was registered
|
| 318 |
+
with \ref nvtxDomainRegisterStringA() or
|
| 319 |
+
\ref nvtxDomainRegisterStringW(). */
|
| 320 |
+
} nvtxMessageType_t;
|
| 321 |
+
|
| 322 |
+
typedef union nvtxMessageValue_t
|
| 323 |
+
{
|
| 324 |
+
const char* ascii;
|
| 325 |
+
const wchar_t* unicode;
|
| 326 |
+
/* NVTX_VERSION_2 */
|
| 327 |
+
nvtxStringHandle_t registered;
|
| 328 |
+
} nvtxMessageValue_t;
|
| 329 |
+
|
| 330 |
+
|
| 331 |
+
/** @} */ /*END defgroup*/
|
| 332 |
+
/* ------------------------------------------------------------------------- */
|
| 333 |
+
/** \brief Force initialization (optional)
|
| 334 |
+
*
|
| 335 |
+
* Force NVTX library to initialize. The first call to any NVTX API function
|
| 336 |
+
* will automatically initialize the entire API. This can make the first call
|
| 337 |
+
* much slower than subsequent calls. In applications where the first call to
|
| 338 |
+
* NVTX may be in a performance-critical section, calling nvtxInitialize before
|
| 339 |
+
* any performance-critical sections will ensure NVTX initialization occurs at
|
| 340 |
+
* an acceptable time. Since nvtxInitialize takes no parameters and has no
|
| 341 |
+
* expected behavior besides initialization, it is convenient to add a call to
|
| 342 |
+
* nvtxInitialize in NVTX-instrumented applications that need to force earlier
|
| 343 |
+
* initialization without changing any other code. For example, if an app's
|
| 344 |
+
* first NVTX call is nvtxDomainCreate, and it is difficult to move that call
|
| 345 |
+
* earlier because the domain handle must be stored in an object only created
|
| 346 |
+
* at that point, adding a call to nvtxInitialize at the top of main() will
|
| 347 |
+
* ensure the later call to nvtxDomainCreate is as fast as possible.
|
| 348 |
+
*
|
| 349 |
+
* \version \NVTX_VERSION_3
|
| 350 |
+
*
|
| 351 |
+
* \param reserved - must be zero or NULL.
|
| 352 |
+
*
|
| 353 |
+
* @{ */
|
| 354 |
+
NVTX_DECLSPEC void NVTX_API nvtxInitialize(const void* reserved);
|
| 355 |
+
/** @} */
|
| 356 |
+
|
| 357 |
+
|
| 358 |
+
/** @} */ /*END defgroup*/
|
| 359 |
+
|
| 360 |
+
/* ========================================================================= */
|
| 361 |
+
/** \defgroup EVENT_ATTRIBUTES Event Attributes
|
| 362 |
+
* @{
|
| 363 |
+
*/
|
| 364 |
+
|
| 365 |
+
/** ---------------------------------------------------------------------------
|
| 366 |
+
* Payload Types
|
| 367 |
+
* ------------------------------------------------------------------------- */
|
| 368 |
+
typedef enum nvtxPayloadType_t
|
| 369 |
+
{
|
| 370 |
+
NVTX_PAYLOAD_UNKNOWN = 0, /**< Color payload is unused. */
|
| 371 |
+
NVTX_PAYLOAD_TYPE_UNSIGNED_INT64 = 1, /**< A 64 bit unsigned integer value is used as payload. */
|
| 372 |
+
NVTX_PAYLOAD_TYPE_INT64 = 2, /**< A 64 bit signed integer value is used as payload. */
|
| 373 |
+
NVTX_PAYLOAD_TYPE_DOUBLE = 3, /**< A 64 bit floating point value is used as payload. */
|
| 374 |
+
/* NVTX_VERSION_2 */
|
| 375 |
+
NVTX_PAYLOAD_TYPE_UNSIGNED_INT32 = 4, /**< A 32 bit floating point value is used as payload. */
|
| 376 |
+
NVTX_PAYLOAD_TYPE_INT32 = 5, /**< A 32 bit floating point value is used as payload. */
|
| 377 |
+
NVTX_PAYLOAD_TYPE_FLOAT = 6 /**< A 32 bit floating point value is used as payload. */
|
| 378 |
+
} nvtxPayloadType_t;
|
| 379 |
+
|
| 380 |
+
/** \brief Event Attribute Structure.
|
| 381 |
+
* \anchor EVENT_ATTRIBUTE_STRUCTURE
|
| 382 |
+
*
|
| 383 |
+
* This structure is used to describe the attributes of an event. The layout of
|
| 384 |
+
* the structure is defined by a specific version of the tools extension
|
| 385 |
+
* library and can change between different versions of the Tools Extension
|
| 386 |
+
* library.
|
| 387 |
+
*
|
| 388 |
+
* \par Initializing the Attributes
|
| 389 |
+
*
|
| 390 |
+
* The caller should always perform the following three tasks when using
|
| 391 |
+
* attributes:
|
| 392 |
+
* <ul>
|
| 393 |
+
* <li>Zero the structure
|
| 394 |
+
* <li>Set the version field
|
| 395 |
+
* <li>Set the size field
|
| 396 |
+
* </ul>
|
| 397 |
+
*
|
| 398 |
+
* Zeroing the structure sets all the event attributes types and values
|
| 399 |
+
* to the default value.
|
| 400 |
+
*
|
| 401 |
+
* The version and size field are used by the Tools Extension
|
| 402 |
+
* implementation to handle multiple versions of the attributes structure.
|
| 403 |
+
*
|
| 404 |
+
* It is recommended that the caller use one of the following to methods
|
| 405 |
+
* to initialize the event attributes structure:
|
| 406 |
+
*
|
| 407 |
+
* \par Method 1: Initializing nvtxEventAttributes for future compatibility
|
| 408 |
+
* \code
|
| 409 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 410 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 411 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 412 |
+
* \endcode
|
| 413 |
+
*
|
| 414 |
+
* \par Method 2: Initializing nvtxEventAttributes for a specific version
|
| 415 |
+
* \code
|
| 416 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 417 |
+
* eventAttrib.version = 1;
|
| 418 |
+
* eventAttrib.size = (uint16_t)(sizeof(nvtxEventAttributes_v1));
|
| 419 |
+
* \endcode
|
| 420 |
+
*
|
| 421 |
+
* If the caller uses Method 1 it is critical that the entire binary
|
| 422 |
+
* layout of the structure be configured to 0 so that all fields
|
| 423 |
+
* are initialized to the default value.
|
| 424 |
+
*
|
| 425 |
+
* The caller should either use both NVTX_VERSION and
|
| 426 |
+
* NVTX_EVENT_ATTRIB_STRUCT_SIZE (Method 1) or use explicit values
|
| 427 |
+
* and a versioned type (Method 2). Using a mix of the two methods
|
| 428 |
+
* will likely cause either source level incompatibility or binary
|
| 429 |
+
* incompatibility in the future.
|
| 430 |
+
*
|
| 431 |
+
* \par Settings Attribute Types and Values
|
| 432 |
+
*
|
| 433 |
+
*
|
| 434 |
+
* \par Example:
|
| 435 |
+
* \code
|
| 436 |
+
* // Initialize
|
| 437 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 438 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 439 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 440 |
+
*
|
| 441 |
+
* // Configure the Attributes
|
| 442 |
+
* eventAttrib.colorType = NVTX_COLOR_ARGB;
|
| 443 |
+
* eventAttrib.color = 0xFF880000;
|
| 444 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 445 |
+
* eventAttrib.message.ascii = "Example";
|
| 446 |
+
* \endcode
|
| 447 |
+
*
|
| 448 |
+
* In the example the caller does not have to set the value of
|
| 449 |
+
* \ref ::nvtxEventAttributes_v2::category or
|
| 450 |
+
* \ref ::nvtxEventAttributes_v2::payload as these fields were set to
|
| 451 |
+
* the default value by {0}.
|
| 452 |
+
* \sa
|
| 453 |
+
* ::nvtxDomainMarkEx
|
| 454 |
+
* ::nvtxDomainRangeStartEx
|
| 455 |
+
* ::nvtxDomainRangePushEx
|
| 456 |
+
*/
|
| 457 |
+
typedef struct nvtxEventAttributes_v2
|
| 458 |
+
{
|
| 459 |
+
/**
|
| 460 |
+
* \brief Version flag of the structure.
|
| 461 |
+
*
|
| 462 |
+
* Needs to be set to NVTX_VERSION to indicate the version of NVTX APIs
|
| 463 |
+
* supported in this header file. This can optionally be overridden to
|
| 464 |
+
* another version of the tools extension library.
|
| 465 |
+
*/
|
| 466 |
+
uint16_t version;
|
| 467 |
+
|
| 468 |
+
/**
|
| 469 |
+
* \brief Size of the structure.
|
| 470 |
+
*
|
| 471 |
+
* Needs to be set to the size in bytes of the event attribute
|
| 472 |
+
* structure used to specify the event.
|
| 473 |
+
*/
|
| 474 |
+
uint16_t size;
|
| 475 |
+
|
| 476 |
+
/**
|
| 477 |
+
* \brief ID of the category the event is assigned to.
|
| 478 |
+
*
|
| 479 |
+
* A category is a user-controlled ID that can be used to group
|
| 480 |
+
* events. The tool may use category IDs to improve filtering or
|
| 481 |
+
* enable grouping of events in the same category. The functions
|
| 482 |
+
* \ref ::nvtxNameCategoryA or \ref ::nvtxNameCategoryW can be used
|
| 483 |
+
* to name a category.
|
| 484 |
+
*
|
| 485 |
+
* Default Value is 0
|
| 486 |
+
*/
|
| 487 |
+
uint32_t category;
|
| 488 |
+
|
| 489 |
+
/** \brief Color type specified in this attribute structure.
|
| 490 |
+
*
|
| 491 |
+
* Defines the color format of the attribute structure's \ref COLOR_FIELD
|
| 492 |
+
* "color" field.
|
| 493 |
+
*
|
| 494 |
+
* Default Value is NVTX_COLOR_UNKNOWN
|
| 495 |
+
*/
|
| 496 |
+
int32_t colorType; /* nvtxColorType_t */
|
| 497 |
+
|
| 498 |
+
/** \brief Color assigned to this event. \anchor COLOR_FIELD
|
| 499 |
+
*
|
| 500 |
+
* The color that the tool should use to visualize the event.
|
| 501 |
+
*/
|
| 502 |
+
uint32_t color;
|
| 503 |
+
|
| 504 |
+
/**
|
| 505 |
+
* \brief Payload type specified in this attribute structure.
|
| 506 |
+
*
|
| 507 |
+
* Defines the payload format of the attribute structure's \ref PAYLOAD_FIELD
|
| 508 |
+
* "payload" field.
|
| 509 |
+
*
|
| 510 |
+
* Default Value is NVTX_PAYLOAD_UNKNOWN
|
| 511 |
+
*/
|
| 512 |
+
int32_t payloadType; /* nvtxPayloadType_t */
|
| 513 |
+
|
| 514 |
+
int32_t reserved0;
|
| 515 |
+
|
| 516 |
+
/**
|
| 517 |
+
* \brief Payload assigned to this event. \anchor PAYLOAD_FIELD
|
| 518 |
+
*
|
| 519 |
+
* A numerical value that can be used to annotate an event. The tool could
|
| 520 |
+
* use the payload data to reconstruct graphs and diagrams.
|
| 521 |
+
*/
|
| 522 |
+
union payload_t
|
| 523 |
+
{
|
| 524 |
+
uint64_t ullValue;
|
| 525 |
+
int64_t llValue;
|
| 526 |
+
double dValue;
|
| 527 |
+
/* NVTX_VERSION_2 */
|
| 528 |
+
uint32_t uiValue;
|
| 529 |
+
int32_t iValue;
|
| 530 |
+
float fValue;
|
| 531 |
+
} payload;
|
| 532 |
+
|
| 533 |
+
/** \brief Message type specified in this attribute structure.
|
| 534 |
+
*
|
| 535 |
+
* Defines the message format of the attribute structure's \ref MESSAGE_FIELD
|
| 536 |
+
* "message" field.
|
| 537 |
+
*
|
| 538 |
+
* Default Value is NVTX_MESSAGE_UNKNOWN
|
| 539 |
+
*/
|
| 540 |
+
int32_t messageType; /* nvtxMessageType_t */
|
| 541 |
+
|
| 542 |
+
/** \brief Message assigned to this attribute structure. \anchor MESSAGE_FIELD
|
| 543 |
+
*
|
| 544 |
+
* The text message that is attached to an event.
|
| 545 |
+
*/
|
| 546 |
+
nvtxMessageValue_t message;
|
| 547 |
+
|
| 548 |
+
} nvtxEventAttributes_v2;
|
| 549 |
+
|
| 550 |
+
typedef struct nvtxEventAttributes_v2 nvtxEventAttributes_t;
|
| 551 |
+
|
| 552 |
+
/** @} */ /*END defgroup*/
|
| 553 |
+
/* ========================================================================= */
|
| 554 |
+
/** \defgroup MARKERS_AND_RANGES Markers and Ranges
|
| 555 |
+
*
|
| 556 |
+
* See \ref MARKERS_AND_RANGES for more details
|
| 557 |
+
*
|
| 558 |
+
* @{
|
| 559 |
+
*/
|
| 560 |
+
|
| 561 |
+
/** \name Marker */
|
| 562 |
+
|
| 563 |
+
/* ------------------------------------------------------------------------- */
|
| 564 |
+
/** \brief Marks an instantaneous event in the application.
|
| 565 |
+
*
|
| 566 |
+
* A marker can contain a text message or specify additional information
|
| 567 |
+
* using the event attributes structure. These attributes include a text
|
| 568 |
+
* message, color, category, and a payload. Each of the attributes is optional
|
| 569 |
+
* and can only be sent out using the \ref nvtxDomainMarkEx function.
|
| 570 |
+
*
|
| 571 |
+
* nvtxDomainMarkEx(NULL, event) is equivalent to calling
|
| 572 |
+
* nvtxMarkEx(event).
|
| 573 |
+
*
|
| 574 |
+
* \param domain - The domain of scoping the category.
|
| 575 |
+
* \param eventAttrib - The event attribute structure defining the marker's
|
| 576 |
+
* attribute types and attribute values.
|
| 577 |
+
*
|
| 578 |
+
* \sa
|
| 579 |
+
* ::nvtxMarkEx
|
| 580 |
+
*
|
| 581 |
+
* \version \NVTX_VERSION_2
|
| 582 |
+
* @{ */
|
| 583 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainMarkEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib);
|
| 584 |
+
/** @} */
|
| 585 |
+
|
| 586 |
+
/* ------------------------------------------------------------------------- */
|
| 587 |
+
/** \brief Marks an instantaneous event in the application.
|
| 588 |
+
*
|
| 589 |
+
* A marker can contain a text message or specify additional information
|
| 590 |
+
* using the event attributes structure. These attributes include a text
|
| 591 |
+
* message, color, category, and a payload. Each of the attributes is optional
|
| 592 |
+
* and can only be sent out using the \ref nvtxMarkEx function.
|
| 593 |
+
* If \ref nvtxMarkA or \ref nvtxMarkW are used to specify the marker
|
| 594 |
+
* or if an attribute is unspecified then a default value will be used.
|
| 595 |
+
*
|
| 596 |
+
* \param eventAttrib - The event attribute structure defining the marker's
|
| 597 |
+
* attribute types and attribute values.
|
| 598 |
+
*
|
| 599 |
+
* \par Example:
|
| 600 |
+
* \code
|
| 601 |
+
* // zero the structure
|
| 602 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 603 |
+
* // set the version and the size information
|
| 604 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 605 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 606 |
+
* // configure the attributes. 0 is the default for all attributes.
|
| 607 |
+
* eventAttrib.colorType = NVTX_COLOR_ARGB;
|
| 608 |
+
* eventAttrib.color = 0xFF880000;
|
| 609 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 610 |
+
* eventAttrib.message.ascii = "Example nvtxMarkEx";
|
| 611 |
+
* nvtxMarkEx(&eventAttrib);
|
| 612 |
+
* \endcode
|
| 613 |
+
*
|
| 614 |
+
* \sa
|
| 615 |
+
* ::nvtxDomainMarkEx
|
| 616 |
+
*
|
| 617 |
+
* \version \NVTX_VERSION_1
|
| 618 |
+
* @{ */
|
| 619 |
+
NVTX_DECLSPEC void NVTX_API nvtxMarkEx(const nvtxEventAttributes_t* eventAttrib);
|
| 620 |
+
/** @} */
|
| 621 |
+
|
| 622 |
+
/* ------------------------------------------------------------------------- */
|
| 623 |
+
/** \brief Marks an instantaneous event in the application.
|
| 624 |
+
*
|
| 625 |
+
* A marker created using \ref nvtxMarkA or \ref nvtxMarkW contains only a
|
| 626 |
+
* text message.
|
| 627 |
+
*
|
| 628 |
+
* \param message - The message associated to this marker event.
|
| 629 |
+
*
|
| 630 |
+
* \par Example:
|
| 631 |
+
* \code
|
| 632 |
+
* nvtxMarkA("Example nvtxMarkA");
|
| 633 |
+
* nvtxMarkW(L"Example nvtxMarkW");
|
| 634 |
+
* \endcode
|
| 635 |
+
*
|
| 636 |
+
* \sa
|
| 637 |
+
* ::nvtxDomainMarkEx
|
| 638 |
+
* ::nvtxMarkEx
|
| 639 |
+
*
|
| 640 |
+
* \version \NVTX_VERSION_0
|
| 641 |
+
* @{ */
|
| 642 |
+
NVTX_DECLSPEC void NVTX_API nvtxMarkA(const char* message);
|
| 643 |
+
NVTX_DECLSPEC void NVTX_API nvtxMarkW(const wchar_t* message);
|
| 644 |
+
/** @} */
|
| 645 |
+
|
| 646 |
+
|
| 647 |
+
/** \name Process Ranges */
|
| 648 |
+
|
| 649 |
+
/* ------------------------------------------------------------------------- */
|
| 650 |
+
/** \brief Starts a process range in a domain.
|
| 651 |
+
*
|
| 652 |
+
* \param domain - The domain of scoping the category.
|
| 653 |
+
* \param eventAttrib - The event attribute structure defining the range's
|
| 654 |
+
* attribute types and attribute values.
|
| 655 |
+
*
|
| 656 |
+
* \return The unique ID used to correlate a pair of Start and End events.
|
| 657 |
+
*
|
| 658 |
+
* \remarks Ranges defined by Start/End can overlap.
|
| 659 |
+
*
|
| 660 |
+
* \par Example:
|
| 661 |
+
* \code
|
| 662 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("my domain");
|
| 663 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 664 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 665 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 666 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 667 |
+
* eventAttrib.message.ascii = "my range";
|
| 668 |
+
* nvtxRangeId_t rangeId = nvtxDomainRangeStartEx(&eventAttrib);
|
| 669 |
+
* // ...
|
| 670 |
+
* nvtxDomainRangeEnd(rangeId);
|
| 671 |
+
* \endcode
|
| 672 |
+
*
|
| 673 |
+
* \sa
|
| 674 |
+
* ::nvtxDomainRangeEnd
|
| 675 |
+
*
|
| 676 |
+
* \version \NVTX_VERSION_2
|
| 677 |
+
* @{ */
|
| 678 |
+
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxDomainRangeStartEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib);
|
| 679 |
+
/** @} */
|
| 680 |
+
|
| 681 |
+
/* ------------------------------------------------------------------------- */
|
| 682 |
+
/** \brief Starts a process range.
|
| 683 |
+
*
|
| 684 |
+
* \param eventAttrib - The event attribute structure defining the range's
|
| 685 |
+
* attribute types and attribute values.
|
| 686 |
+
*
|
| 687 |
+
* \return The unique ID used to correlate a pair of Start and End events.
|
| 688 |
+
*
|
| 689 |
+
* \remarks Ranges defined by Start/End can overlap.
|
| 690 |
+
*
|
| 691 |
+
* \par Example:
|
| 692 |
+
* \code
|
| 693 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 694 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 695 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 696 |
+
* eventAttrib.category = 3;
|
| 697 |
+
* eventAttrib.colorType = NVTX_COLOR_ARGB;
|
| 698 |
+
* eventAttrib.color = 0xFF0088FF;
|
| 699 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 700 |
+
* eventAttrib.message.ascii = "Example Range";
|
| 701 |
+
* nvtxRangeId_t rangeId = nvtxRangeStartEx(&eventAttrib);
|
| 702 |
+
* // ...
|
| 703 |
+
* nvtxRangeEnd(rangeId);
|
| 704 |
+
* \endcode
|
| 705 |
+
*
|
| 706 |
+
* \sa
|
| 707 |
+
* ::nvtxRangeEnd
|
| 708 |
+
* ::nvtxDomainRangeStartEx
|
| 709 |
+
*
|
| 710 |
+
* \version \NVTX_VERSION_1
|
| 711 |
+
* @{ */
|
| 712 |
+
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartEx(const nvtxEventAttributes_t* eventAttrib);
|
| 713 |
+
/** @} */
|
| 714 |
+
|
| 715 |
+
/* ------------------------------------------------------------------------- */
|
| 716 |
+
/** \brief Starts a process range.
|
| 717 |
+
*
|
| 718 |
+
* \param message - The event message associated to this range event.
|
| 719 |
+
*
|
| 720 |
+
* \return The unique ID used to correlate a pair of Start and End events.
|
| 721 |
+
*
|
| 722 |
+
* \remarks Ranges defined by Start/End can overlap.
|
| 723 |
+
*
|
| 724 |
+
* \par Example:
|
| 725 |
+
* \code
|
| 726 |
+
* nvtxRangeId_t r1 = nvtxRangeStartA("Range 1");
|
| 727 |
+
* nvtxRangeId_t r2 = nvtxRangeStartW(L"Range 2");
|
| 728 |
+
* nvtxRangeEnd(r1);
|
| 729 |
+
* nvtxRangeEnd(r2);
|
| 730 |
+
* \endcode
|
| 731 |
+
*
|
| 732 |
+
* \sa
|
| 733 |
+
* ::nvtxRangeEnd
|
| 734 |
+
* ::nvtxRangeStartEx
|
| 735 |
+
* ::nvtxDomainRangeStartEx
|
| 736 |
+
*
|
| 737 |
+
* \version \NVTX_VERSION_0
|
| 738 |
+
* @{ */
|
| 739 |
+
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartA(const char* message);
|
| 740 |
+
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartW(const wchar_t* message);
|
| 741 |
+
/** @} */
|
| 742 |
+
|
| 743 |
+
/* ------------------------------------------------------------------------- */
|
| 744 |
+
/** \brief Ends a process range.
|
| 745 |
+
*
|
| 746 |
+
* \param domain - The domain
|
| 747 |
+
* \param id - The correlation ID returned from a nvtxRangeStart call.
|
| 748 |
+
*
|
| 749 |
+
* \remarks This function is offered completeness but is an alias for ::nvtxRangeEnd.
|
| 750 |
+
* It does not need a domain param since that is associated iwth the range ID at ::nvtxDomainRangeStartEx
|
| 751 |
+
*
|
| 752 |
+
* \par Example:
|
| 753 |
+
* \code
|
| 754 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("my domain");
|
| 755 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 756 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 757 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 758 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 759 |
+
* eventAttrib.message.ascii = "my range";
|
| 760 |
+
* nvtxRangeId_t rangeId = nvtxDomainRangeStartEx(&eventAttrib);
|
| 761 |
+
* // ...
|
| 762 |
+
* nvtxDomainRangeEnd(rangeId);
|
| 763 |
+
* \endcode
|
| 764 |
+
*
|
| 765 |
+
* \sa
|
| 766 |
+
* ::nvtxDomainRangeStartEx
|
| 767 |
+
*
|
| 768 |
+
* \version \NVTX_VERSION_2
|
| 769 |
+
* @{ */
|
| 770 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainRangeEnd(nvtxDomainHandle_t domain, nvtxRangeId_t id);
|
| 771 |
+
/** @} */
|
| 772 |
+
|
| 773 |
+
/* ------------------------------------------------------------------------- */
|
| 774 |
+
/** \brief Ends a process range.
|
| 775 |
+
*
|
| 776 |
+
* \param id - The correlation ID returned from an nvtxRangeStart call.
|
| 777 |
+
*
|
| 778 |
+
* \sa
|
| 779 |
+
* ::nvtxDomainRangeStartEx
|
| 780 |
+
* ::nvtxRangeStartEx
|
| 781 |
+
* ::nvtxRangeStartA
|
| 782 |
+
* ::nvtxRangeStartW
|
| 783 |
+
*
|
| 784 |
+
* \version \NVTX_VERSION_0
|
| 785 |
+
* @{ */
|
| 786 |
+
NVTX_DECLSPEC void NVTX_API nvtxRangeEnd(nvtxRangeId_t id);
|
| 787 |
+
/** @} */
|
| 788 |
+
|
| 789 |
+
/** \name Thread Ranges */
|
| 790 |
+
|
| 791 |
+
/* ------------------------------------------------------------------------- */
|
| 792 |
+
/** \brief Starts a nested thread range.
|
| 793 |
+
*
|
| 794 |
+
* \param domain - The domain of scoping.
|
| 795 |
+
* \param eventAttrib - The event attribute structure defining the range's
|
| 796 |
+
* attribute types and attribute values.
|
| 797 |
+
*
|
| 798 |
+
* \return The 0 based level of range being started. This value is scoped to the domain.
|
| 799 |
+
* If an error occurs, a negative value is returned.
|
| 800 |
+
*
|
| 801 |
+
* \par Example:
|
| 802 |
+
* \code
|
| 803 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("example domain");
|
| 804 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 805 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 806 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 807 |
+
* eventAttrib.colorType = NVTX_COLOR_ARGB;
|
| 808 |
+
* eventAttrib.color = 0xFFFF0000;
|
| 809 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 810 |
+
* eventAttrib.message.ascii = "Level 0";
|
| 811 |
+
* nvtxDomainRangePushEx(domain, &eventAttrib);
|
| 812 |
+
*
|
| 813 |
+
* // Re-use eventAttrib
|
| 814 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_UNICODE;
|
| 815 |
+
* eventAttrib.message.unicode = L"Level 1";
|
| 816 |
+
* nvtxDomainRangePushEx(domain, &eventAttrib);
|
| 817 |
+
*
|
| 818 |
+
* nvtxDomainRangePop(domain); //level 1
|
| 819 |
+
* nvtxDomainRangePop(domain); //level 0
|
| 820 |
+
* \endcode
|
| 821 |
+
*
|
| 822 |
+
* \sa
|
| 823 |
+
* ::nvtxDomainRangePop
|
| 824 |
+
*
|
| 825 |
+
* \version \NVTX_VERSION_2
|
| 826 |
+
* @{ */
|
| 827 |
+
NVTX_DECLSPEC int NVTX_API nvtxDomainRangePushEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib);
|
| 828 |
+
/** @} */
|
| 829 |
+
|
| 830 |
+
/* ------------------------------------------------------------------------- */
|
| 831 |
+
/** \brief Starts a nested thread range.
|
| 832 |
+
*
|
| 833 |
+
* \param eventAttrib - The event attribute structure defining the range's
|
| 834 |
+
* attribute types and attribute values.
|
| 835 |
+
*
|
| 836 |
+
* \return The 0 based level of range being started. This level is per domain.
|
| 837 |
+
* If an error occurs a negative value is returned.
|
| 838 |
+
*
|
| 839 |
+
* \par Example:
|
| 840 |
+
* \code
|
| 841 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 842 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 843 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 844 |
+
* eventAttrib.colorType = NVTX_COLOR_ARGB;
|
| 845 |
+
* eventAttrib.color = 0xFFFF0000;
|
| 846 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 847 |
+
* eventAttrib.message.ascii = "Level 0";
|
| 848 |
+
* nvtxRangePushEx(&eventAttrib);
|
| 849 |
+
*
|
| 850 |
+
* // Re-use eventAttrib
|
| 851 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_UNICODE;
|
| 852 |
+
* eventAttrib.message.unicode = L"Level 1";
|
| 853 |
+
* nvtxRangePushEx(&eventAttrib);
|
| 854 |
+
*
|
| 855 |
+
* nvtxRangePop();
|
| 856 |
+
* nvtxRangePop();
|
| 857 |
+
* \endcode
|
| 858 |
+
*
|
| 859 |
+
* \sa
|
| 860 |
+
* ::nvtxDomainRangePushEx
|
| 861 |
+
* ::nvtxRangePop
|
| 862 |
+
*
|
| 863 |
+
* \version \NVTX_VERSION_1
|
| 864 |
+
* @{ */
|
| 865 |
+
NVTX_DECLSPEC int NVTX_API nvtxRangePushEx(const nvtxEventAttributes_t* eventAttrib);
|
| 866 |
+
/** @} */
|
| 867 |
+
|
| 868 |
+
/* ------------------------------------------------------------------------- */
|
| 869 |
+
/** \brief Starts a nested thread range.
|
| 870 |
+
*
|
| 871 |
+
* \param message - The event message associated to this range event.
|
| 872 |
+
*
|
| 873 |
+
* \return The 0 based level of range being started. If an error occurs a
|
| 874 |
+
* negative value is returned.
|
| 875 |
+
*
|
| 876 |
+
* \par Example:
|
| 877 |
+
* \code
|
| 878 |
+
* nvtxRangePushA("Level 0");
|
| 879 |
+
* nvtxRangePushW(L"Level 1");
|
| 880 |
+
* nvtxRangePop();
|
| 881 |
+
* nvtxRangePop();
|
| 882 |
+
* \endcode
|
| 883 |
+
*
|
| 884 |
+
* \sa
|
| 885 |
+
* ::nvtxDomainRangePushEx
|
| 886 |
+
* ::nvtxRangePop
|
| 887 |
+
*
|
| 888 |
+
* \version \NVTX_VERSION_0
|
| 889 |
+
* @{ */
|
| 890 |
+
NVTX_DECLSPEC int NVTX_API nvtxRangePushA(const char* message);
|
| 891 |
+
NVTX_DECLSPEC int NVTX_API nvtxRangePushW(const wchar_t* message);
|
| 892 |
+
/** @} */
|
| 893 |
+
|
| 894 |
+
|
| 895 |
+
/* ------------------------------------------------------------------------- */
|
| 896 |
+
/** \brief Ends a nested thread range.
|
| 897 |
+
*
|
| 898 |
+
* \return The level of the range being ended. If an error occurs a negative
|
| 899 |
+
* value is returned on the current thread.
|
| 900 |
+
*
|
| 901 |
+
* \par Example:
|
| 902 |
+
* \code
|
| 903 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreate("example library");
|
| 904 |
+
* nvtxDomainRangePushA(domain, "Level 0");
|
| 905 |
+
* nvtxDomainRangePushW(domain, L"Level 1");
|
| 906 |
+
* nvtxDomainRangePop(domain);
|
| 907 |
+
* nvtxDomainRangePop(domain);
|
| 908 |
+
* \endcode
|
| 909 |
+
*
|
| 910 |
+
* \sa
|
| 911 |
+
* ::nvtxRangePushEx
|
| 912 |
+
* ::nvtxRangePushA
|
| 913 |
+
* ::nvtxRangePushW
|
| 914 |
+
*
|
| 915 |
+
* \version \NVTX_VERSION_2
|
| 916 |
+
* @{ */
|
| 917 |
+
NVTX_DECLSPEC int NVTX_API nvtxDomainRangePop(nvtxDomainHandle_t domain);
|
| 918 |
+
/** @} */
|
| 919 |
+
|
| 920 |
+
/* ------------------------------------------------------------------------- */
|
| 921 |
+
/** \brief Ends a nested thread range.
|
| 922 |
+
*
|
| 923 |
+
* \return The level of the range being ended. If an error occurs a negative
|
| 924 |
+
* value is returned on the current thread.
|
| 925 |
+
*
|
| 926 |
+
* \par Example:
|
| 927 |
+
* \code
|
| 928 |
+
* nvtxRangePushA("Level 0");
|
| 929 |
+
* nvtxRangePushW(L"Level 1");
|
| 930 |
+
* nvtxRangePop();
|
| 931 |
+
* nvtxRangePop();
|
| 932 |
+
* \endcode
|
| 933 |
+
*
|
| 934 |
+
* \sa
|
| 935 |
+
* ::nvtxRangePushEx
|
| 936 |
+
* ::nvtxRangePushA
|
| 937 |
+
* ::nvtxRangePushW
|
| 938 |
+
*
|
| 939 |
+
* \version \NVTX_VERSION_0
|
| 940 |
+
* @{ */
|
| 941 |
+
NVTX_DECLSPEC int NVTX_API nvtxRangePop(void);
|
| 942 |
+
/** @} */
|
| 943 |
+
|
| 944 |
+
|
| 945 |
+
/** @} */ /*END defgroup*/
|
| 946 |
+
/* ========================================================================= */
|
| 947 |
+
/** \defgroup RESOURCE_NAMING Resource Naming
|
| 948 |
+
*
|
| 949 |
+
* See \ref RESOURCE_NAMING for more details
|
| 950 |
+
*
|
| 951 |
+
* @{
|
| 952 |
+
*/
|
| 953 |
+
|
| 954 |
+
|
| 955 |
+
/* ------------------------------------------------------------------------- */
|
| 956 |
+
/** \name Functions for Generic Resource Naming*/
|
| 957 |
+
/* ------------------------------------------------------------------------- */
|
| 958 |
+
|
| 959 |
+
/* ------------------------------------------------------------------------- */
|
| 960 |
+
/** \cond SHOW_HIDDEN
|
| 961 |
+
* \brief Resource typing helpers.
|
| 962 |
+
*
|
| 963 |
+
* Classes are used to make it easy to create a series of resource types
|
| 964 |
+
* per API without collisions
|
| 965 |
+
*/
|
| 966 |
+
#define NVTX_RESOURCE_MAKE_TYPE(CLASS, INDEX) ((((uint32_t)(NVTX_RESOURCE_CLASS_ ## CLASS))<<16)|((uint32_t)(INDEX)))
|
| 967 |
+
#define NVTX_RESOURCE_CLASS_GENERIC 1
|
| 968 |
+
/** \endcond */
|
| 969 |
+
|
| 970 |
+
/* ------------------------------------------------------------------------- */
|
| 971 |
+
/** \brief Generic resource type for when a resource class is not available.
|
| 972 |
+
*
|
| 973 |
+
* \sa
|
| 974 |
+
* ::nvtxDomainResourceCreate
|
| 975 |
+
*
|
| 976 |
+
* \version \NVTX_VERSION_2
|
| 977 |
+
*/
|
| 978 |
+
typedef enum nvtxResourceGenericType_t
|
| 979 |
+
{
|
| 980 |
+
NVTX_RESOURCE_TYPE_UNKNOWN = 0,
|
| 981 |
+
NVTX_RESOURCE_TYPE_GENERIC_POINTER = NVTX_RESOURCE_MAKE_TYPE(GENERIC, 1), /**< Generic pointer assumed to have no collisions with other pointers. */
|
| 982 |
+
NVTX_RESOURCE_TYPE_GENERIC_HANDLE = NVTX_RESOURCE_MAKE_TYPE(GENERIC, 2), /**< Generic handle assumed to have no collisions with other handles. */
|
| 983 |
+
NVTX_RESOURCE_TYPE_GENERIC_THREAD_NATIVE = NVTX_RESOURCE_MAKE_TYPE(GENERIC, 3), /**< OS native thread identifier. */
|
| 984 |
+
NVTX_RESOURCE_TYPE_GENERIC_THREAD_POSIX = NVTX_RESOURCE_MAKE_TYPE(GENERIC, 4) /**< POSIX pthread identifier. */
|
| 985 |
+
} nvtxResourceGenericType_t;
|
| 986 |
+
|
| 987 |
+
|
| 988 |
+
|
| 989 |
+
/** \brief Resource Attribute Structure.
|
| 990 |
+
* \anchor RESOURCE_ATTRIBUTE_STRUCTURE
|
| 991 |
+
*
|
| 992 |
+
* This structure is used to describe the attributes of a resource. The layout of
|
| 993 |
+
* the structure is defined by a specific version of the tools extension
|
| 994 |
+
* library and can change between different versions of the Tools Extension
|
| 995 |
+
* library.
|
| 996 |
+
*
|
| 997 |
+
* \par Initializing the Attributes
|
| 998 |
+
*
|
| 999 |
+
* The caller should always perform the following three tasks when using
|
| 1000 |
+
* attributes:
|
| 1001 |
+
* <ul>
|
| 1002 |
+
* <li>Zero the structure
|
| 1003 |
+
* <li>Set the version field
|
| 1004 |
+
* <li>Set the size field
|
| 1005 |
+
* </ul>
|
| 1006 |
+
*
|
| 1007 |
+
* Zeroing the structure sets all the resource attributes types and values
|
| 1008 |
+
* to the default value.
|
| 1009 |
+
*
|
| 1010 |
+
* The version and size field are used by the Tools Extension
|
| 1011 |
+
* implementation to handle multiple versions of the attributes structure.
|
| 1012 |
+
*
|
| 1013 |
+
* It is recommended that the caller use one of the following to methods
|
| 1014 |
+
* to initialize the event attributes structure:
|
| 1015 |
+
*
|
| 1016 |
+
* \par Method 1: Initializing nvtxEventAttributes for future compatibility
|
| 1017 |
+
* \code
|
| 1018 |
+
* nvtxResourceAttributes_t attribs = {0};
|
| 1019 |
+
* attribs.version = NVTX_VERSION;
|
| 1020 |
+
* attribs.size = NVTX_RESOURCE_ATTRIB_STRUCT_SIZE;
|
| 1021 |
+
* \endcode
|
| 1022 |
+
*
|
| 1023 |
+
* \par Method 2: Initializing nvtxEventAttributes for a specific version
|
| 1024 |
+
* \code
|
| 1025 |
+
* nvtxResourceAttributes_v0 attribs = {0};
|
| 1026 |
+
* attribs.version = 2;
|
| 1027 |
+
* attribs.size = (uint16_t)(sizeof(nvtxResourceAttributes_v0));
|
| 1028 |
+
* \endcode
|
| 1029 |
+
*
|
| 1030 |
+
* If the caller uses Method 1 it is critical that the entire binary
|
| 1031 |
+
* layout of the structure be configured to 0 so that all fields
|
| 1032 |
+
* are initialized to the default value.
|
| 1033 |
+
*
|
| 1034 |
+
* The caller should either use both NVTX_VERSION and
|
| 1035 |
+
* NVTX_RESOURCE_ATTRIB_STRUCT_SIZE (Method 1) or use explicit values
|
| 1036 |
+
* and a versioned type (Method 2). Using a mix of the two methods
|
| 1037 |
+
* will likely cause either source level incompatibility or binary
|
| 1038 |
+
* incompatibility in the future.
|
| 1039 |
+
*
|
| 1040 |
+
* \par Settings Attribute Types and Values
|
| 1041 |
+
*
|
| 1042 |
+
*
|
| 1043 |
+
* \par Example:
|
| 1044 |
+
* \code
|
| 1045 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("example domain");
|
| 1046 |
+
*
|
| 1047 |
+
* // Initialize
|
| 1048 |
+
* nvtxResourceAttributes_t attribs = {0};
|
| 1049 |
+
* attribs.version = NVTX_VERSION;
|
| 1050 |
+
* attribs.size = NVTX_RESOURCE_ATTRIB_STRUCT_SIZE;
|
| 1051 |
+
*
|
| 1052 |
+
* // Configure the Attributes
|
| 1053 |
+
* attribs.identifierType = NVTX_RESOURCE_TYPE_GENERIC_POINTER;
|
| 1054 |
+
* attribs.identifier.pValue = (const void*)pMutex;
|
| 1055 |
+
* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 1056 |
+
* attribs.message.ascii = "Single thread access to database.";
|
| 1057 |
+
*
|
| 1058 |
+
* nvtxResourceHandle_t handle = nvtxDomainResourceCreate(domain, attribs);
|
| 1059 |
+
* \endcode
|
| 1060 |
+
*
|
| 1061 |
+
* \sa
|
| 1062 |
+
* ::nvtxDomainResourceCreate
|
| 1063 |
+
*/
|
| 1064 |
+
typedef struct nvtxResourceAttributes_v0
|
| 1065 |
+
{
|
| 1066 |
+
/**
|
| 1067 |
+
* \brief Version flag of the structure.
|
| 1068 |
+
*
|
| 1069 |
+
* Needs to be set to NVTX_VERSION to indicate the version of NVTX APIs
|
| 1070 |
+
* supported in this header file. This can optionally be overridden to
|
| 1071 |
+
* another version of the tools extension library.
|
| 1072 |
+
*/
|
| 1073 |
+
uint16_t version;
|
| 1074 |
+
|
| 1075 |
+
/**
|
| 1076 |
+
* \brief Size of the structure.
|
| 1077 |
+
*
|
| 1078 |
+
* Needs to be set to the size in bytes of this attribute
|
| 1079 |
+
* structure.
|
| 1080 |
+
*/
|
| 1081 |
+
uint16_t size;
|
| 1082 |
+
|
| 1083 |
+
/**
|
| 1084 |
+
* \brief Identifier type specifies how to interpret the identifier field
|
| 1085 |
+
*
|
| 1086 |
+
* Defines the identifier format of the attribute structure's \ref RESOURCE_IDENTIFIER_FIELD
|
| 1087 |
+
* "identifier" field.
|
| 1088 |
+
*
|
| 1089 |
+
* Default Value is NVTX_RESOURCE_TYPE_UNKNOWN
|
| 1090 |
+
*/
|
| 1091 |
+
int32_t identifierType; /* values from enums following the pattern nvtxResource[name]Type_t */
|
| 1092 |
+
|
| 1093 |
+
/**
|
| 1094 |
+
* \brief Identifier for the resource.
|
| 1095 |
+
* \anchor RESOURCE_IDENTIFIER_FIELD
|
| 1096 |
+
*
|
| 1097 |
+
* An identifier may be a pointer or a handle to an OS or middleware API object.
|
| 1098 |
+
* The resource type will assist in avoiding collisions where handles values may collide.
|
| 1099 |
+
*/
|
| 1100 |
+
union identifier_t
|
| 1101 |
+
{
|
| 1102 |
+
const void* pValue;
|
| 1103 |
+
uint64_t ullValue;
|
| 1104 |
+
} identifier;
|
| 1105 |
+
|
| 1106 |
+
/** \brief Message type specified in this attribute structure.
|
| 1107 |
+
*
|
| 1108 |
+
* Defines the message format of the attribute structure's \ref RESOURCE_MESSAGE_FIELD
|
| 1109 |
+
* "message" field.
|
| 1110 |
+
*
|
| 1111 |
+
* Default Value is NVTX_MESSAGE_UNKNOWN
|
| 1112 |
+
*/
|
| 1113 |
+
int32_t messageType; /* nvtxMessageType_t */
|
| 1114 |
+
|
| 1115 |
+
/** \brief Message assigned to this attribute structure. \anchor RESOURCE_MESSAGE_FIELD
|
| 1116 |
+
*
|
| 1117 |
+
* The text message that is attached to a resource.
|
| 1118 |
+
*/
|
| 1119 |
+
nvtxMessageValue_t message;
|
| 1120 |
+
|
| 1121 |
+
} nvtxResourceAttributes_v0;
|
| 1122 |
+
|
| 1123 |
+
typedef struct nvtxResourceAttributes_v0 nvtxResourceAttributes_t;
|
| 1124 |
+
|
| 1125 |
+
/* \cond SHOW_HIDDEN
|
| 1126 |
+
* \version \NVTX_VERSION_2
|
| 1127 |
+
*/
|
| 1128 |
+
#define NVTX_RESOURCE_ATTRIB_STRUCT_SIZE ( (uint16_t)( sizeof(nvtxResourceAttributes_v0) ) )
|
| 1129 |
+
typedef struct nvtxResourceHandle* nvtxResourceHandle_t;
|
| 1130 |
+
/** \endcond */
|
| 1131 |
+
|
| 1132 |
+
|
| 1133 |
+
|
| 1134 |
+
/* ------------------------------------------------------------------------- */
|
| 1135 |
+
/** \brief Create a resource object to track and associate data with OS and middleware objects
|
| 1136 |
+
*
|
| 1137 |
+
* Allows users to associate an API handle or pointer with a user-provided name.
|
| 1138 |
+
*
|
| 1139 |
+
*
|
| 1140 |
+
* \param domain - Domain to own the resource object
|
| 1141 |
+
* \param attribs - Attributes to be associated with the resource
|
| 1142 |
+
*
|
| 1143 |
+
* \return A handle that represents the newly created resource object.
|
| 1144 |
+
*
|
| 1145 |
+
* \par Example:
|
| 1146 |
+
* \code
|
| 1147 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("example domain");
|
| 1148 |
+
* nvtxResourceAttributes_t attribs = {0};
|
| 1149 |
+
* attribs.version = NVTX_VERSION;
|
| 1150 |
+
* attribs.size = NVTX_RESOURCE_ATTRIB_STRUCT_SIZE;
|
| 1151 |
+
* attribs.identifierType = NVTX_RESOURCE_TYPE_GENERIC_POINTER;
|
| 1152 |
+
* attribs.identifier.pValue = (const void*)pMutex;
|
| 1153 |
+
* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 1154 |
+
* attribs.message.ascii = "Single thread access to database.";
|
| 1155 |
+
* nvtxResourceHandle_t handle = nvtxDomainResourceCreate(domain, attribs);
|
| 1156 |
+
* \endcode
|
| 1157 |
+
*
|
| 1158 |
+
* \sa
|
| 1159 |
+
* ::nvtxResourceAttributes_t
|
| 1160 |
+
* ::nvtxDomainResourceDestroy
|
| 1161 |
+
*
|
| 1162 |
+
* \version \NVTX_VERSION_2
|
| 1163 |
+
* @{ */
|
| 1164 |
+
NVTX_DECLSPEC nvtxResourceHandle_t NVTX_API nvtxDomainResourceCreate(nvtxDomainHandle_t domain, nvtxResourceAttributes_t* attribs);
|
| 1165 |
+
/** @} */
|
| 1166 |
+
|
| 1167 |
+
/* ------------------------------------------------------------------------- */
|
| 1168 |
+
/** \brief Destroy a resource object to track and associate data with OS and middleware objects
|
| 1169 |
+
*
|
| 1170 |
+
* Allows users to associate an API handle or pointer with a user-provided name.
|
| 1171 |
+
*
|
| 1172 |
+
* \param resource - Handle to the resource in which to operate.
|
| 1173 |
+
*
|
| 1174 |
+
* \par Example:
|
| 1175 |
+
* \code
|
| 1176 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("example domain");
|
| 1177 |
+
* nvtxResourceAttributes_t attribs = {0};
|
| 1178 |
+
* attribs.version = NVTX_VERSION;
|
| 1179 |
+
* attribs.size = NVTX_RESOURCE_ATTRIB_STRUCT_SIZE;
|
| 1180 |
+
* attribs.identifierType = NVTX_RESOURCE_TYPE_GENERIC_POINTER;
|
| 1181 |
+
* attribs.identifier.pValue = (const void*)pMutex;
|
| 1182 |
+
* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 1183 |
+
* attribs.message.ascii = "Single thread access to database.";
|
| 1184 |
+
* nvtxResourceHandle_t handle = nvtxDomainResourceCreate(domain, attribs);
|
| 1185 |
+
* nvtxDomainResourceDestroy(handle);
|
| 1186 |
+
* \endcode
|
| 1187 |
+
*
|
| 1188 |
+
* \sa
|
| 1189 |
+
* ::nvtxDomainResourceCreate
|
| 1190 |
+
*
|
| 1191 |
+
* \version \NVTX_VERSION_2
|
| 1192 |
+
* @{ */
|
| 1193 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainResourceDestroy(nvtxResourceHandle_t resource);
|
| 1194 |
+
/** @} */
|
| 1195 |
+
|
| 1196 |
+
|
| 1197 |
+
/** \name Functions for NVTX Category Naming*/
|
| 1198 |
+
|
| 1199 |
+
/* ------------------------------------------------------------------------- */
|
| 1200 |
+
/**
|
| 1201 |
+
* \brief Annotate an NVTX category used within a domain.
|
| 1202 |
+
*
|
| 1203 |
+
* Categories are used to group sets of events. Each category is identified
|
| 1204 |
+
* through a unique ID and that ID is passed into any of the marker/range
|
| 1205 |
+
* events to assign that event to a specific category. The nvtxDomainNameCategory
|
| 1206 |
+
* function calls allow the user to assign a name to a category ID that is
|
| 1207 |
+
* specific to the domain.
|
| 1208 |
+
*
|
| 1209 |
+
* nvtxDomainNameCategory(NULL, category, name) is equivalent to calling
|
| 1210 |
+
* nvtxNameCategory(category, name).
|
| 1211 |
+
*
|
| 1212 |
+
* \param domain - The domain of scoping the category.
|
| 1213 |
+
* \param category - The category ID to name.
|
| 1214 |
+
* \param name - The name of the category.
|
| 1215 |
+
*
|
| 1216 |
+
* \remarks The category names are tracked per domain.
|
| 1217 |
+
*
|
| 1218 |
+
* \par Example:
|
| 1219 |
+
* \code
|
| 1220 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("example");
|
| 1221 |
+
* nvtxDomainNameCategoryA(domain, 1, "Memory Allocation");
|
| 1222 |
+
* nvtxDomainNameCategoryW(domain, 2, L"Memory Transfer");
|
| 1223 |
+
* \endcode
|
| 1224 |
+
*
|
| 1225 |
+
* \version \NVTX_VERSION_2
|
| 1226 |
+
* @{ */
|
| 1227 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainNameCategoryA(nvtxDomainHandle_t domain, uint32_t category, const char* name);
|
| 1228 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainNameCategoryW(nvtxDomainHandle_t domain, uint32_t category, const wchar_t* name);
|
| 1229 |
+
/** @} */
|
| 1230 |
+
|
| 1231 |
+
/** \brief Annotate an NVTX category.
|
| 1232 |
+
*
|
| 1233 |
+
* Categories are used to group sets of events. Each category is identified
|
| 1234 |
+
* through a unique ID and that ID is passed into any of the marker/range
|
| 1235 |
+
* events to assign that event to a specific category. The nvtxNameCategory
|
| 1236 |
+
* function calls allow the user to assign a name to a category ID.
|
| 1237 |
+
*
|
| 1238 |
+
* \param category - The category ID to name.
|
| 1239 |
+
* \param name - The name of the category.
|
| 1240 |
+
*
|
| 1241 |
+
* \remarks The category names are tracked per process.
|
| 1242 |
+
*
|
| 1243 |
+
* \par Example:
|
| 1244 |
+
* \code
|
| 1245 |
+
* nvtxNameCategory(1, "Memory Allocation");
|
| 1246 |
+
* nvtxNameCategory(2, "Memory Transfer");
|
| 1247 |
+
* nvtxNameCategory(3, "Memory Object Lifetime");
|
| 1248 |
+
* \endcode
|
| 1249 |
+
*
|
| 1250 |
+
* \version \NVTX_VERSION_1
|
| 1251 |
+
* @{ */
|
| 1252 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCategoryA(uint32_t category, const char* name);
|
| 1253 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCategoryW(uint32_t category, const wchar_t* name);
|
| 1254 |
+
/** @} */
|
| 1255 |
+
|
| 1256 |
+
/** \name Functions for OS Threads Naming*/
|
| 1257 |
+
|
| 1258 |
+
/* ------------------------------------------------------------------------- */
|
| 1259 |
+
/** \brief Annotate an OS thread.
|
| 1260 |
+
*
|
| 1261 |
+
* Allows the user to name an active thread of the current process. If an
|
| 1262 |
+
* invalid thread ID is provided or a thread ID from a different process is
|
| 1263 |
+
* used the behavior of the tool is implementation dependent.
|
| 1264 |
+
*
|
| 1265 |
+
* Tools expect thread ID to be a number that uniquely identifies the thread
|
| 1266 |
+
* at the time of the call. Note that a thread's ID can be reused after
|
| 1267 |
+
* it is destroyed. Tools may choose how to handle aliasing of thread IDs.
|
| 1268 |
+
*
|
| 1269 |
+
* POSIX pthread_t type returned by pthread_self() may not comply with these
|
| 1270 |
+
* expectations. Please use OS-specific thread ID instead of pthread_t.
|
| 1271 |
+
*
|
| 1272 |
+
* The thread name is associated to the default domain. To support domains
|
| 1273 |
+
* use resource objects via ::nvtxDomainResourceCreate.
|
| 1274 |
+
*
|
| 1275 |
+
* \param threadId - The ID of the thread to name.
|
| 1276 |
+
* \param name - The name of the thread.
|
| 1277 |
+
*
|
| 1278 |
+
* \par Examples:
|
| 1279 |
+
* MS Windows:
|
| 1280 |
+
* \code
|
| 1281 |
+
* #include <windows.h>
|
| 1282 |
+
* nvtxNameOsThread(GetCurrentThreadId(), "Current thread");
|
| 1283 |
+
* nvtxNameOsThread(GetThreadId(SomeThreadHandle), "Other thread");
|
| 1284 |
+
* \endcode
|
| 1285 |
+
*
|
| 1286 |
+
* Android:
|
| 1287 |
+
* \code
|
| 1288 |
+
* #include <unistd.h>
|
| 1289 |
+
* nvtxNameOsThreadA(gettid(), "Current thread");
|
| 1290 |
+
* nvtxNameOsThreadA(getpid(), "Main thread");
|
| 1291 |
+
* \endcode
|
| 1292 |
+
*
|
| 1293 |
+
* Linux:
|
| 1294 |
+
* \code
|
| 1295 |
+
* #include <sys/syscall.h>
|
| 1296 |
+
* nvtxNameOsThreadA(syscall(SYS_gettid), "Current thread");
|
| 1297 |
+
* \endcode
|
| 1298 |
+
* \code
|
| 1299 |
+
* #include <unistd.h>
|
| 1300 |
+
* nvtxNameOsThreadA(getpid(), "Main thread");
|
| 1301 |
+
* \endcode
|
| 1302 |
+
*
|
| 1303 |
+
* OS X:
|
| 1304 |
+
* \code
|
| 1305 |
+
* #include <sys/syscall.h>
|
| 1306 |
+
* nvtxNameOsThreadA(syscall(SYS_thread_selfid), "Current thread");
|
| 1307 |
+
* \endcode
|
| 1308 |
+
* \code
|
| 1309 |
+
* #include <pthread.h>
|
| 1310 |
+
* __uint64_t id;
|
| 1311 |
+
* pthread_threadid_np(pthread_self(), &id);
|
| 1312 |
+
* nvtxNameOsThreadA(id, "Current thread");
|
| 1313 |
+
* pthread_threadid_np(somePThreadId, &id);
|
| 1314 |
+
* nvtxNameOsThreadA(id, "Other thread");
|
| 1315 |
+
* \endcode
|
| 1316 |
+
*
|
| 1317 |
+
* \version \NVTX_VERSION_1
|
| 1318 |
+
* @{ */
|
| 1319 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameOsThreadA(uint32_t threadId, const char* name);
|
| 1320 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameOsThreadW(uint32_t threadId, const wchar_t* name);
|
| 1321 |
+
/** @} */
|
| 1322 |
+
|
| 1323 |
+
|
| 1324 |
+
/** @} */ /*END defgroup*/
|
| 1325 |
+
/* ========================================================================= */
|
| 1326 |
+
/** \defgroup STRING_REGISTRATION String Registration
|
| 1327 |
+
*
|
| 1328 |
+
* Registered strings are intended to increase performance by lowering instrumentation
|
| 1329 |
+
* overhead. String may be registered once and the handle may be passed in place of
|
| 1330 |
+
* a string where an the APIs may allow.
|
| 1331 |
+
*
|
| 1332 |
+
* See \ref STRING_REGISTRATION for more details
|
| 1333 |
+
*
|
| 1334 |
+
* @{
|
| 1335 |
+
*/
|
| 1336 |
+
|
| 1337 |
+
/* ------------------------------------------------------------------------- */
|
| 1338 |
+
/** \brief Register a string.
|
| 1339 |
+
|
| 1340 |
+
* Registers an immutable string with NVTX. Once registered the pointer used
|
| 1341 |
+
* to register the domain name can be used in nvtxEventAttributes_t
|
| 1342 |
+
* \ref MESSAGE_FIELD. This allows NVTX implementation to skip copying the
|
| 1343 |
+
* contents of the message on each event invocation.
|
| 1344 |
+
*
|
| 1345 |
+
* String registration is an optimization. It is recommended to use string
|
| 1346 |
+
* registration if the string will be passed to an event many times.
|
| 1347 |
+
*
|
| 1348 |
+
* String are not unregistered, except that by unregistering the entire domain
|
| 1349 |
+
*
|
| 1350 |
+
* \param domain - Domain handle. If NULL then the global domain is used.
|
| 1351 |
+
* \param string - A unique pointer to a sequence of characters.
|
| 1352 |
+
*
|
| 1353 |
+
* \return A handle representing the registered string.
|
| 1354 |
+
*
|
| 1355 |
+
* \par Example:
|
| 1356 |
+
* \code
|
| 1357 |
+
* nvtxDomainCreateA("com.nvidia.nvtx.example");
|
| 1358 |
+
* nvtxStringHandle_t message = nvtxDomainRegisterStringA(domain, "registered string");
|
| 1359 |
+
* nvtxEventAttributes_t eventAttrib = {0};
|
| 1360 |
+
* eventAttrib.version = NVTX_VERSION;
|
| 1361 |
+
* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 1362 |
+
* eventAttrib.messageType = NVTX_MESSAGE_TYPE_REGISTERED;
|
| 1363 |
+
* eventAttrib.message.registered = message;
|
| 1364 |
+
* \endcode
|
| 1365 |
+
*
|
| 1366 |
+
* \version \NVTX_VERSION_2
|
| 1367 |
+
* @{ */
|
| 1368 |
+
NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringA(nvtxDomainHandle_t domain, const char* string);
|
| 1369 |
+
NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringW(nvtxDomainHandle_t domain, const wchar_t* string);
|
| 1370 |
+
/** @} */
|
| 1371 |
+
|
| 1372 |
+
/** @} */ /*END defgroup*/
|
| 1373 |
+
/* ========================================================================= */
|
| 1374 |
+
/** \defgroup DOMAINS Domains
|
| 1375 |
+
*
|
| 1376 |
+
* Domains are used to group events to a developer defined scope. Middleware
|
| 1377 |
+
* vendors may also scope their own events to avoid collisions with the
|
| 1378 |
+
* the application developer's events, so that the application developer may
|
| 1379 |
+
* inspect both parts and easily differentiate or filter them. By default
|
| 1380 |
+
* all events are scoped to a global domain where NULL is provided or when
|
| 1381 |
+
* using APIs provided b versions of NVTX below v2
|
| 1382 |
+
*
|
| 1383 |
+
* Domains are intended to be typically long lived objects with the intention
|
| 1384 |
+
* of logically separating events of large modules from each other such as
|
| 1385 |
+
* middleware libraries from each other and the main application.
|
| 1386 |
+
*
|
| 1387 |
+
* See \ref DOMAINS for more details
|
| 1388 |
+
*
|
| 1389 |
+
* @{
|
| 1390 |
+
*/
|
| 1391 |
+
|
| 1392 |
+
/* ------------------------------------------------------------------------- */
|
| 1393 |
+
/** \brief Register a NVTX domain.
|
| 1394 |
+
*
|
| 1395 |
+
* Domains are used to scope annotations. All NVTX_VERSION_0 and NVTX_VERSION_1
|
| 1396 |
+
* annotations are scoped to the global domain. The function nvtxDomainCreate
|
| 1397 |
+
* creates a new named domain.
|
| 1398 |
+
*
|
| 1399 |
+
* Each domain maintains its own nvtxRangePush and nvtxRangePop stack.
|
| 1400 |
+
*
|
| 1401 |
+
* \param name - A unique string representing the domain.
|
| 1402 |
+
*
|
| 1403 |
+
* \return A handle representing the domain.
|
| 1404 |
+
*
|
| 1405 |
+
* \par Example:
|
| 1406 |
+
* \code
|
| 1407 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("com.nvidia.nvtx.example");
|
| 1408 |
+
*
|
| 1409 |
+
* nvtxMarkA("nvtxMarkA to global domain");
|
| 1410 |
+
*
|
| 1411 |
+
* nvtxEventAttributes_t eventAttrib1 = {0};
|
| 1412 |
+
* eventAttrib1.version = NVTX_VERSION;
|
| 1413 |
+
* eventAttrib1.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 1414 |
+
* eventAttrib1.message.ascii = "nvtxDomainMarkEx to global domain";
|
| 1415 |
+
* nvtxDomainMarkEx(NULL, &eventAttrib1);
|
| 1416 |
+
*
|
| 1417 |
+
* nvtxEventAttributes_t eventAttrib2 = {0};
|
| 1418 |
+
* eventAttrib2.version = NVTX_VERSION;
|
| 1419 |
+
* eventAttrib2.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
|
| 1420 |
+
* eventAttrib2.message.ascii = "nvtxDomainMarkEx to com.nvidia.nvtx.example";
|
| 1421 |
+
* nvtxDomainMarkEx(domain, &eventAttrib2);
|
| 1422 |
+
* nvtxDomainDestroy(domain);
|
| 1423 |
+
* \endcode
|
| 1424 |
+
*
|
| 1425 |
+
* \sa
|
| 1426 |
+
* ::nvtxDomainDestroy
|
| 1427 |
+
*
|
| 1428 |
+
* \version \NVTX_VERSION_2
|
| 1429 |
+
* @{ */
|
| 1430 |
+
NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateA(const char* name);
|
| 1431 |
+
NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateW(const wchar_t* name);
|
| 1432 |
+
/** @} */
|
| 1433 |
+
|
| 1434 |
+
/* ------------------------------------------------------------------------- */
|
| 1435 |
+
/** \brief Unregister a NVTX domain.
|
| 1436 |
+
*
|
| 1437 |
+
* Unregisters the domain handle and frees all domain specific resources.
|
| 1438 |
+
*
|
| 1439 |
+
* \param domain - the domain handle
|
| 1440 |
+
*
|
| 1441 |
+
* \par Example:
|
| 1442 |
+
* \code
|
| 1443 |
+
* nvtxDomainHandle_t domain = nvtxDomainCreateA("com.nvidia.nvtx.example");
|
| 1444 |
+
* nvtxDomainDestroy(domain);
|
| 1445 |
+
* \endcode
|
| 1446 |
+
*
|
| 1447 |
+
* \sa
|
| 1448 |
+
* ::nvtxDomainCreateA
|
| 1449 |
+
* ::nvtxDomainCreateW
|
| 1450 |
+
*
|
| 1451 |
+
* \version \NVTX_VERSION_2
|
| 1452 |
+
* @{ */
|
| 1453 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainDestroy(nvtxDomainHandle_t domain);
|
| 1454 |
+
/** @} */
|
| 1455 |
+
|
| 1456 |
+
|
| 1457 |
+
/** @} */ /*END defgroup*/
|
| 1458 |
+
/* ========================================================================= */
|
| 1459 |
+
/** \cond SHOW_HIDDEN */
|
| 1460 |
+
|
| 1461 |
+
#ifdef UNICODE
|
| 1462 |
+
#define nvtxMark nvtxMarkW
|
| 1463 |
+
#define nvtxRangeStart nvtxRangeStartW
|
| 1464 |
+
#define nvtxRangePush nvtxRangePushW
|
| 1465 |
+
#define nvtxNameCategory nvtxNameCategoryW
|
| 1466 |
+
#define nvtxNameOsThread nvtxNameOsThreadW
|
| 1467 |
+
/* NVTX_VERSION_2 */
|
| 1468 |
+
#define nvtxDomainCreate nvtxDomainCreateW
|
| 1469 |
+
#define nvtxDomainRegisterString nvtxDomainRegisterStringW
|
| 1470 |
+
#define nvtxDomainNameCategory nvtxDomainNameCategoryW
|
| 1471 |
+
#else
|
| 1472 |
+
#define nvtxMark nvtxMarkA
|
| 1473 |
+
#define nvtxRangeStart nvtxRangeStartA
|
| 1474 |
+
#define nvtxRangePush nvtxRangePushA
|
| 1475 |
+
#define nvtxNameCategory nvtxNameCategoryA
|
| 1476 |
+
#define nvtxNameOsThread nvtxNameOsThreadA
|
| 1477 |
+
/* NVTX_VERSION_2 */
|
| 1478 |
+
#define nvtxDomainCreate nvtxDomainCreateA
|
| 1479 |
+
#define nvtxDomainRegisterString nvtxDomainRegisterStringA
|
| 1480 |
+
#define nvtxDomainNameCategory nvtxDomainNameCategoryA
|
| 1481 |
+
#endif
|
| 1482 |
+
|
| 1483 |
+
/** \endcond */
|
| 1484 |
+
|
| 1485 |
+
#ifdef __cplusplus
|
| 1486 |
+
} /* extern "C" */
|
| 1487 |
+
#endif /* __cplusplus */
|
| 1488 |
+
|
| 1489 |
+
#define NVTX_IMPL_GUARD /* Ensure other headers cannot included directly */
|
| 1490 |
+
|
| 1491 |
+
#include "nvtxDetail/nvtxTypes.h"
|
| 1492 |
+
|
| 1493 |
+
#ifndef NVTX_NO_IMPL
|
| 1494 |
+
#include "nvtxDetail/nvtxImpl.h"
|
| 1495 |
+
#endif /*NVTX_NO_IMPL*/
|
| 1496 |
+
|
| 1497 |
+
#undef NVTX_IMPL_GUARD
|
| 1498 |
+
|
| 1499 |
+
#endif /* !defined(NVTX_VERSION) */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvToolsExtCuda.h
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2009-2016 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO USER:
|
| 5 |
+
*
|
| 6 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 11 |
+
* of a form of NVIDIA software license agreement.
|
| 12 |
+
*
|
| 13 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 14 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 15 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 16 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 17 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 18 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 19 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 20 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 21 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 22 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 23 |
+
*
|
| 24 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 25 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 26 |
+
* "commercial computer software" and "commercial computer software
|
| 27 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 28 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 29 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 30 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 31 |
+
* source code with only those rights set forth herein.
|
| 32 |
+
*
|
| 33 |
+
* Any use of this source code in individual and commercial software must
|
| 34 |
+
* include, in the user documentation and internal comments to the code,
|
| 35 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
#include "nvToolsExt.h"
|
| 39 |
+
|
| 40 |
+
#include "cuda.h"
|
| 41 |
+
|
| 42 |
+
#ifndef NVTOOLSEXT_CUDA_V3
|
| 43 |
+
#define NVTOOLSEXT_CUDA_V3
|
| 44 |
+
|
| 45 |
+
#ifdef __cplusplus
|
| 46 |
+
extern "C" {
|
| 47 |
+
#endif /* __cplusplus */
|
| 48 |
+
|
| 49 |
+
/* ========================================================================= */
|
| 50 |
+
/** \name Functions for CUDA Resource Naming
|
| 51 |
+
*/
|
| 52 |
+
/** \addtogroup RESOURCE_NAMING
|
| 53 |
+
* \section RESOURCE_NAMING_CUDA CUDA Resource Naming
|
| 54 |
+
*
|
| 55 |
+
* This section covers the API functions that allow to annotate CUDA resources
|
| 56 |
+
* with user-provided names.
|
| 57 |
+
*
|
| 58 |
+
* @{
|
| 59 |
+
*/
|
| 60 |
+
|
| 61 |
+
/* ------------------------------------------------------------------------- */
|
| 62 |
+
/* \cond SHOW_HIDDEN
|
| 63 |
+
* \brief Used to build a non-colliding value for resource types separated class
|
| 64 |
+
* \version \NVTX_VERSION_2
|
| 65 |
+
*/
|
| 66 |
+
#define NVTX_RESOURCE_CLASS_CUDA 4
|
| 67 |
+
/** \endcond */
|
| 68 |
+
|
| 69 |
+
/* ------------------------------------------------------------------------- */
|
| 70 |
+
/** \brief Resource types for CUDA
|
| 71 |
+
*/
|
| 72 |
+
typedef enum nvtxResourceCUDAType_t
|
| 73 |
+
{
|
| 74 |
+
NVTX_RESOURCE_TYPE_CUDA_DEVICE = NVTX_RESOURCE_MAKE_TYPE(CUDA, 1), /* CUdevice */
|
| 75 |
+
NVTX_RESOURCE_TYPE_CUDA_CONTEXT = NVTX_RESOURCE_MAKE_TYPE(CUDA, 2), /* CUcontext */
|
| 76 |
+
NVTX_RESOURCE_TYPE_CUDA_STREAM = NVTX_RESOURCE_MAKE_TYPE(CUDA, 3), /* CUstream */
|
| 77 |
+
NVTX_RESOURCE_TYPE_CUDA_EVENT = NVTX_RESOURCE_MAKE_TYPE(CUDA, 4), /* CUevent */
|
| 78 |
+
} nvtxResourceCUDAType_t;
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
/* ------------------------------------------------------------------------- */
|
| 82 |
+
/** \brief Annotates a CUDA device.
|
| 83 |
+
*
|
| 84 |
+
* Allows the user to associate a CUDA device with a user-provided name.
|
| 85 |
+
*
|
| 86 |
+
* \param device - The handle of the CUDA device to name.
|
| 87 |
+
* \param name - The name of the CUDA device.
|
| 88 |
+
*
|
| 89 |
+
* \version \NVTX_VERSION_1
|
| 90 |
+
* @{ */
|
| 91 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceA(CUdevice device, const char* name);
|
| 92 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceW(CUdevice device, const wchar_t* name);
|
| 93 |
+
/** @} */
|
| 94 |
+
|
| 95 |
+
/* ------------------------------------------------------------------------- */
|
| 96 |
+
/** \brief Annotates a CUDA context.
|
| 97 |
+
*
|
| 98 |
+
* Allows the user to associate a CUDA context with a user-provided name.
|
| 99 |
+
*
|
| 100 |
+
* \param context - The handle of the CUDA context to name.
|
| 101 |
+
* \param name - The name of the CUDA context.
|
| 102 |
+
*
|
| 103 |
+
* \par Example:
|
| 104 |
+
* \code
|
| 105 |
+
* CUresult status = cuCtxCreate( &cuContext, 0, cuDevice );
|
| 106 |
+
* if ( CUDA_SUCCESS != status )
|
| 107 |
+
* goto Error;
|
| 108 |
+
* nvtxNameCuContext(cuContext, "CTX_NAME");
|
| 109 |
+
* \endcode
|
| 110 |
+
*
|
| 111 |
+
* \version \NVTX_VERSION_1
|
| 112 |
+
* @{ */
|
| 113 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuContextA(CUcontext context, const char* name);
|
| 114 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuContextW(CUcontext context, const wchar_t* name);
|
| 115 |
+
/** @} */
|
| 116 |
+
|
| 117 |
+
/* ------------------------------------------------------------------------- */
|
| 118 |
+
/** \brief Annotates a CUDA stream.
|
| 119 |
+
*
|
| 120 |
+
* Allows the user to associate a CUDA stream with a user-provided name.
|
| 121 |
+
*
|
| 122 |
+
* \param stream - The handle of the CUDA stream to name.
|
| 123 |
+
* \param name - The name of the CUDA stream.
|
| 124 |
+
*
|
| 125 |
+
* \version \NVTX_VERSION_1
|
| 126 |
+
* @{ */
|
| 127 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamA(CUstream stream, const char* name);
|
| 128 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamW(CUstream stream, const wchar_t* name);
|
| 129 |
+
/** @} */
|
| 130 |
+
|
| 131 |
+
/* ------------------------------------------------------------------------- */
|
| 132 |
+
/** \brief Annotates a CUDA event.
|
| 133 |
+
*
|
| 134 |
+
* Allows the user to associate a CUDA event with a user-provided name.
|
| 135 |
+
*
|
| 136 |
+
* \param event - The handle of the CUDA event to name.
|
| 137 |
+
* \param name - The name of the CUDA event.
|
| 138 |
+
*
|
| 139 |
+
* \version \NVTX_VERSION_1
|
| 140 |
+
* @{ */
|
| 141 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuEventA(CUevent event, const char* name);
|
| 142 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuEventW(CUevent event, const wchar_t* name);
|
| 143 |
+
/** @} */
|
| 144 |
+
|
| 145 |
+
/** @} */ /* END RESOURCE_NAMING */
|
| 146 |
+
|
| 147 |
+
/* ========================================================================= */
|
| 148 |
+
#ifdef UNICODE
|
| 149 |
+
#define nvtxNameCuDevice nvtxNameCuDeviceW
|
| 150 |
+
#define nvtxNameCuContext nvtxNameCuContextW
|
| 151 |
+
#define nvtxNameCuStream nvtxNameCuStreamW
|
| 152 |
+
#define nvtxNameCuEvent nvtxNameCuEventW
|
| 153 |
+
#else
|
| 154 |
+
#define nvtxNameCuDevice nvtxNameCuDeviceA
|
| 155 |
+
#define nvtxNameCuContext nvtxNameCuContextA
|
| 156 |
+
#define nvtxNameCuStream nvtxNameCuStreamA
|
| 157 |
+
#define nvtxNameCuEvent nvtxNameCuEventA
|
| 158 |
+
#endif
|
| 159 |
+
|
| 160 |
+
#ifdef __cplusplus
|
| 161 |
+
}
|
| 162 |
+
#endif /* __cplusplus */
|
| 163 |
+
|
| 164 |
+
#ifndef NVTX_NO_IMPL
|
| 165 |
+
#define NVTX_IMPL_GUARD_CUDA /* Ensure other headers cannot included directly */
|
| 166 |
+
#include "nvtxDetail/nvtxImplCuda_v3.h"
|
| 167 |
+
#undef NVTX_IMPL_GUARD_CUDA
|
| 168 |
+
#endif /*NVTX_NO_IMPL*/
|
| 169 |
+
|
| 170 |
+
#endif /* NVTOOLSEXT_CUDA_V3 */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvToolsExtCudaRt.h
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2009-2016 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO USER:
|
| 5 |
+
*
|
| 6 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 11 |
+
* of a form of NVIDIA software license agreement.
|
| 12 |
+
*
|
| 13 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 14 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 15 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 16 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 17 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 18 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 19 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 20 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 21 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 22 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 23 |
+
*
|
| 24 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 25 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 26 |
+
* "commercial computer software" and "commercial computer software
|
| 27 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 28 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 29 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 30 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 31 |
+
* source code with only those rights set forth herein.
|
| 32 |
+
*
|
| 33 |
+
* Any use of this source code in individual and commercial software must
|
| 34 |
+
* include, in the user documentation and internal comments to the code,
|
| 35 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
#include "nvToolsExt.h"
|
| 39 |
+
|
| 40 |
+
#include "cuda.h"
|
| 41 |
+
#include "driver_types.h"
|
| 42 |
+
|
| 43 |
+
#ifndef NVTOOLSEXT_CUDART_V3
|
| 44 |
+
#define NVTOOLSEXT_CUDART_V3
|
| 45 |
+
|
| 46 |
+
#ifdef __cplusplus
|
| 47 |
+
extern "C" {
|
| 48 |
+
#endif /* __cplusplus */
|
| 49 |
+
|
| 50 |
+
/* ========================================================================= */
|
| 51 |
+
/** \name Functions for CUDA Resource Naming
|
| 52 |
+
*/
|
| 53 |
+
/** \addtogroup RESOURCE_NAMING
|
| 54 |
+
* \section RESOURCE_NAMING_CUDART CUDA Runtime Resource Naming
|
| 55 |
+
*
|
| 56 |
+
* This section covers the API functions that allow to annotate CUDA resources
|
| 57 |
+
* with user-provided names.
|
| 58 |
+
*
|
| 59 |
+
* @{
|
| 60 |
+
*/
|
| 61 |
+
|
| 62 |
+
/* ------------------------------------------------------------------------- */
|
| 63 |
+
/* \cond SHOW_HIDDEN
|
| 64 |
+
* \brief Used to build a non-colliding value for resource types separated class
|
| 65 |
+
* \version \NVTX_VERSION_2
|
| 66 |
+
*/
|
| 67 |
+
#define NVTX_RESOURCE_CLASS_CUDART 5
|
| 68 |
+
/** \endcond */
|
| 69 |
+
|
| 70 |
+
/* ------------------------------------------------------------------------- */
|
| 71 |
+
/** \brief Resource types for CUDART
|
| 72 |
+
*/
|
| 73 |
+
typedef enum nvtxResourceCUDARTType_t
|
| 74 |
+
{
|
| 75 |
+
NVTX_RESOURCE_TYPE_CUDART_DEVICE = NVTX_RESOURCE_MAKE_TYPE(CUDART, 0), /* int device */
|
| 76 |
+
NVTX_RESOURCE_TYPE_CUDART_STREAM = NVTX_RESOURCE_MAKE_TYPE(CUDART, 1), /* cudaStream_t */
|
| 77 |
+
NVTX_RESOURCE_TYPE_CUDART_EVENT = NVTX_RESOURCE_MAKE_TYPE(CUDART, 2), /* cudaEvent_t */
|
| 78 |
+
} nvtxResourceCUDARTType_t;
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
/* ------------------------------------------------------------------------- */
|
| 82 |
+
/** \brief Annotates a CUDA device.
|
| 83 |
+
*
|
| 84 |
+
* Allows the user to associate a CUDA device with a user-provided name.
|
| 85 |
+
*
|
| 86 |
+
* \param device - The id of the CUDA device to name.
|
| 87 |
+
* \param name - The name of the CUDA device.
|
| 88 |
+
*
|
| 89 |
+
* \version \NVTX_VERSION_1
|
| 90 |
+
* @{ */
|
| 91 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceA(int device, const char* name);
|
| 92 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceW(int device, const wchar_t* name);
|
| 93 |
+
/** @} */
|
| 94 |
+
|
| 95 |
+
/* ------------------------------------------------------------------------- */
|
| 96 |
+
/** \brief Annotates a CUDA stream.
|
| 97 |
+
*
|
| 98 |
+
* Allows the user to associate a CUDA stream with a user-provided name.
|
| 99 |
+
*
|
| 100 |
+
* \param stream - The handle of the CUDA stream to name.
|
| 101 |
+
* \param name - The name of the CUDA stream.
|
| 102 |
+
*
|
| 103 |
+
* \version \NVTX_VERSION_1
|
| 104 |
+
* @{ */
|
| 105 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamA(cudaStream_t stream, const char* name);
|
| 106 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamW(cudaStream_t stream, const wchar_t* name);
|
| 107 |
+
/** @} */
|
| 108 |
+
|
| 109 |
+
/* ------------------------------------------------------------------------- */
|
| 110 |
+
/** \brief Annotates a CUDA event.
|
| 111 |
+
*
|
| 112 |
+
* Allows the user to associate a CUDA event with a user-provided name.
|
| 113 |
+
*
|
| 114 |
+
* \param event - The handle of the CUDA event to name.
|
| 115 |
+
* \param name - The name of the CUDA event.
|
| 116 |
+
*
|
| 117 |
+
* \version \NVTX_VERSION_1
|
| 118 |
+
* @{ */
|
| 119 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventA(cudaEvent_t event, const char* name);
|
| 120 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventW(cudaEvent_t event, const wchar_t* name);
|
| 121 |
+
/** @} */
|
| 122 |
+
|
| 123 |
+
/** @} */ /* END RESOURCE_NAMING */
|
| 124 |
+
|
| 125 |
+
/* ========================================================================= */
|
| 126 |
+
#ifdef UNICODE
|
| 127 |
+
#define nvtxNameCudaDevice nvtxNameCudaDeviceW
|
| 128 |
+
#define nvtxNameCudaStream nvtxNameCudaStreamW
|
| 129 |
+
#define nvtxNameCudaEvent nvtxNameCudaEventW
|
| 130 |
+
#else
|
| 131 |
+
#define nvtxNameCudaDevice nvtxNameCudaDeviceA
|
| 132 |
+
#define nvtxNameCudaStream nvtxNameCudaStreamA
|
| 133 |
+
#define nvtxNameCudaEvent nvtxNameCudaEventA
|
| 134 |
+
#endif
|
| 135 |
+
|
| 136 |
+
#ifdef __cplusplus
|
| 137 |
+
}
|
| 138 |
+
#endif /* __cplusplus */
|
| 139 |
+
|
| 140 |
+
#ifndef NVTX_NO_IMPL
|
| 141 |
+
#define NVTX_IMPL_GUARD_CUDART /* Ensure other headers cannot included directly */
|
| 142 |
+
#include "nvtxDetail/nvtxImplCudaRt_v3.h"
|
| 143 |
+
#undef NVTX_IMPL_GUARD_CUDART
|
| 144 |
+
#endif /*NVTX_NO_IMPL*/
|
| 145 |
+
|
| 146 |
+
#endif /* NVTOOLSEXT_CUDART_V3 */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvToolsExtOpenCL.h
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2009-2016 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO USER:
|
| 5 |
+
*
|
| 6 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 11 |
+
* of a form of NVIDIA software license agreement.
|
| 12 |
+
*
|
| 13 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 14 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 15 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 16 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 17 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 18 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 19 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 20 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 21 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 22 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 23 |
+
*
|
| 24 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 25 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 26 |
+
* "commercial computer software" and "commercial computer software
|
| 27 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 28 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 29 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 30 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 31 |
+
* source code with only those rights set forth herein.
|
| 32 |
+
*
|
| 33 |
+
* Any use of this source code in individual and commercial software must
|
| 34 |
+
* include, in the user documentation and internal comments to the code,
|
| 35 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
#include "nvToolsExt.h"
|
| 39 |
+
|
| 40 |
+
#include <CL/cl.h>
|
| 41 |
+
|
| 42 |
+
#ifndef NVTOOLSEXT_OPENCL_V3
|
| 43 |
+
#define NVTOOLSEXT_OPENCL_V3
|
| 44 |
+
|
| 45 |
+
#ifdef __cplusplus
|
| 46 |
+
extern "C" {
|
| 47 |
+
#endif /* __cplusplus */
|
| 48 |
+
|
| 49 |
+
/* ========================================================================= */
|
| 50 |
+
/** \name Functions for OpenCL Resource Naming
|
| 51 |
+
*/
|
| 52 |
+
/** \addtogroup RESOURCE_NAMING
|
| 53 |
+
* \section RESOURCE_NAMING_OPENCL OpenCL Resource Naming
|
| 54 |
+
*
|
| 55 |
+
* This section covers the API functions that allow to annotate OpenCL resources
|
| 56 |
+
* with user-provided names.
|
| 57 |
+
*
|
| 58 |
+
* @{
|
| 59 |
+
*/
|
| 60 |
+
|
| 61 |
+
/* ------------------------------------------------------------------------- */
|
| 62 |
+
/* \cond SHOW_HIDDEN
|
| 63 |
+
* \brief Used to build a non-colliding value for resource types separated class
|
| 64 |
+
* \version \NVTX_VERSION_2
|
| 65 |
+
*/
|
| 66 |
+
#define NVTX_RESOURCE_CLASS_OPENCL 6
|
| 67 |
+
/** \endcond */
|
| 68 |
+
|
| 69 |
+
/* ------------------------------------------------------------------------- */
|
| 70 |
+
/** \brief Resource types for OpenCL
|
| 71 |
+
*/
|
| 72 |
+
typedef enum nvtxResourceOpenCLType_t
|
| 73 |
+
{
|
| 74 |
+
NVTX_RESOURCE_TYPE_OPENCL_DEVICE = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 1),
|
| 75 |
+
NVTX_RESOURCE_TYPE_OPENCL_CONTEXT = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 2),
|
| 76 |
+
NVTX_RESOURCE_TYPE_OPENCL_COMMANDQUEUE = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 3),
|
| 77 |
+
NVTX_RESOURCE_TYPE_OPENCL_MEMOBJECT = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 4),
|
| 78 |
+
NVTX_RESOURCE_TYPE_OPENCL_SAMPLER = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 5),
|
| 79 |
+
NVTX_RESOURCE_TYPE_OPENCL_PROGRAM = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 6),
|
| 80 |
+
NVTX_RESOURCE_TYPE_OPENCL_EVENT = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 7),
|
| 81 |
+
} nvtxResourceOpenCLType_t;
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
/* ------------------------------------------------------------------------- */
|
| 85 |
+
/** \brief Annotates an OpenCL device.
|
| 86 |
+
*
|
| 87 |
+
* Allows to associate an OpenCL device with a user-provided name.
|
| 88 |
+
*
|
| 89 |
+
* \param device - The handle of the OpenCL device to name.
|
| 90 |
+
* \param name - The name of the OpenCL device.
|
| 91 |
+
*
|
| 92 |
+
* \version \NVTX_VERSION_1
|
| 93 |
+
* @{ */
|
| 94 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClDeviceA(cl_device_id device, const char* name);
|
| 95 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClDeviceW(cl_device_id device, const wchar_t* name);
|
| 96 |
+
/** @} */
|
| 97 |
+
|
| 98 |
+
/* ------------------------------------------------------------------------- */
|
| 99 |
+
/** \brief Annotates an OpenCL context.
|
| 100 |
+
*
|
| 101 |
+
* Allows to associate an OpenCL context with a user-provided name.
|
| 102 |
+
*
|
| 103 |
+
* \param context - The handle of the OpenCL context to name.
|
| 104 |
+
* \param name - The name of the OpenCL context.
|
| 105 |
+
*
|
| 106 |
+
* \version \NVTX_VERSION_1
|
| 107 |
+
* @{ */
|
| 108 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClContextA(cl_context context, const char* name);
|
| 109 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClContextW(cl_context context, const wchar_t* name);
|
| 110 |
+
/** @} */
|
| 111 |
+
|
| 112 |
+
/* ------------------------------------------------------------------------- */
|
| 113 |
+
/** \brief Annotates an OpenCL command queue.
|
| 114 |
+
*
|
| 115 |
+
* Allows to associate an OpenCL command queue with a user-provided name.
|
| 116 |
+
*
|
| 117 |
+
* \param command_queue - The handle of the OpenCL command queue to name.
|
| 118 |
+
* \param name - The name of the OpenCL command queue.
|
| 119 |
+
*
|
| 120 |
+
* \version \NVTX_VERSION_1
|
| 121 |
+
* @{ */
|
| 122 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClCommandQueueA(cl_command_queue command_queue, const char* name);
|
| 123 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClCommandQueueW(cl_command_queue command_queue, const wchar_t* name);
|
| 124 |
+
/** @} */
|
| 125 |
+
|
| 126 |
+
/* ------------------------------------------------------------------------- */
|
| 127 |
+
/** \brief Annotates an OpenCL memory object.
|
| 128 |
+
*
|
| 129 |
+
* Allows to associate an OpenCL memory object with a user-provided name.
|
| 130 |
+
*
|
| 131 |
+
* \param memobj - The handle of the OpenCL memory object to name.
|
| 132 |
+
* \param name - The name of the OpenCL memory object.
|
| 133 |
+
*
|
| 134 |
+
* \version \NVTX_VERSION_1
|
| 135 |
+
* @{ */
|
| 136 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClMemObjectA(cl_mem memobj, const char* name);
|
| 137 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClMemObjectW(cl_mem memobj, const wchar_t* name);
|
| 138 |
+
/** @} */
|
| 139 |
+
|
| 140 |
+
/* ------------------------------------------------------------------------- */
|
| 141 |
+
/** \brief Annotates an OpenCL sampler.
|
| 142 |
+
*
|
| 143 |
+
* Allows to associate an OpenCL sampler with a user-provided name.
|
| 144 |
+
*
|
| 145 |
+
* \param sampler - The handle of the OpenCL sampler to name.
|
| 146 |
+
* \param name - The name of the OpenCL sampler.
|
| 147 |
+
*
|
| 148 |
+
* \version \NVTX_VERSION_1
|
| 149 |
+
* @{ */
|
| 150 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClSamplerA(cl_sampler sampler, const char* name);
|
| 151 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClSamplerW(cl_sampler sampler, const wchar_t* name);
|
| 152 |
+
/** @} */
|
| 153 |
+
|
| 154 |
+
/* ------------------------------------------------------------------------- */
|
| 155 |
+
/** \brief Annotates an OpenCL program.
|
| 156 |
+
*
|
| 157 |
+
* Allows to associate an OpenCL program with a user-provided name.
|
| 158 |
+
*
|
| 159 |
+
* \param program - The handle of the OpenCL program to name.
|
| 160 |
+
* \param name - The name of the OpenCL program.
|
| 161 |
+
*
|
| 162 |
+
* \code
|
| 163 |
+
* cpProgram = clCreateProgramWithSource(cxGPUContext, 1,
|
| 164 |
+
* (const char **) &cSourceCL, &program_length, &ciErrNum);
|
| 165 |
+
* shrCheckErrorEX(ciErrNum, CL_SUCCESS, pCleanup);
|
| 166 |
+
* nvtxNameClProgram(cpProgram, L"PROGRAM_NAME");
|
| 167 |
+
* \endcode
|
| 168 |
+
*
|
| 169 |
+
* \version \NVTX_VERSION_1
|
| 170 |
+
* @{ */
|
| 171 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClProgramA(cl_program program, const char* name);
|
| 172 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClProgramW(cl_program program, const wchar_t* name);
|
| 173 |
+
/** @} */
|
| 174 |
+
|
| 175 |
+
/* ------------------------------------------------------------------------- */
|
| 176 |
+
/** \brief Annotates an OpenCL event.
|
| 177 |
+
*
|
| 178 |
+
* Allows to associate an OpenCL event with a user-provided name.
|
| 179 |
+
*
|
| 180 |
+
* \param evnt - The handle of the OpenCL event to name.
|
| 181 |
+
* \param name - The name of the OpenCL event.
|
| 182 |
+
*
|
| 183 |
+
* \version \NVTX_VERSION_1
|
| 184 |
+
* @{ */
|
| 185 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClEventA(cl_event evnt, const char* name);
|
| 186 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClEventW(cl_event evnt, const wchar_t* name);
|
| 187 |
+
/** @} */
|
| 188 |
+
|
| 189 |
+
/** @} */ /* END RESOURCE_NAMING */
|
| 190 |
+
|
| 191 |
+
/* ========================================================================= */
|
| 192 |
+
#ifdef UNICODE
|
| 193 |
+
#define nvtxNameClDevice nvtxNameClDeviceW
|
| 194 |
+
#define nvtxNameClContext nvtxNameClContextW
|
| 195 |
+
#define nvtxNameClCommandQueue nvtxNameClCommandQueueW
|
| 196 |
+
#define nvtxNameClMemObject nvtxNameClMemObjectW
|
| 197 |
+
#define nvtxNameClSampler nvtxNameClSamplerW
|
| 198 |
+
#define nvtxNameClProgram nvtxNameClProgramW
|
| 199 |
+
#define nvtxNameClEvent nvtxNameClEventW
|
| 200 |
+
#else
|
| 201 |
+
#define nvtxNameClDevice nvtxNameClDeviceA
|
| 202 |
+
#define nvtxNameClContext nvtxNameClContextA
|
| 203 |
+
#define nvtxNameClCommandQueue nvtxNameClCommandQueueA
|
| 204 |
+
#define nvtxNameClMemObject nvtxNameClMemObjectA
|
| 205 |
+
#define nvtxNameClSampler nvtxNameClSamplerA
|
| 206 |
+
#define nvtxNameClProgram nvtxNameClProgramA
|
| 207 |
+
#define nvtxNameClEvent nvtxNameClEventA
|
| 208 |
+
#endif
|
| 209 |
+
|
| 210 |
+
#ifdef __cplusplus
|
| 211 |
+
}
|
| 212 |
+
#endif /* __cplusplus */
|
| 213 |
+
|
| 214 |
+
#ifndef NVTX_NO_IMPL
|
| 215 |
+
#define NVTX_IMPL_GUARD_OPENCL /* Ensure other headers cannot included directly */
|
| 216 |
+
#include "nvtxDetail/nvtxImplOpenCL_v3.h"
|
| 217 |
+
#undef NVTX_IMPL_GUARD_OPENCL
|
| 218 |
+
#endif /*NVTX_NO_IMPL*/
|
| 219 |
+
|
| 220 |
+
#endif /* NVTOOLSEXT_OPENCL_V3 */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvToolsExtSync.h
ADDED
|
@@ -0,0 +1,411 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2009-2016 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO USER:
|
| 5 |
+
*
|
| 6 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 11 |
+
* of a form of NVIDIA software license agreement.
|
| 12 |
+
*
|
| 13 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 14 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 15 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 16 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 17 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 18 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 19 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 20 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 21 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 22 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 23 |
+
*
|
| 24 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 25 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 26 |
+
* "commercial computer software" and "commercial computer software
|
| 27 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 28 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 29 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 30 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 31 |
+
* source code with only those rights set forth herein.
|
| 32 |
+
*
|
| 33 |
+
* Any use of this source code in individual and commercial software must
|
| 34 |
+
* include, in the user documentation and internal comments to the code,
|
| 35 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
#include "nvToolsExt.h"
|
| 39 |
+
|
| 40 |
+
#ifndef NVTOOLSEXT_SYNC_V3
|
| 41 |
+
#define NVTOOLSEXT_SYNC_V3
|
| 42 |
+
|
| 43 |
+
#ifdef __cplusplus
|
| 44 |
+
extern "C" {
|
| 45 |
+
#endif /* __cplusplus */
|
| 46 |
+
|
| 47 |
+
/* \cond SHOW_HIDDEN
|
| 48 |
+
* \version \NVTX_VERSION_2
|
| 49 |
+
*/
|
| 50 |
+
#define NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE ( (uint16_t)( sizeof(nvtxSyncUserAttributes_v0) ) )
|
| 51 |
+
/** \endcond */
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* \page PAGE_SYNCHRONIZATION Synchronization
|
| 56 |
+
*
|
| 57 |
+
* This section covers a subset of the API that allow users to track additional
|
| 58 |
+
* synchronization details of their application. Naming OS synchronization primitives
|
| 59 |
+
* may allow users to better understand the data collected by traced synchronization
|
| 60 |
+
* APIs. Additionally, a user defined synchronization object can allow the users to
|
| 61 |
+
* to tell the tools when the user is building their own synchronization system
|
| 62 |
+
* that do not rely on the OS to provide behaviors and instead use techniques like
|
| 63 |
+
* atomic operations and spinlocks.
|
| 64 |
+
*
|
| 65 |
+
* See module \ref SYNCHRONIZATION for details.
|
| 66 |
+
*
|
| 67 |
+
* \par Example:
|
| 68 |
+
* \code
|
| 69 |
+
* class MyMutex
|
| 70 |
+
* {
|
| 71 |
+
* volatile long bLocked;
|
| 72 |
+
* nvtxSyncUser_t hSync;
|
| 73 |
+
* public:
|
| 74 |
+
* MyMutex(const char* name, nvtxDomainHandle_t d){
|
| 75 |
+
* bLocked = 0;
|
| 76 |
+
*
|
| 77 |
+
* nvtxSyncUserAttributes_t attribs = { 0 };
|
| 78 |
+
* attribs.version = NVTX_VERSION;
|
| 79 |
+
* attribs.size = NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE;
|
| 80 |
+
* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 81 |
+
* attribs.message.ascii = name;
|
| 82 |
+
* hSync = nvtxDomainSyncUserCreate(d, &attribs);
|
| 83 |
+
* }
|
| 84 |
+
*
|
| 85 |
+
* ~MyMutex() {
|
| 86 |
+
* nvtxDomainSyncUserDestroy(hSync);
|
| 87 |
+
* }
|
| 88 |
+
*
|
| 89 |
+
* bool Lock() {
|
| 90 |
+
* nvtxDomainSyncUserAcquireStart(hSync);
|
| 91 |
+
* bool acquired = __sync_bool_compare_and_swap(&bLocked, 0, 1);//atomic compiler intrinsic
|
| 92 |
+
|
| 93 |
+
* if (acquired) {
|
| 94 |
+
* nvtxDomainSyncUserAcquireSuccess(hSync);
|
| 95 |
+
* }
|
| 96 |
+
* else {
|
| 97 |
+
* nvtxDomainSyncUserAcquireFailed(hSync);
|
| 98 |
+
* }
|
| 99 |
+
* return acquired;
|
| 100 |
+
* }
|
| 101 |
+
|
| 102 |
+
* void Unlock() {
|
| 103 |
+
* nvtxDomainSyncUserReleasing(hSync);
|
| 104 |
+
* bLocked = false;
|
| 105 |
+
* }
|
| 106 |
+
* };
|
| 107 |
+
* \endcode
|
| 108 |
+
*
|
| 109 |
+
* \version \NVTX_VERSION_2
|
| 110 |
+
*/
|
| 111 |
+
|
| 112 |
+
/* ------------------------------------------------------------------------- */
|
| 113 |
+
/* \cond SHOW_HIDDEN
|
| 114 |
+
* \brief Used to build a non-colliding value for resource types separated class
|
| 115 |
+
* \version \NVTX_VERSION_2
|
| 116 |
+
*/
|
| 117 |
+
#define NVTX_RESOURCE_CLASS_SYNC_OS 2 /**< Synchronization objects that are OS specific. */
|
| 118 |
+
#define NVTX_RESOURCE_CLASS_SYNC_PTHREAD 3 /**< Synchronization objects that are from the POSIX Threads API (pthread)*/
|
| 119 |
+
/** \endcond */
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
/* ------------------------------------------------------------------------- */
|
| 123 |
+
/** \defgroup SYNCHRONIZATION Synchronization
|
| 124 |
+
* See page \ref PAGE_SYNCHRONIZATION.
|
| 125 |
+
* @{
|
| 126 |
+
*/
|
| 127 |
+
|
| 128 |
+
/** \brief Resource type values for OSs with POSIX Thread API support
|
| 129 |
+
*/
|
| 130 |
+
typedef enum nvtxResourceSyncPosixThreadType_t
|
| 131 |
+
{
|
| 132 |
+
NVTX_RESOURCE_TYPE_SYNC_PTHREAD_MUTEX = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 1), /* pthread_mutex_t */
|
| 133 |
+
NVTX_RESOURCE_TYPE_SYNC_PTHREAD_CONDITION = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 2), /* pthread_cond_t */
|
| 134 |
+
NVTX_RESOURCE_TYPE_SYNC_PTHREAD_RWLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 3), /* pthread_rwlock_t */
|
| 135 |
+
NVTX_RESOURCE_TYPE_SYNC_PTHREAD_BARRIER = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 4), /* pthread_barrier_t */
|
| 136 |
+
NVTX_RESOURCE_TYPE_SYNC_PTHREAD_SPINLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 5), /* pthread_spinlock_t */
|
| 137 |
+
NVTX_RESOURCE_TYPE_SYNC_PTHREAD_ONCE = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 6) /* pthread_once_t */
|
| 138 |
+
} nvtxResourceSyncPosixThreadType_t;
|
| 139 |
+
|
| 140 |
+
/** \brief Resource type values for Windows OSs
|
| 141 |
+
*/
|
| 142 |
+
typedef enum nvtxResourceSyncWindowsType_t
|
| 143 |
+
{
|
| 144 |
+
NVTX_RESOURCE_TYPE_SYNC_WINDOWS_MUTEX = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 1),
|
| 145 |
+
NVTX_RESOURCE_TYPE_SYNC_WINDOWS_SEMAPHORE = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 2),
|
| 146 |
+
NVTX_RESOURCE_TYPE_SYNC_WINDOWS_EVENT = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 3),
|
| 147 |
+
NVTX_RESOURCE_TYPE_SYNC_WINDOWS_CRITICAL_SECTION = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 4),
|
| 148 |
+
NVTX_RESOURCE_TYPE_SYNC_WINDOWS_SRWLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 5)
|
| 149 |
+
} nvtxResourceSyncWindowsType_t;
|
| 150 |
+
|
| 151 |
+
/** \brief Resource type values for Linux and Linux derived OSs such as Android
|
| 152 |
+
* \sa
|
| 153 |
+
* ::nvtxResourceSyncPosixThreadType_t
|
| 154 |
+
*/
|
| 155 |
+
typedef enum nvtxResourceSyncLinuxType_t
|
| 156 |
+
{
|
| 157 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_MUTEX = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 1),
|
| 158 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_FUTEX = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 2),
|
| 159 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_SEMAPHORE = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 3),
|
| 160 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_COMPLETION = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 4),
|
| 161 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_SPINLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 5),
|
| 162 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_SEQLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 6),
|
| 163 |
+
NVTX_RESOURCE_TYPE_SYNC_LINUX_RCU = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 7)
|
| 164 |
+
} nvtxResourceSyncLinuxType_t;
|
| 165 |
+
|
| 166 |
+
/** \brief Resource type values for Android come from Linux.
|
| 167 |
+
* \sa
|
| 168 |
+
* ::nvtxResourceSyncLinuxType_t
|
| 169 |
+
* ::nvtxResourceSyncPosixThreadType_t
|
| 170 |
+
*/
|
| 171 |
+
typedef enum nvtxResourceSyncLinuxType_t nvtxResourceSyncAndroidType_t;
|
| 172 |
+
|
| 173 |
+
/** \brief User Defined Synchronization Object Handle .
|
| 174 |
+
* \anchor SYNCUSER_HANDLE_STRUCTURE
|
| 175 |
+
*
|
| 176 |
+
* This structure is opaque to the user and is used as a handle to reference
|
| 177 |
+
* a user defined syncrhonization object. The tools will return a pointer through the API for the application
|
| 178 |
+
* to hold on it's behalf to reference the string in the future.
|
| 179 |
+
*
|
| 180 |
+
*/
|
| 181 |
+
typedef struct nvtxSyncUser* nvtxSyncUser_t;
|
| 182 |
+
|
| 183 |
+
/** \brief User Defined Synchronization Object Attributes Structure.
|
| 184 |
+
* \anchor USERDEF_SYNC_ATTRIBUTES_STRUCTURE
|
| 185 |
+
*
|
| 186 |
+
* This structure is used to describe the attributes of a user defined synchronization
|
| 187 |
+
* object. The layout of the structure is defined by a specific version of the tools
|
| 188 |
+
* extension library and can change between different versions of the Tools Extension
|
| 189 |
+
* library.
|
| 190 |
+
*
|
| 191 |
+
* \par Initializing the Attributes
|
| 192 |
+
*
|
| 193 |
+
* The caller should always perform the following three tasks when using
|
| 194 |
+
* attributes:
|
| 195 |
+
* <ul>
|
| 196 |
+
* <li>Zero the structure
|
| 197 |
+
* <li>Set the version field
|
| 198 |
+
* <li>Set the size field
|
| 199 |
+
* </ul>
|
| 200 |
+
*
|
| 201 |
+
* Zeroing the structure sets all the event attributes types and values
|
| 202 |
+
* to the default value.
|
| 203 |
+
*
|
| 204 |
+
* The version and size field are used by the Tools Extension
|
| 205 |
+
* implementation to handle multiple versions of the attributes structure.
|
| 206 |
+
*
|
| 207 |
+
* It is recommended that the caller use one of the following to methods
|
| 208 |
+
* to initialize the event attributes structure:
|
| 209 |
+
*
|
| 210 |
+
* \par Method 1: Initializing nvtxEventAttributes for future compatibility
|
| 211 |
+
* \code
|
| 212 |
+
* nvtxSyncUserAttributes_t attribs = {0};
|
| 213 |
+
* attribs.version = NVTX_VERSION;
|
| 214 |
+
* attribs.size = NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE;
|
| 215 |
+
* \endcode
|
| 216 |
+
*
|
| 217 |
+
* \par Method 2: Initializing nvtxSyncUserAttributes_t for a specific version
|
| 218 |
+
* \code
|
| 219 |
+
* nvtxSyncUserAttributes_t attribs = {0};
|
| 220 |
+
* attribs.version = 1;
|
| 221 |
+
* attribs.size = (uint16_t)(sizeof(nvtxSyncUserAttributes_t));
|
| 222 |
+
* \endcode
|
| 223 |
+
*
|
| 224 |
+
* If the caller uses Method 1 it is critical that the entire binary
|
| 225 |
+
* layout of the structure be configured to 0 so that all fields
|
| 226 |
+
* are initialized to the default value.
|
| 227 |
+
*
|
| 228 |
+
* The caller should either use both NVTX_VERSION and
|
| 229 |
+
* NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE (Method 1) or use explicit values
|
| 230 |
+
* and a versioned type (Method 2). Using a mix of the two methods
|
| 231 |
+
* will likely cause either source level incompatibility or binary
|
| 232 |
+
* incompatibility in the future.
|
| 233 |
+
*
|
| 234 |
+
* \par Settings Attribute Types and Values
|
| 235 |
+
*
|
| 236 |
+
*
|
| 237 |
+
* \par Example:
|
| 238 |
+
* \code
|
| 239 |
+
* // Initialize
|
| 240 |
+
* nvtxSyncUserAttributes_t attribs = {0};
|
| 241 |
+
* attribs.version = NVTX_VERSION;
|
| 242 |
+
* attribs.size = NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE;
|
| 243 |
+
*
|
| 244 |
+
* // Configure the Attributes
|
| 245 |
+
* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII;
|
| 246 |
+
* attribs.message.ascii = "Example";
|
| 247 |
+
* \endcode
|
| 248 |
+
*
|
| 249 |
+
* \sa
|
| 250 |
+
* ::nvtxDomainSyncUserCreate
|
| 251 |
+
*/
|
| 252 |
+
typedef struct nvtxSyncUserAttributes_v0
|
| 253 |
+
{
|
| 254 |
+
/**
|
| 255 |
+
* \brief Version flag of the structure.
|
| 256 |
+
*
|
| 257 |
+
* Needs to be set to NVTX_VERSION to indicate the version of NVTX APIs
|
| 258 |
+
* supported in this header file. This can optionally be overridden to
|
| 259 |
+
* another version of the tools extension library.
|
| 260 |
+
*/
|
| 261 |
+
uint16_t version;
|
| 262 |
+
|
| 263 |
+
/**
|
| 264 |
+
* \brief Size of the structure.
|
| 265 |
+
*
|
| 266 |
+
* Needs to be set to the size in bytes of the event attribute
|
| 267 |
+
* structure used to specify the event.
|
| 268 |
+
*/
|
| 269 |
+
uint16_t size;
|
| 270 |
+
|
| 271 |
+
/** \brief Message type specified in this attribute structure.
|
| 272 |
+
*
|
| 273 |
+
* Defines the message format of the attribute structure's \ref nvtxSyncUserAttributes_v0::message
|
| 274 |
+
* "message" field.
|
| 275 |
+
*
|
| 276 |
+
* Default Value is NVTX_MESSAGE_UNKNOWN
|
| 277 |
+
*/
|
| 278 |
+
int32_t messageType; /* nvtxMessageType_t */
|
| 279 |
+
|
| 280 |
+
/** \brief Message assigned to this attribute structure.
|
| 281 |
+
*
|
| 282 |
+
* The text message that is attached to an event.
|
| 283 |
+
*/
|
| 284 |
+
nvtxMessageValue_t message;
|
| 285 |
+
|
| 286 |
+
} nvtxSyncUserAttributes_v0;
|
| 287 |
+
|
| 288 |
+
typedef struct nvtxSyncUserAttributes_v0 nvtxSyncUserAttributes_t;
|
| 289 |
+
|
| 290 |
+
/* ------------------------------------------------------------------------- */
|
| 291 |
+
/** \brief Create a user defined synchronization object
|
| 292 |
+
* This is used to track non-OS synchronization working with spinlocks and atomics
|
| 293 |
+
*
|
| 294 |
+
* \param domain - Domain to own the resource
|
| 295 |
+
* \param attribs - A structure to assign multiple attributes to the object.
|
| 296 |
+
*
|
| 297 |
+
* \return A handle that represents the newly created user defined synchronization object.
|
| 298 |
+
*
|
| 299 |
+
* \sa
|
| 300 |
+
* ::nvtxDomainSyncUserCreate
|
| 301 |
+
* ::nvtxDomainSyncUserDestroy
|
| 302 |
+
* ::nvtxDomainSyncUserAcquireStart
|
| 303 |
+
* ::nvtxDomainSyncUserAcquireFailed
|
| 304 |
+
* ::nvtxDomainSyncUserAcquireSuccess
|
| 305 |
+
* ::nvtxDomainSyncUserReleasing
|
| 306 |
+
*
|
| 307 |
+
* \version \NVTX_VERSION_2
|
| 308 |
+
*/
|
| 309 |
+
NVTX_DECLSPEC nvtxSyncUser_t NVTX_API nvtxDomainSyncUserCreate(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t* attribs);
|
| 310 |
+
|
| 311 |
+
/* ------------------------------------------------------------------------- */
|
| 312 |
+
/** \brief Destroy a user defined synchronization object
|
| 313 |
+
* This is used to track non-OS synchronization working with spinlocks and atomics
|
| 314 |
+
*
|
| 315 |
+
* \param handle - A handle to the object to operate on.
|
| 316 |
+
*
|
| 317 |
+
* \sa
|
| 318 |
+
* ::nvtxDomainSyncUserCreate
|
| 319 |
+
* ::nvtxDomainSyncUserDestroy
|
| 320 |
+
* ::nvtxDomainSyncUserAcquireStart
|
| 321 |
+
* ::nvtxDomainSyncUserAcquireFailed
|
| 322 |
+
* ::nvtxDomainSyncUserAcquireSuccess
|
| 323 |
+
* ::nvtxDomainSyncUserReleasing
|
| 324 |
+
*
|
| 325 |
+
* \version \NVTX_VERSION_2
|
| 326 |
+
*/
|
| 327 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserDestroy(nvtxSyncUser_t handle);
|
| 328 |
+
|
| 329 |
+
/* ------------------------------------------------------------------------- */
|
| 330 |
+
/** \brief Signal to tools that an attempt to acquire a user defined synchronization object
|
| 331 |
+
*
|
| 332 |
+
* \param handle - A handle to the object to operate on.
|
| 333 |
+
*
|
| 334 |
+
* \sa
|
| 335 |
+
* ::nvtxDomainSyncUserCreate
|
| 336 |
+
* ::nvtxDomainSyncUserDestroy
|
| 337 |
+
* ::nvtxDomainSyncUserAcquireStart
|
| 338 |
+
* ::nvtxDomainSyncUserAcquireFailed
|
| 339 |
+
* ::nvtxDomainSyncUserAcquireSuccess
|
| 340 |
+
* ::nvtxDomainSyncUserReleasing
|
| 341 |
+
*
|
| 342 |
+
* \version \NVTX_VERSION_2
|
| 343 |
+
*/
|
| 344 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireStart(nvtxSyncUser_t handle);
|
| 345 |
+
|
| 346 |
+
/* ------------------------------------------------------------------------- */
|
| 347 |
+
/** \brief Signal to tools of failure in acquiring a user defined synchronization object
|
| 348 |
+
* This should be called after \ref nvtxDomainSyncUserAcquireStart
|
| 349 |
+
*
|
| 350 |
+
* \param handle - A handle to the object to operate on.
|
| 351 |
+
*
|
| 352 |
+
* \sa
|
| 353 |
+
* ::nvtxDomainSyncUserCreate
|
| 354 |
+
* ::nvtxDomainSyncUserDestroy
|
| 355 |
+
* ::nvtxDomainSyncUserAcquireStart
|
| 356 |
+
* ::nvtxDomainSyncUserAcquireFailed
|
| 357 |
+
* ::nvtxDomainSyncUserAcquireSuccess
|
| 358 |
+
* ::nvtxDomainSyncUserReleasing
|
| 359 |
+
*
|
| 360 |
+
* \version \NVTX_VERSION_2
|
| 361 |
+
*/NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireFailed(nvtxSyncUser_t handle);
|
| 362 |
+
|
| 363 |
+
/* ------------------------------------------------------------------------- */
|
| 364 |
+
/** \brief Signal to tools of success in acquiring a user defined synchronization object
|
| 365 |
+
* This should be called after \ref nvtxDomainSyncUserAcquireStart.
|
| 366 |
+
*
|
| 367 |
+
* \param handle - A handle to the object to operate on.
|
| 368 |
+
*
|
| 369 |
+
* \sa
|
| 370 |
+
* ::nvtxDomainSyncUserCreate
|
| 371 |
+
* ::nvtxDomainSyncUserDestroy
|
| 372 |
+
* ::nvtxDomainSyncUserAcquireStart
|
| 373 |
+
* ::nvtxDomainSyncUserAcquireFailed
|
| 374 |
+
* ::nvtxDomainSyncUserAcquireSuccess
|
| 375 |
+
* ::nvtxDomainSyncUserReleasing
|
| 376 |
+
*
|
| 377 |
+
* \version \NVTX_VERSION_2
|
| 378 |
+
*/NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireSuccess(nvtxSyncUser_t handle);
|
| 379 |
+
|
| 380 |
+
/* ------------------------------------------------------------------------- */
|
| 381 |
+
/** \brief Signal to tools of releasing a reservation on user defined synchronization object
|
| 382 |
+
* This should be called after \ref nvtxDomainSyncUserAcquireSuccess.
|
| 383 |
+
*
|
| 384 |
+
* \param handle - A handle to the object to operate on.
|
| 385 |
+
*
|
| 386 |
+
* \sa
|
| 387 |
+
* ::nvtxDomainSyncUserCreate
|
| 388 |
+
* ::nvtxDomainSyncUserDestroy
|
| 389 |
+
* ::nvtxDomainSyncUserAcquireStart
|
| 390 |
+
* ::nvtxDomainSyncUserAcquireFailed
|
| 391 |
+
* ::nvtxDomainSyncUserAcquireSuccess
|
| 392 |
+
* ::nvtxDomainSyncUserReleasing
|
| 393 |
+
*
|
| 394 |
+
* \version \NVTX_VERSION_2
|
| 395 |
+
*/
|
| 396 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserReleasing(nvtxSyncUser_t handle);
|
| 397 |
+
|
| 398 |
+
|
| 399 |
+
/** @} */ /*END defgroup*/
|
| 400 |
+
|
| 401 |
+
#ifdef __cplusplus
|
| 402 |
+
}
|
| 403 |
+
#endif /* __cplusplus */
|
| 404 |
+
|
| 405 |
+
#ifndef NVTX_NO_IMPL
|
| 406 |
+
#define NVTX_IMPL_GUARD_SYNC /* Ensure other headers cannot included directly */
|
| 407 |
+
#include "nvtxDetail/nvtxImplSync_v3.h"
|
| 408 |
+
#undef NVTX_IMPL_GUARD_SYNC
|
| 409 |
+
#endif /*NVTX_NO_IMPL*/
|
| 410 |
+
|
| 411 |
+
#endif /* NVTOOLSEXT_SYNC_V3 */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxImpl.h
ADDED
|
@@ -0,0 +1,469 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* This file was procedurally generated! Do not modify this file by hand. */
|
| 2 |
+
|
| 3 |
+
/*
|
| 4 |
+
* Copyright 2009-2016 NVIDIA Corporation. All rights reserved.
|
| 5 |
+
*
|
| 6 |
+
* NOTICE TO USER:
|
| 7 |
+
*
|
| 8 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 9 |
+
* international Copyright laws.
|
| 10 |
+
*
|
| 11 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 12 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 13 |
+
* of a form of NVIDIA software license agreement.
|
| 14 |
+
*
|
| 15 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 16 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 17 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 18 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 19 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 20 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 21 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 22 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 23 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 24 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 25 |
+
*
|
| 26 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 27 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 28 |
+
* "commercial computer software" and "commercial computer software
|
| 29 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 30 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 31 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 32 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 33 |
+
* source code with only those rights set forth herein.
|
| 34 |
+
*
|
| 35 |
+
* Any use of this source code in individual and commercial software must
|
| 36 |
+
* include, in the user documentation and internal comments to the code,
|
| 37 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 38 |
+
*/
|
| 39 |
+
|
| 40 |
+
#ifndef NVTX_IMPL_GUARD
|
| 41 |
+
#error Never include this file directly -- it is automatically included by nvToolsExt.h (except when NVTX_NO_IMPL is defined).
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
/* ---- Include required platform headers ---- */
|
| 45 |
+
|
| 46 |
+
#if defined(_WIN32)
|
| 47 |
+
|
| 48 |
+
#include <Windows.h>
|
| 49 |
+
|
| 50 |
+
#else
|
| 51 |
+
#include <unistd.h>
|
| 52 |
+
|
| 53 |
+
#if defined(__ANDROID__)
|
| 54 |
+
#include <android/api-level.h>
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
#if defined(__linux__) || defined(__CYGWIN__)
|
| 58 |
+
#include <sched.h>
|
| 59 |
+
#endif
|
| 60 |
+
|
| 61 |
+
#include <limits.h>
|
| 62 |
+
#include <dlfcn.h>
|
| 63 |
+
#include <fcntl.h>
|
| 64 |
+
#include <stdlib.h>
|
| 65 |
+
#include <stdio.h>
|
| 66 |
+
#include <sys/types.h>
|
| 67 |
+
#include <unistd.h>
|
| 68 |
+
#include <errno.h>
|
| 69 |
+
|
| 70 |
+
#include <string.h>
|
| 71 |
+
#include <sys/types.h>
|
| 72 |
+
#include <pthread.h>
|
| 73 |
+
#include <stdlib.h>
|
| 74 |
+
#include <wchar.h>
|
| 75 |
+
|
| 76 |
+
#endif
|
| 77 |
+
|
| 78 |
+
/* ---- Define macros used in this file ---- */
|
| 79 |
+
|
| 80 |
+
#define NVTX_INIT_STATE_FRESH 0
|
| 81 |
+
#define NVTX_INIT_STATE_STARTED 1
|
| 82 |
+
#define NVTX_INIT_STATE_COMPLETE 2
|
| 83 |
+
|
| 84 |
+
#ifdef NVTX_DEBUG_PRINT
|
| 85 |
+
#ifdef __ANDROID__
|
| 86 |
+
#include <android/log.h>
|
| 87 |
+
#define NVTX_ERR(...) __android_log_print(ANDROID_LOG_ERROR, "NVTOOLSEXT", __VA_ARGS__);
|
| 88 |
+
#define NVTX_INFO(...) __android_log_print(ANDROID_LOG_INFO, "NVTOOLSEXT", __VA_ARGS__);
|
| 89 |
+
#else
|
| 90 |
+
#include <stdio.h>
|
| 91 |
+
#define NVTX_ERR(...) fprintf(stderr, "NVTX_ERROR: " __VA_ARGS__)
|
| 92 |
+
#define NVTX_INFO(...) fprintf(stderr, "NVTX_INFO: " __VA_ARGS__)
|
| 93 |
+
#endif
|
| 94 |
+
#else /* !defined(NVTX_DEBUG_PRINT) */
|
| 95 |
+
#define NVTX_ERR(...)
|
| 96 |
+
#define NVTX_INFO(...)
|
| 97 |
+
#endif
|
| 98 |
+
|
| 99 |
+
#ifdef __cplusplus
|
| 100 |
+
extern "C" {
|
| 101 |
+
#endif /* __cplusplus */
|
| 102 |
+
|
| 103 |
+
#ifdef __GNUC__
|
| 104 |
+
#pragma GCC visibility push(hidden)
|
| 105 |
+
#endif
|
| 106 |
+
|
| 107 |
+
/* ---- Forward declare all functions referenced in globals ---- */
|
| 108 |
+
|
| 109 |
+
NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(void);
|
| 110 |
+
NVTX_LINKONCE_FWDDECL_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxEtiGetModuleFunctionTable)(
|
| 111 |
+
NvtxCallbackModule module,
|
| 112 |
+
NvtxFunctionTable* out_table,
|
| 113 |
+
unsigned int* out_size);
|
| 114 |
+
NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxEtiSetInjectionNvtxVersion)(
|
| 115 |
+
uint32_t version);
|
| 116 |
+
NVTX_LINKONCE_FWDDECL_FUNCTION const void* NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxGetExportTable)(
|
| 117 |
+
uint32_t exportTableId);
|
| 118 |
+
|
| 119 |
+
#include "nvtxInitDecls.h"
|
| 120 |
+
|
| 121 |
+
/* ---- Define all globals ---- */
|
| 122 |
+
|
| 123 |
+
typedef struct nvtxGlobals_t
|
| 124 |
+
{
|
| 125 |
+
volatile unsigned int initState;
|
| 126 |
+
NvtxExportTableCallbacks etblCallbacks;
|
| 127 |
+
NvtxExportTableVersionInfo etblVersionInfo;
|
| 128 |
+
|
| 129 |
+
/* Implementation function pointers */
|
| 130 |
+
nvtxMarkEx_impl_fntype nvtxMarkEx_impl_fnptr;
|
| 131 |
+
nvtxMarkA_impl_fntype nvtxMarkA_impl_fnptr;
|
| 132 |
+
nvtxMarkW_impl_fntype nvtxMarkW_impl_fnptr;
|
| 133 |
+
nvtxRangeStartEx_impl_fntype nvtxRangeStartEx_impl_fnptr;
|
| 134 |
+
nvtxRangeStartA_impl_fntype nvtxRangeStartA_impl_fnptr;
|
| 135 |
+
nvtxRangeStartW_impl_fntype nvtxRangeStartW_impl_fnptr;
|
| 136 |
+
nvtxRangeEnd_impl_fntype nvtxRangeEnd_impl_fnptr;
|
| 137 |
+
nvtxRangePushEx_impl_fntype nvtxRangePushEx_impl_fnptr;
|
| 138 |
+
nvtxRangePushA_impl_fntype nvtxRangePushA_impl_fnptr;
|
| 139 |
+
nvtxRangePushW_impl_fntype nvtxRangePushW_impl_fnptr;
|
| 140 |
+
nvtxRangePop_impl_fntype nvtxRangePop_impl_fnptr;
|
| 141 |
+
nvtxNameCategoryA_impl_fntype nvtxNameCategoryA_impl_fnptr;
|
| 142 |
+
nvtxNameCategoryW_impl_fntype nvtxNameCategoryW_impl_fnptr;
|
| 143 |
+
nvtxNameOsThreadA_impl_fntype nvtxNameOsThreadA_impl_fnptr;
|
| 144 |
+
nvtxNameOsThreadW_impl_fntype nvtxNameOsThreadW_impl_fnptr;
|
| 145 |
+
|
| 146 |
+
nvtxNameCuDeviceA_fakeimpl_fntype nvtxNameCuDeviceA_impl_fnptr;
|
| 147 |
+
nvtxNameCuDeviceW_fakeimpl_fntype nvtxNameCuDeviceW_impl_fnptr;
|
| 148 |
+
nvtxNameCuContextA_fakeimpl_fntype nvtxNameCuContextA_impl_fnptr;
|
| 149 |
+
nvtxNameCuContextW_fakeimpl_fntype nvtxNameCuContextW_impl_fnptr;
|
| 150 |
+
nvtxNameCuStreamA_fakeimpl_fntype nvtxNameCuStreamA_impl_fnptr;
|
| 151 |
+
nvtxNameCuStreamW_fakeimpl_fntype nvtxNameCuStreamW_impl_fnptr;
|
| 152 |
+
nvtxNameCuEventA_fakeimpl_fntype nvtxNameCuEventA_impl_fnptr;
|
| 153 |
+
nvtxNameCuEventW_fakeimpl_fntype nvtxNameCuEventW_impl_fnptr;
|
| 154 |
+
|
| 155 |
+
nvtxNameClDeviceA_fakeimpl_fntype nvtxNameClDeviceA_impl_fnptr;
|
| 156 |
+
nvtxNameClDeviceW_fakeimpl_fntype nvtxNameClDeviceW_impl_fnptr;
|
| 157 |
+
nvtxNameClContextA_fakeimpl_fntype nvtxNameClContextA_impl_fnptr;
|
| 158 |
+
nvtxNameClContextW_fakeimpl_fntype nvtxNameClContextW_impl_fnptr;
|
| 159 |
+
nvtxNameClCommandQueueA_fakeimpl_fntype nvtxNameClCommandQueueA_impl_fnptr;
|
| 160 |
+
nvtxNameClCommandQueueW_fakeimpl_fntype nvtxNameClCommandQueueW_impl_fnptr;
|
| 161 |
+
nvtxNameClMemObjectA_fakeimpl_fntype nvtxNameClMemObjectA_impl_fnptr;
|
| 162 |
+
nvtxNameClMemObjectW_fakeimpl_fntype nvtxNameClMemObjectW_impl_fnptr;
|
| 163 |
+
nvtxNameClSamplerA_fakeimpl_fntype nvtxNameClSamplerA_impl_fnptr;
|
| 164 |
+
nvtxNameClSamplerW_fakeimpl_fntype nvtxNameClSamplerW_impl_fnptr;
|
| 165 |
+
nvtxNameClProgramA_fakeimpl_fntype nvtxNameClProgramA_impl_fnptr;
|
| 166 |
+
nvtxNameClProgramW_fakeimpl_fntype nvtxNameClProgramW_impl_fnptr;
|
| 167 |
+
nvtxNameClEventA_fakeimpl_fntype nvtxNameClEventA_impl_fnptr;
|
| 168 |
+
nvtxNameClEventW_fakeimpl_fntype nvtxNameClEventW_impl_fnptr;
|
| 169 |
+
|
| 170 |
+
nvtxNameCudaDeviceA_impl_fntype nvtxNameCudaDeviceA_impl_fnptr;
|
| 171 |
+
nvtxNameCudaDeviceW_impl_fntype nvtxNameCudaDeviceW_impl_fnptr;
|
| 172 |
+
nvtxNameCudaStreamA_fakeimpl_fntype nvtxNameCudaStreamA_impl_fnptr;
|
| 173 |
+
nvtxNameCudaStreamW_fakeimpl_fntype nvtxNameCudaStreamW_impl_fnptr;
|
| 174 |
+
nvtxNameCudaEventA_fakeimpl_fntype nvtxNameCudaEventA_impl_fnptr;
|
| 175 |
+
nvtxNameCudaEventW_fakeimpl_fntype nvtxNameCudaEventW_impl_fnptr;
|
| 176 |
+
|
| 177 |
+
nvtxDomainMarkEx_impl_fntype nvtxDomainMarkEx_impl_fnptr;
|
| 178 |
+
nvtxDomainRangeStartEx_impl_fntype nvtxDomainRangeStartEx_impl_fnptr;
|
| 179 |
+
nvtxDomainRangeEnd_impl_fntype nvtxDomainRangeEnd_impl_fnptr;
|
| 180 |
+
nvtxDomainRangePushEx_impl_fntype nvtxDomainRangePushEx_impl_fnptr;
|
| 181 |
+
nvtxDomainRangePop_impl_fntype nvtxDomainRangePop_impl_fnptr;
|
| 182 |
+
nvtxDomainResourceCreate_impl_fntype nvtxDomainResourceCreate_impl_fnptr;
|
| 183 |
+
nvtxDomainResourceDestroy_impl_fntype nvtxDomainResourceDestroy_impl_fnptr;
|
| 184 |
+
nvtxDomainNameCategoryA_impl_fntype nvtxDomainNameCategoryA_impl_fnptr;
|
| 185 |
+
nvtxDomainNameCategoryW_impl_fntype nvtxDomainNameCategoryW_impl_fnptr;
|
| 186 |
+
nvtxDomainRegisterStringA_impl_fntype nvtxDomainRegisterStringA_impl_fnptr;
|
| 187 |
+
nvtxDomainRegisterStringW_impl_fntype nvtxDomainRegisterStringW_impl_fnptr;
|
| 188 |
+
nvtxDomainCreateA_impl_fntype nvtxDomainCreateA_impl_fnptr;
|
| 189 |
+
nvtxDomainCreateW_impl_fntype nvtxDomainCreateW_impl_fnptr;
|
| 190 |
+
nvtxDomainDestroy_impl_fntype nvtxDomainDestroy_impl_fnptr;
|
| 191 |
+
nvtxInitialize_impl_fntype nvtxInitialize_impl_fnptr;
|
| 192 |
+
|
| 193 |
+
nvtxDomainSyncUserCreate_impl_fntype nvtxDomainSyncUserCreate_impl_fnptr;
|
| 194 |
+
nvtxDomainSyncUserDestroy_impl_fntype nvtxDomainSyncUserDestroy_impl_fnptr;
|
| 195 |
+
nvtxDomainSyncUserAcquireStart_impl_fntype nvtxDomainSyncUserAcquireStart_impl_fnptr;
|
| 196 |
+
nvtxDomainSyncUserAcquireFailed_impl_fntype nvtxDomainSyncUserAcquireFailed_impl_fnptr;
|
| 197 |
+
nvtxDomainSyncUserAcquireSuccess_impl_fntype nvtxDomainSyncUserAcquireSuccess_impl_fnptr;
|
| 198 |
+
nvtxDomainSyncUserReleasing_impl_fntype nvtxDomainSyncUserReleasing_impl_fnptr;
|
| 199 |
+
|
| 200 |
+
/* Tables of function pointers -- Extra null added to the end to ensure
|
| 201 |
+
* a crash instead of silent corruption if a tool reads off the end. */
|
| 202 |
+
NvtxFunctionPointer* functionTable_CORE [NVTX_CBID_CORE_SIZE + 1];
|
| 203 |
+
NvtxFunctionPointer* functionTable_CUDA [NVTX_CBID_CUDA_SIZE + 1];
|
| 204 |
+
NvtxFunctionPointer* functionTable_OPENCL[NVTX_CBID_OPENCL_SIZE + 1];
|
| 205 |
+
NvtxFunctionPointer* functionTable_CUDART[NVTX_CBID_CUDART_SIZE + 1];
|
| 206 |
+
NvtxFunctionPointer* functionTable_CORE2 [NVTX_CBID_CORE2_SIZE + 1];
|
| 207 |
+
NvtxFunctionPointer* functionTable_SYNC [NVTX_CBID_SYNC_SIZE + 1];
|
| 208 |
+
} nvtxGlobals_t;
|
| 209 |
+
|
| 210 |
+
NVTX_LINKONCE_DEFINE_GLOBAL nvtxGlobals_t NVTX_VERSIONED_IDENTIFIER(nvtxGlobals) =
|
| 211 |
+
{
|
| 212 |
+
NVTX_INIT_STATE_FRESH,
|
| 213 |
+
|
| 214 |
+
{
|
| 215 |
+
sizeof(NvtxExportTableCallbacks),
|
| 216 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxEtiGetModuleFunctionTable)
|
| 217 |
+
},
|
| 218 |
+
{
|
| 219 |
+
sizeof(NvtxExportTableVersionInfo),
|
| 220 |
+
NVTX_VERSION,
|
| 221 |
+
0,
|
| 222 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxEtiSetInjectionNvtxVersion)
|
| 223 |
+
},
|
| 224 |
+
|
| 225 |
+
/* Implementation function pointers */
|
| 226 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxMarkEx_impl_init),
|
| 227 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxMarkA_impl_init),
|
| 228 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxMarkW_impl_init),
|
| 229 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartEx_impl_init),
|
| 230 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartA_impl_init),
|
| 231 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartW_impl_init),
|
| 232 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxRangeEnd_impl_init),
|
| 233 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxRangePushEx_impl_init),
|
| 234 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxRangePushA_impl_init),
|
| 235 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxRangePushW_impl_init),
|
| 236 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxRangePop_impl_init),
|
| 237 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryA_impl_init),
|
| 238 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryW_impl_init),
|
| 239 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadA_impl_init),
|
| 240 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadW_impl_init),
|
| 241 |
+
|
| 242 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceA_impl_init),
|
| 243 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceW_impl_init),
|
| 244 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextA_impl_init),
|
| 245 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextW_impl_init),
|
| 246 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamA_impl_init),
|
| 247 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamW_impl_init),
|
| 248 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventA_impl_init),
|
| 249 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventW_impl_init),
|
| 250 |
+
|
| 251 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceA_impl_init),
|
| 252 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceW_impl_init),
|
| 253 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextA_impl_init),
|
| 254 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextW_impl_init),
|
| 255 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueA_impl_init),
|
| 256 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueW_impl_init),
|
| 257 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectA_impl_init),
|
| 258 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectW_impl_init),
|
| 259 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerA_impl_init),
|
| 260 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerW_impl_init),
|
| 261 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramA_impl_init),
|
| 262 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramW_impl_init),
|
| 263 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventA_impl_init),
|
| 264 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventW_impl_init),
|
| 265 |
+
|
| 266 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceA_impl_init),
|
| 267 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceW_impl_init),
|
| 268 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamA_impl_init),
|
| 269 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamW_impl_init),
|
| 270 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventA_impl_init),
|
| 271 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventW_impl_init),
|
| 272 |
+
|
| 273 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainMarkEx_impl_init),
|
| 274 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeStartEx_impl_init),
|
| 275 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeEnd_impl_init),
|
| 276 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePushEx_impl_init),
|
| 277 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePop_impl_init),
|
| 278 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceCreate_impl_init),
|
| 279 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceDestroy_impl_init),
|
| 280 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryA_impl_init),
|
| 281 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryW_impl_init),
|
| 282 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringA_impl_init),
|
| 283 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringW_impl_init),
|
| 284 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateA_impl_init),
|
| 285 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateW_impl_init),
|
| 286 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainDestroy_impl_init),
|
| 287 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitialize_impl_init),
|
| 288 |
+
|
| 289 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserCreate_impl_init),
|
| 290 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserDestroy_impl_init),
|
| 291 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireStart_impl_init),
|
| 292 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireFailed_impl_init),
|
| 293 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireSuccess_impl_init),
|
| 294 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserReleasing_impl_init),
|
| 295 |
+
|
| 296 |
+
/* Tables of function pointers */
|
| 297 |
+
{
|
| 298 |
+
0,
|
| 299 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkEx_impl_fnptr,
|
| 300 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkA_impl_fnptr,
|
| 301 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkW_impl_fnptr,
|
| 302 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartEx_impl_fnptr,
|
| 303 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartA_impl_fnptr,
|
| 304 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartW_impl_fnptr,
|
| 305 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeEnd_impl_fnptr,
|
| 306 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushEx_impl_fnptr,
|
| 307 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushA_impl_fnptr,
|
| 308 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushW_impl_fnptr,
|
| 309 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePop_impl_fnptr,
|
| 310 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryA_impl_fnptr,
|
| 311 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryW_impl_fnptr,
|
| 312 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadA_impl_fnptr,
|
| 313 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadW_impl_fnptr,
|
| 314 |
+
0
|
| 315 |
+
},
|
| 316 |
+
{
|
| 317 |
+
0,
|
| 318 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceA_impl_fnptr,
|
| 319 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceW_impl_fnptr,
|
| 320 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextA_impl_fnptr,
|
| 321 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextW_impl_fnptr,
|
| 322 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamA_impl_fnptr,
|
| 323 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamW_impl_fnptr,
|
| 324 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventA_impl_fnptr,
|
| 325 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventW_impl_fnptr,
|
| 326 |
+
0
|
| 327 |
+
},
|
| 328 |
+
{
|
| 329 |
+
0,
|
| 330 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceA_impl_fnptr,
|
| 331 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceW_impl_fnptr,
|
| 332 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextA_impl_fnptr,
|
| 333 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextW_impl_fnptr,
|
| 334 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueA_impl_fnptr,
|
| 335 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueW_impl_fnptr,
|
| 336 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectA_impl_fnptr,
|
| 337 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectW_impl_fnptr,
|
| 338 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerA_impl_fnptr,
|
| 339 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerW_impl_fnptr,
|
| 340 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramA_impl_fnptr,
|
| 341 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramW_impl_fnptr,
|
| 342 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventA_impl_fnptr,
|
| 343 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventW_impl_fnptr,
|
| 344 |
+
0
|
| 345 |
+
},
|
| 346 |
+
{
|
| 347 |
+
0,
|
| 348 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceA_impl_fnptr,
|
| 349 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceW_impl_fnptr,
|
| 350 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamA_impl_fnptr,
|
| 351 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamW_impl_fnptr,
|
| 352 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventA_impl_fnptr,
|
| 353 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventW_impl_fnptr,
|
| 354 |
+
0
|
| 355 |
+
},
|
| 356 |
+
{
|
| 357 |
+
0,
|
| 358 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainMarkEx_impl_fnptr,
|
| 359 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeStartEx_impl_fnptr,
|
| 360 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeEnd_impl_fnptr,
|
| 361 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePushEx_impl_fnptr,
|
| 362 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePop_impl_fnptr,
|
| 363 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceCreate_impl_fnptr,
|
| 364 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceDestroy_impl_fnptr,
|
| 365 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryA_impl_fnptr,
|
| 366 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryW_impl_fnptr,
|
| 367 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringA_impl_fnptr,
|
| 368 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringW_impl_fnptr,
|
| 369 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateA_impl_fnptr,
|
| 370 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateW_impl_fnptr,
|
| 371 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainDestroy_impl_fnptr,
|
| 372 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxInitialize_impl_fnptr,
|
| 373 |
+
0
|
| 374 |
+
},
|
| 375 |
+
{
|
| 376 |
+
0,
|
| 377 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserCreate_impl_fnptr,
|
| 378 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserDestroy_impl_fnptr,
|
| 379 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireStart_impl_fnptr,
|
| 380 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireFailed_impl_fnptr,
|
| 381 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireSuccess_impl_fnptr,
|
| 382 |
+
(NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserReleasing_impl_fnptr,
|
| 383 |
+
0
|
| 384 |
+
}
|
| 385 |
+
};
|
| 386 |
+
|
| 387 |
+
/* ---- Define static inline implementations of core API functions ---- */
|
| 388 |
+
|
| 389 |
+
#include "nvtxImplCore.h"
|
| 390 |
+
|
| 391 |
+
/* ---- Define implementations of export table functions ---- */
|
| 392 |
+
|
| 393 |
+
NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxEtiGetModuleFunctionTable)(
|
| 394 |
+
NvtxCallbackModule module,
|
| 395 |
+
NvtxFunctionTable* out_table,
|
| 396 |
+
unsigned int* out_size)
|
| 397 |
+
{
|
| 398 |
+
unsigned int bytes = 0;
|
| 399 |
+
NvtxFunctionTable table = (NvtxFunctionTable)0;
|
| 400 |
+
|
| 401 |
+
switch (module)
|
| 402 |
+
{
|
| 403 |
+
case NVTX_CB_MODULE_CORE:
|
| 404 |
+
table = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CORE;
|
| 405 |
+
bytes = (unsigned int)sizeof(NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CORE);
|
| 406 |
+
break;
|
| 407 |
+
case NVTX_CB_MODULE_CUDA:
|
| 408 |
+
table = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CUDA;
|
| 409 |
+
bytes = (unsigned int)sizeof(NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CUDA);
|
| 410 |
+
break;
|
| 411 |
+
case NVTX_CB_MODULE_OPENCL:
|
| 412 |
+
table = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_OPENCL;
|
| 413 |
+
bytes = (unsigned int)sizeof(NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_OPENCL);
|
| 414 |
+
break;
|
| 415 |
+
case NVTX_CB_MODULE_CUDART:
|
| 416 |
+
table = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CUDART;
|
| 417 |
+
bytes = (unsigned int)sizeof(NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CUDART);
|
| 418 |
+
break;
|
| 419 |
+
case NVTX_CB_MODULE_CORE2:
|
| 420 |
+
table = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CORE2;
|
| 421 |
+
bytes = (unsigned int)sizeof(NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CORE2);
|
| 422 |
+
break;
|
| 423 |
+
case NVTX_CB_MODULE_SYNC:
|
| 424 |
+
table = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_SYNC;
|
| 425 |
+
bytes = (unsigned int)sizeof(NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_SYNC);
|
| 426 |
+
break;
|
| 427 |
+
default: return 0;
|
| 428 |
+
}
|
| 429 |
+
|
| 430 |
+
if (out_size)
|
| 431 |
+
*out_size = (bytes / (unsigned int)sizeof(NvtxFunctionPointer*)) - 1;
|
| 432 |
+
|
| 433 |
+
if (out_table)
|
| 434 |
+
*out_table = table;
|
| 435 |
+
|
| 436 |
+
return 1;
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
NVTX_LINKONCE_DEFINE_FUNCTION const void* NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxGetExportTable)(uint32_t exportTableId)
|
| 440 |
+
{
|
| 441 |
+
switch (exportTableId)
|
| 442 |
+
{
|
| 443 |
+
case NVTX_ETID_CALLBACKS: return &NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).etblCallbacks;
|
| 444 |
+
case NVTX_ETID_VERSIONINFO: return &NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).etblVersionInfo;
|
| 445 |
+
default: return 0;
|
| 446 |
+
}
|
| 447 |
+
}
|
| 448 |
+
|
| 449 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxEtiSetInjectionNvtxVersion)(uint32_t version)
|
| 450 |
+
{
|
| 451 |
+
/* Reserved for custom implementations to resolve problems with tools */
|
| 452 |
+
(void)version;
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
/* ---- Define implementations of init versions of all API functions ---- */
|
| 456 |
+
|
| 457 |
+
#include "nvtxInitDefs.h"
|
| 458 |
+
|
| 459 |
+
/* ---- Define implementations of initialization functions ---- */
|
| 460 |
+
|
| 461 |
+
#include "nvtxInit.h"
|
| 462 |
+
|
| 463 |
+
#ifdef __GNUC__
|
| 464 |
+
#pragma GCC visibility pop
|
| 465 |
+
#endif
|
| 466 |
+
|
| 467 |
+
#ifdef __cplusplus
|
| 468 |
+
} /* extern "C" */
|
| 469 |
+
#endif /* __cplusplus */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxImplCore.h
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
NVTX_DECLSPEC void NVTX_API nvtxMarkEx(const nvtxEventAttributes_t* eventAttrib)
|
| 2 |
+
{
|
| 3 |
+
#ifndef NVTX_DISABLE
|
| 4 |
+
nvtxMarkEx_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkEx_impl_fnptr;
|
| 5 |
+
if(local!=0)
|
| 6 |
+
(*local)(eventAttrib);
|
| 7 |
+
#endif /*NVTX_DISABLE*/
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
NVTX_DECLSPEC void NVTX_API nvtxMarkA(const char* message)
|
| 11 |
+
{
|
| 12 |
+
#ifndef NVTX_DISABLE
|
| 13 |
+
nvtxMarkA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkA_impl_fnptr;
|
| 14 |
+
if(local!=0)
|
| 15 |
+
(*local)(message);
|
| 16 |
+
#endif /*NVTX_DISABLE*/
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
NVTX_DECLSPEC void NVTX_API nvtxMarkW(const wchar_t* message)
|
| 20 |
+
{
|
| 21 |
+
#ifndef NVTX_DISABLE
|
| 22 |
+
nvtxMarkW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkW_impl_fnptr;
|
| 23 |
+
if(local!=0)
|
| 24 |
+
(*local)(message);
|
| 25 |
+
#endif /*NVTX_DISABLE*/
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartEx(const nvtxEventAttributes_t* eventAttrib)
|
| 29 |
+
{
|
| 30 |
+
#ifndef NVTX_DISABLE
|
| 31 |
+
nvtxRangeStartEx_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartEx_impl_fnptr;
|
| 32 |
+
if(local!=0)
|
| 33 |
+
return (*local)(eventAttrib);
|
| 34 |
+
else
|
| 35 |
+
#endif /*NVTX_DISABLE*/
|
| 36 |
+
return (nvtxRangeId_t)0;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartA(const char* message)
|
| 40 |
+
{
|
| 41 |
+
#ifndef NVTX_DISABLE
|
| 42 |
+
nvtxRangeStartA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartA_impl_fnptr;
|
| 43 |
+
if(local!=0)
|
| 44 |
+
return (*local)(message);
|
| 45 |
+
else
|
| 46 |
+
#endif /*NVTX_DISABLE*/
|
| 47 |
+
return (nvtxRangeId_t)0;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartW(const wchar_t* message)
|
| 51 |
+
{
|
| 52 |
+
#ifndef NVTX_DISABLE
|
| 53 |
+
nvtxRangeStartW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartW_impl_fnptr;
|
| 54 |
+
if(local!=0)
|
| 55 |
+
return (*local)(message);
|
| 56 |
+
else
|
| 57 |
+
#endif /*NVTX_DISABLE*/
|
| 58 |
+
return (nvtxRangeId_t)0;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
NVTX_DECLSPEC void NVTX_API nvtxRangeEnd(nvtxRangeId_t id)
|
| 62 |
+
{
|
| 63 |
+
#ifndef NVTX_DISABLE
|
| 64 |
+
nvtxRangeEnd_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeEnd_impl_fnptr;
|
| 65 |
+
if(local!=0)
|
| 66 |
+
(*local)(id);
|
| 67 |
+
#endif /*NVTX_DISABLE*/
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
NVTX_DECLSPEC int NVTX_API nvtxRangePushEx(const nvtxEventAttributes_t* eventAttrib)
|
| 71 |
+
{
|
| 72 |
+
#ifndef NVTX_DISABLE
|
| 73 |
+
nvtxRangePushEx_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushEx_impl_fnptr;
|
| 74 |
+
if(local!=0)
|
| 75 |
+
return (*local)(eventAttrib);
|
| 76 |
+
else
|
| 77 |
+
#endif /*NVTX_DISABLE*/
|
| 78 |
+
return (int)NVTX_NO_PUSH_POP_TRACKING;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
NVTX_DECLSPEC int NVTX_API nvtxRangePushA(const char* message)
|
| 82 |
+
{
|
| 83 |
+
#ifndef NVTX_DISABLE
|
| 84 |
+
nvtxRangePushA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushA_impl_fnptr;
|
| 85 |
+
if(local!=0)
|
| 86 |
+
return (*local)(message);
|
| 87 |
+
else
|
| 88 |
+
#endif /*NVTX_DISABLE*/
|
| 89 |
+
return (int)NVTX_NO_PUSH_POP_TRACKING;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
NVTX_DECLSPEC int NVTX_API nvtxRangePushW(const wchar_t* message)
|
| 93 |
+
{
|
| 94 |
+
#ifndef NVTX_DISABLE
|
| 95 |
+
nvtxRangePushW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushW_impl_fnptr;
|
| 96 |
+
if(local!=0)
|
| 97 |
+
return (*local)(message);
|
| 98 |
+
else
|
| 99 |
+
#endif /*NVTX_DISABLE*/
|
| 100 |
+
return (int)NVTX_NO_PUSH_POP_TRACKING;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
NVTX_DECLSPEC int NVTX_API nvtxRangePop(void)
|
| 104 |
+
{
|
| 105 |
+
#ifndef NVTX_DISABLE
|
| 106 |
+
nvtxRangePop_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePop_impl_fnptr;
|
| 107 |
+
if(local!=0)
|
| 108 |
+
return (*local)();
|
| 109 |
+
else
|
| 110 |
+
#endif /*NVTX_DISABLE*/
|
| 111 |
+
return (int)NVTX_NO_PUSH_POP_TRACKING;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCategoryA(uint32_t category, const char* name)
|
| 115 |
+
{
|
| 116 |
+
#ifndef NVTX_DISABLE
|
| 117 |
+
nvtxNameCategoryA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryA_impl_fnptr;
|
| 118 |
+
if(local!=0)
|
| 119 |
+
(*local)(category, name);
|
| 120 |
+
#endif /*NVTX_DISABLE*/
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCategoryW(uint32_t category, const wchar_t* name)
|
| 124 |
+
{
|
| 125 |
+
#ifndef NVTX_DISABLE
|
| 126 |
+
nvtxNameCategoryW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryW_impl_fnptr;
|
| 127 |
+
if(local!=0)
|
| 128 |
+
(*local)(category, name);
|
| 129 |
+
#endif /*NVTX_DISABLE*/
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameOsThreadA(uint32_t threadId, const char* name)
|
| 133 |
+
{
|
| 134 |
+
#ifndef NVTX_DISABLE
|
| 135 |
+
nvtxNameOsThreadA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadA_impl_fnptr;
|
| 136 |
+
if(local!=0)
|
| 137 |
+
(*local)(threadId, name);
|
| 138 |
+
#endif /*NVTX_DISABLE*/
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameOsThreadW(uint32_t threadId, const wchar_t* name)
|
| 142 |
+
{
|
| 143 |
+
#ifndef NVTX_DISABLE
|
| 144 |
+
nvtxNameOsThreadW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadW_impl_fnptr;
|
| 145 |
+
if(local!=0)
|
| 146 |
+
(*local)(threadId, name);
|
| 147 |
+
#endif /*NVTX_DISABLE*/
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainMarkEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib)
|
| 151 |
+
{
|
| 152 |
+
#ifndef NVTX_DISABLE
|
| 153 |
+
nvtxDomainMarkEx_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainMarkEx_impl_fnptr;
|
| 154 |
+
if(local!=0)
|
| 155 |
+
(*local)(domain, eventAttrib);
|
| 156 |
+
#endif /*NVTX_DISABLE*/
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxDomainRangeStartEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib)
|
| 160 |
+
{
|
| 161 |
+
#ifndef NVTX_DISABLE
|
| 162 |
+
nvtxDomainRangeStartEx_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeStartEx_impl_fnptr;
|
| 163 |
+
if(local!=0)
|
| 164 |
+
return (*local)(domain, eventAttrib);
|
| 165 |
+
else
|
| 166 |
+
#endif /*NVTX_DISABLE*/
|
| 167 |
+
return (nvtxRangeId_t)0;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainRangeEnd(nvtxDomainHandle_t domain, nvtxRangeId_t id)
|
| 171 |
+
{
|
| 172 |
+
#ifndef NVTX_DISABLE
|
| 173 |
+
nvtxDomainRangeEnd_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeEnd_impl_fnptr;
|
| 174 |
+
if(local!=0)
|
| 175 |
+
(*local)(domain, id);
|
| 176 |
+
#endif /*NVTX_DISABLE*/
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
NVTX_DECLSPEC int NVTX_API nvtxDomainRangePushEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib)
|
| 180 |
+
{
|
| 181 |
+
#ifndef NVTX_DISABLE
|
| 182 |
+
nvtxDomainRangePushEx_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePushEx_impl_fnptr;
|
| 183 |
+
if(local!=0)
|
| 184 |
+
return (*local)(domain, eventAttrib);
|
| 185 |
+
else
|
| 186 |
+
#endif /*NVTX_DISABLE*/
|
| 187 |
+
return (int)NVTX_NO_PUSH_POP_TRACKING;
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
NVTX_DECLSPEC int NVTX_API nvtxDomainRangePop(nvtxDomainHandle_t domain)
|
| 191 |
+
{
|
| 192 |
+
#ifndef NVTX_DISABLE
|
| 193 |
+
nvtxDomainRangePop_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePop_impl_fnptr;
|
| 194 |
+
if(local!=0)
|
| 195 |
+
return (*local)(domain);
|
| 196 |
+
else
|
| 197 |
+
#endif /*NVTX_DISABLE*/
|
| 198 |
+
return (int)NVTX_NO_PUSH_POP_TRACKING;
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
NVTX_DECLSPEC nvtxResourceHandle_t NVTX_API nvtxDomainResourceCreate(nvtxDomainHandle_t domain, nvtxResourceAttributes_t* attribs)
|
| 202 |
+
{
|
| 203 |
+
#ifndef NVTX_DISABLE
|
| 204 |
+
nvtxDomainResourceCreate_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceCreate_impl_fnptr;
|
| 205 |
+
if(local!=0)
|
| 206 |
+
return (*local)(domain, attribs);
|
| 207 |
+
else
|
| 208 |
+
#endif /*NVTX_DISABLE*/
|
| 209 |
+
return (nvtxResourceHandle_t)0;
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainResourceDestroy(nvtxResourceHandle_t resource)
|
| 213 |
+
{
|
| 214 |
+
#ifndef NVTX_DISABLE
|
| 215 |
+
nvtxDomainResourceDestroy_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceDestroy_impl_fnptr;
|
| 216 |
+
if(local!=0)
|
| 217 |
+
(*local)(resource);
|
| 218 |
+
#endif /*NVTX_DISABLE*/
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainNameCategoryA(nvtxDomainHandle_t domain, uint32_t category, const char* name)
|
| 222 |
+
{
|
| 223 |
+
#ifndef NVTX_DISABLE
|
| 224 |
+
nvtxDomainNameCategoryA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryA_impl_fnptr;
|
| 225 |
+
if(local!=0)
|
| 226 |
+
(*local)(domain, category, name);
|
| 227 |
+
#endif /*NVTX_DISABLE*/
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainNameCategoryW(nvtxDomainHandle_t domain, uint32_t category, const wchar_t* name)
|
| 231 |
+
{
|
| 232 |
+
#ifndef NVTX_DISABLE
|
| 233 |
+
nvtxDomainNameCategoryW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryW_impl_fnptr;
|
| 234 |
+
if(local!=0)
|
| 235 |
+
(*local)(domain, category, name);
|
| 236 |
+
#endif /*NVTX_DISABLE*/
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringA(nvtxDomainHandle_t domain, const char* string)
|
| 240 |
+
{
|
| 241 |
+
#ifndef NVTX_DISABLE
|
| 242 |
+
nvtxDomainRegisterStringA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringA_impl_fnptr;
|
| 243 |
+
if(local!=0)
|
| 244 |
+
return (*local)(domain, string);
|
| 245 |
+
else
|
| 246 |
+
#endif /*NVTX_DISABLE*/
|
| 247 |
+
return (nvtxStringHandle_t)0;
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringW(nvtxDomainHandle_t domain, const wchar_t* string)
|
| 251 |
+
{
|
| 252 |
+
#ifndef NVTX_DISABLE
|
| 253 |
+
nvtxDomainRegisterStringW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringW_impl_fnptr;
|
| 254 |
+
if(local!=0)
|
| 255 |
+
return (*local)(domain, string);
|
| 256 |
+
else
|
| 257 |
+
#endif /*NVTX_DISABLE*/
|
| 258 |
+
return (nvtxStringHandle_t)0;
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateA(const char* message)
|
| 262 |
+
{
|
| 263 |
+
#ifndef NVTX_DISABLE
|
| 264 |
+
nvtxDomainCreateA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateA_impl_fnptr;
|
| 265 |
+
if(local!=0)
|
| 266 |
+
return (*local)(message);
|
| 267 |
+
else
|
| 268 |
+
#endif /*NVTX_DISABLE*/
|
| 269 |
+
return (nvtxDomainHandle_t)0;
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateW(const wchar_t* message)
|
| 273 |
+
{
|
| 274 |
+
#ifndef NVTX_DISABLE
|
| 275 |
+
nvtxDomainCreateW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateW_impl_fnptr;
|
| 276 |
+
if(local!=0)
|
| 277 |
+
return (*local)(message);
|
| 278 |
+
else
|
| 279 |
+
#endif /*NVTX_DISABLE*/
|
| 280 |
+
return (nvtxDomainHandle_t)0;
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
NVTX_DECLSPEC void NVTX_API nvtxDomainDestroy(nvtxDomainHandle_t domain)
|
| 284 |
+
{
|
| 285 |
+
#ifndef NVTX_DISABLE
|
| 286 |
+
nvtxDomainDestroy_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainDestroy_impl_fnptr;
|
| 287 |
+
if(local!=0)
|
| 288 |
+
(*local)(domain);
|
| 289 |
+
#endif /*NVTX_DISABLE*/
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
NVTX_DECLSPEC void NVTX_API nvtxInitialize(const void* reserved)
|
| 293 |
+
{
|
| 294 |
+
#ifndef NVTX_DISABLE
|
| 295 |
+
nvtxInitialize_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxInitialize_impl_fnptr;
|
| 296 |
+
if(local!=0)
|
| 297 |
+
(*local)(reserved);
|
| 298 |
+
#endif /*NVTX_DISABLE*/
|
| 299 |
+
}
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxImplCuda_v3.h
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* This file was procedurally generated! Do not modify this file by hand. */
|
| 2 |
+
|
| 3 |
+
/*
|
| 4 |
+
* Copyright 2009-2016 NVIDIA Corporation. All rights reserved.
|
| 5 |
+
*
|
| 6 |
+
* NOTICE TO USER:
|
| 7 |
+
*
|
| 8 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 9 |
+
* international Copyright laws.
|
| 10 |
+
*
|
| 11 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 12 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 13 |
+
* of a form of NVIDIA software license agreement.
|
| 14 |
+
*
|
| 15 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 16 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 17 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 18 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 19 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 20 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 21 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 22 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 23 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 24 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 25 |
+
*
|
| 26 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 27 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 28 |
+
* "commercial computer software" and "commercial computer software
|
| 29 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 30 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 31 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 32 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 33 |
+
* source code with only those rights set forth herein.
|
| 34 |
+
*
|
| 35 |
+
* Any use of this source code in individual and commercial software must
|
| 36 |
+
* include, in the user documentation and internal comments to the code,
|
| 37 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 38 |
+
*/
|
| 39 |
+
|
| 40 |
+
#ifndef NVTX_IMPL_GUARD_CUDA
|
| 41 |
+
#error Never include this file directly -- it is automatically included by nvToolsExtCuda.h (except when NVTX_NO_IMPL is defined).
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
#ifdef __cplusplus
|
| 46 |
+
extern "C" {
|
| 47 |
+
#endif /* __cplusplus */
|
| 48 |
+
|
| 49 |
+
typedef void (NVTX_API * nvtxNameCuDeviceA_impl_fntype)(CUdevice device, const char* name);
|
| 50 |
+
typedef void (NVTX_API * nvtxNameCuDeviceW_impl_fntype)(CUdevice device, const wchar_t* name);
|
| 51 |
+
typedef void (NVTX_API * nvtxNameCuContextA_impl_fntype)(CUcontext context, const char* name);
|
| 52 |
+
typedef void (NVTX_API * nvtxNameCuContextW_impl_fntype)(CUcontext context, const wchar_t* name);
|
| 53 |
+
typedef void (NVTX_API * nvtxNameCuStreamA_impl_fntype)(CUstream stream, const char* name);
|
| 54 |
+
typedef void (NVTX_API * nvtxNameCuStreamW_impl_fntype)(CUstream stream, const wchar_t* name);
|
| 55 |
+
typedef void (NVTX_API * nvtxNameCuEventA_impl_fntype)(CUevent event, const char* name);
|
| 56 |
+
typedef void (NVTX_API * nvtxNameCuEventW_impl_fntype)(CUevent event, const wchar_t* name);
|
| 57 |
+
|
| 58 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceA(CUdevice device, const char* name)
|
| 59 |
+
{
|
| 60 |
+
#ifndef NVTX_DISABLE
|
| 61 |
+
nvtxNameCuDeviceA_impl_fntype local = (nvtxNameCuDeviceA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceA_impl_fnptr;
|
| 62 |
+
if(local!=0)
|
| 63 |
+
(*local)(device, name);
|
| 64 |
+
#endif /*NVTX_DISABLE*/
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceW(CUdevice device, const wchar_t* name)
|
| 68 |
+
{
|
| 69 |
+
#ifndef NVTX_DISABLE
|
| 70 |
+
nvtxNameCuDeviceW_impl_fntype local = (nvtxNameCuDeviceW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceW_impl_fnptr;
|
| 71 |
+
if(local!=0)
|
| 72 |
+
(*local)(device, name);
|
| 73 |
+
#endif /*NVTX_DISABLE*/
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuContextA(CUcontext context, const char* name)
|
| 77 |
+
{
|
| 78 |
+
#ifndef NVTX_DISABLE
|
| 79 |
+
nvtxNameCuContextA_impl_fntype local = (nvtxNameCuContextA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextA_impl_fnptr;
|
| 80 |
+
if(local!=0)
|
| 81 |
+
(*local)(context, name);
|
| 82 |
+
#endif /*NVTX_DISABLE*/
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuContextW(CUcontext context, const wchar_t* name)
|
| 86 |
+
{
|
| 87 |
+
#ifndef NVTX_DISABLE
|
| 88 |
+
nvtxNameCuContextW_impl_fntype local = (nvtxNameCuContextW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextW_impl_fnptr;
|
| 89 |
+
if(local!=0)
|
| 90 |
+
(*local)(context, name);
|
| 91 |
+
#endif /*NVTX_DISABLE*/
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamA(CUstream stream, const char* name)
|
| 95 |
+
{
|
| 96 |
+
#ifndef NVTX_DISABLE
|
| 97 |
+
nvtxNameCuStreamA_impl_fntype local = (nvtxNameCuStreamA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamA_impl_fnptr;
|
| 98 |
+
if(local!=0)
|
| 99 |
+
(*local)(stream, name);
|
| 100 |
+
#endif /*NVTX_DISABLE*/
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamW(CUstream stream, const wchar_t* name)
|
| 104 |
+
{
|
| 105 |
+
#ifndef NVTX_DISABLE
|
| 106 |
+
nvtxNameCuStreamW_impl_fntype local = (nvtxNameCuStreamW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamW_impl_fnptr;
|
| 107 |
+
if(local!=0)
|
| 108 |
+
(*local)(stream, name);
|
| 109 |
+
#endif /*NVTX_DISABLE*/
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuEventA(CUevent event, const char* name)
|
| 113 |
+
{
|
| 114 |
+
#ifndef NVTX_DISABLE
|
| 115 |
+
nvtxNameCuEventA_impl_fntype local = (nvtxNameCuEventA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventA_impl_fnptr;
|
| 116 |
+
if(local!=0)
|
| 117 |
+
(*local)(event, name);
|
| 118 |
+
#endif /*NVTX_DISABLE*/
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameCuEventW(CUevent event, const wchar_t* name)
|
| 122 |
+
{
|
| 123 |
+
#ifndef NVTX_DISABLE
|
| 124 |
+
nvtxNameCuEventW_impl_fntype local = (nvtxNameCuEventW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventW_impl_fnptr;
|
| 125 |
+
if(local!=0)
|
| 126 |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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* This file was procedurally generated! Do not modify this file by hand. */
|
| 2 |
+
|
| 3 |
+
/*
|
| 4 |
+
* Copyright 2009-2016 NVIDIA Corporation. All rights reserved.
|
| 5 |
+
*
|
| 6 |
+
* NOTICE TO USER:
|
| 7 |
+
*
|
| 8 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 9 |
+
* international Copyright laws.
|
| 10 |
+
*
|
| 11 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 12 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 13 |
+
* of a form of NVIDIA software license agreement.
|
| 14 |
+
*
|
| 15 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 16 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 17 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 18 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 19 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 20 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 21 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 22 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 23 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 24 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 25 |
+
*
|
| 26 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 27 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 28 |
+
* "commercial computer software" and "commercial computer software
|
| 29 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 30 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 31 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 32 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 33 |
+
* source code with only those rights set forth herein.
|
| 34 |
+
*
|
| 35 |
+
* Any use of this source code in individual and commercial software must
|
| 36 |
+
* include, in the user documentation and internal comments to the code,
|
| 37 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 38 |
+
*/
|
| 39 |
+
|
| 40 |
+
#ifndef NVTX_IMPL_GUARD_OPENCL
|
| 41 |
+
#error Never include this file directly -- it is automatically included by nvToolsExtCuda.h (except when NVTX_NO_IMPL is defined).
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
#ifdef __cplusplus
|
| 46 |
+
extern "C" {
|
| 47 |
+
#endif /* __cplusplus */
|
| 48 |
+
|
| 49 |
+
typedef void (NVTX_API * nvtxNameClDeviceA_impl_fntype)(cl_device_id device, const char* name);
|
| 50 |
+
typedef void (NVTX_API * nvtxNameClDeviceW_impl_fntype)(cl_device_id device, const wchar_t* name);
|
| 51 |
+
typedef void (NVTX_API * nvtxNameClContextA_impl_fntype)(cl_context context, const char* name);
|
| 52 |
+
typedef void (NVTX_API * nvtxNameClContextW_impl_fntype)(cl_context context, const wchar_t* name);
|
| 53 |
+
typedef void (NVTX_API * nvtxNameClCommandQueueA_impl_fntype)(cl_command_queue command_queue, const char* name);
|
| 54 |
+
typedef void (NVTX_API * nvtxNameClCommandQueueW_impl_fntype)(cl_command_queue command_queue, const wchar_t* name);
|
| 55 |
+
typedef void (NVTX_API * nvtxNameClMemObjectA_impl_fntype)(cl_mem memobj, const char* name);
|
| 56 |
+
typedef void (NVTX_API * nvtxNameClMemObjectW_impl_fntype)(cl_mem memobj, const wchar_t* name);
|
| 57 |
+
typedef void (NVTX_API * nvtxNameClSamplerA_impl_fntype)(cl_sampler sampler, const char* name);
|
| 58 |
+
typedef void (NVTX_API * nvtxNameClSamplerW_impl_fntype)(cl_sampler sampler, const wchar_t* name);
|
| 59 |
+
typedef void (NVTX_API * nvtxNameClProgramA_impl_fntype)(cl_program program, const char* name);
|
| 60 |
+
typedef void (NVTX_API * nvtxNameClProgramW_impl_fntype)(cl_program program, const wchar_t* name);
|
| 61 |
+
typedef void (NVTX_API * nvtxNameClEventA_impl_fntype)(cl_event evnt, const char* name);
|
| 62 |
+
typedef void (NVTX_API * nvtxNameClEventW_impl_fntype)(cl_event evnt, const wchar_t* name);
|
| 63 |
+
|
| 64 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClDeviceA(cl_device_id device, const char* name)
|
| 65 |
+
{
|
| 66 |
+
#ifndef NVTX_DISABLE
|
| 67 |
+
nvtxNameClDeviceA_impl_fntype local = (nvtxNameClDeviceA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceA_impl_fnptr;
|
| 68 |
+
if(local!=0)
|
| 69 |
+
(*local)(device, name);
|
| 70 |
+
#endif /*NVTX_DISABLE*/
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClDeviceW(cl_device_id device, const wchar_t* name)
|
| 74 |
+
{
|
| 75 |
+
#ifndef NVTX_DISABLE
|
| 76 |
+
nvtxNameClDeviceW_impl_fntype local = (nvtxNameClDeviceW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceW_impl_fnptr;
|
| 77 |
+
if(local!=0)
|
| 78 |
+
(*local)(device, name);
|
| 79 |
+
#endif /*NVTX_DISABLE*/
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClContextA(cl_context context, const char* name)
|
| 83 |
+
{
|
| 84 |
+
#ifndef NVTX_DISABLE
|
| 85 |
+
nvtxNameClContextA_impl_fntype local = (nvtxNameClContextA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextA_impl_fnptr;
|
| 86 |
+
if(local!=0)
|
| 87 |
+
(*local)(context, name);
|
| 88 |
+
#endif /*NVTX_DISABLE*/
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClContextW(cl_context context, const wchar_t* name)
|
| 92 |
+
{
|
| 93 |
+
#ifndef NVTX_DISABLE
|
| 94 |
+
nvtxNameClContextW_impl_fntype local = (nvtxNameClContextW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextW_impl_fnptr;
|
| 95 |
+
if(local!=0)
|
| 96 |
+
(*local)(context, name);
|
| 97 |
+
#endif /*NVTX_DISABLE*/
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClCommandQueueA(cl_command_queue command_queue, const char* name)
|
| 101 |
+
{
|
| 102 |
+
#ifndef NVTX_DISABLE
|
| 103 |
+
nvtxNameClCommandQueueA_impl_fntype local = (nvtxNameClCommandQueueA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueA_impl_fnptr;
|
| 104 |
+
if(local!=0)
|
| 105 |
+
(*local)(command_queue, name);
|
| 106 |
+
#endif /*NVTX_DISABLE*/
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClCommandQueueW(cl_command_queue command_queue, const wchar_t* name)
|
| 110 |
+
{
|
| 111 |
+
#ifndef NVTX_DISABLE
|
| 112 |
+
nvtxNameClCommandQueueW_impl_fntype local = (nvtxNameClCommandQueueW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueW_impl_fnptr;
|
| 113 |
+
if(local!=0)
|
| 114 |
+
(*local)(command_queue, name);
|
| 115 |
+
#endif /*NVTX_DISABLE*/
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClMemObjectA(cl_mem memobj, const char* name)
|
| 119 |
+
{
|
| 120 |
+
#ifndef NVTX_DISABLE
|
| 121 |
+
nvtxNameClMemObjectA_impl_fntype local = (nvtxNameClMemObjectA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectA_impl_fnptr;
|
| 122 |
+
if(local!=0)
|
| 123 |
+
(*local)(memobj, name);
|
| 124 |
+
#endif /*NVTX_DISABLE*/
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClMemObjectW(cl_mem memobj, const wchar_t* name)
|
| 128 |
+
{
|
| 129 |
+
#ifndef NVTX_DISABLE
|
| 130 |
+
nvtxNameClMemObjectW_impl_fntype local = (nvtxNameClMemObjectW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectW_impl_fnptr;
|
| 131 |
+
if(local!=0)
|
| 132 |
+
(*local)(memobj, name);
|
| 133 |
+
#endif /*NVTX_DISABLE*/
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClSamplerA(cl_sampler sampler, const char* name)
|
| 137 |
+
{
|
| 138 |
+
#ifndef NVTX_DISABLE
|
| 139 |
+
nvtxNameClSamplerA_impl_fntype local = (nvtxNameClSamplerA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerA_impl_fnptr;
|
| 140 |
+
if(local!=0)
|
| 141 |
+
(*local)(sampler, name);
|
| 142 |
+
#endif /*NVTX_DISABLE*/
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClSamplerW(cl_sampler sampler, const wchar_t* name)
|
| 146 |
+
{
|
| 147 |
+
#ifndef NVTX_DISABLE
|
| 148 |
+
nvtxNameClSamplerW_impl_fntype local = (nvtxNameClSamplerW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerW_impl_fnptr;
|
| 149 |
+
if(local!=0)
|
| 150 |
+
(*local)(sampler, name);
|
| 151 |
+
#endif /*NVTX_DISABLE*/
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClProgramA(cl_program program, const char* name)
|
| 155 |
+
{
|
| 156 |
+
#ifndef NVTX_DISABLE
|
| 157 |
+
nvtxNameClProgramA_impl_fntype local = (nvtxNameClProgramA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramA_impl_fnptr;
|
| 158 |
+
if(local!=0)
|
| 159 |
+
(*local)(program, name);
|
| 160 |
+
#endif /*NVTX_DISABLE*/
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClProgramW(cl_program program, const wchar_t* name)
|
| 164 |
+
{
|
| 165 |
+
#ifndef NVTX_DISABLE
|
| 166 |
+
nvtxNameClProgramW_impl_fntype local = (nvtxNameClProgramW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramW_impl_fnptr;
|
| 167 |
+
if(local!=0)
|
| 168 |
+
(*local)(program, name);
|
| 169 |
+
#endif /*NVTX_DISABLE*/
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClEventA(cl_event evnt, const char* name)
|
| 173 |
+
{
|
| 174 |
+
#ifndef NVTX_DISABLE
|
| 175 |
+
nvtxNameClEventA_impl_fntype local = (nvtxNameClEventA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventA_impl_fnptr;
|
| 176 |
+
if(local!=0)
|
| 177 |
+
(*local)(evnt, name);
|
| 178 |
+
#endif /*NVTX_DISABLE*/
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
NVTX_DECLSPEC void NVTX_API nvtxNameClEventW(cl_event evnt, const wchar_t* name)
|
| 182 |
+
{
|
| 183 |
+
#ifndef NVTX_DISABLE
|
| 184 |
+
nvtxNameClEventW_impl_fntype local = (nvtxNameClEventW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventW_impl_fnptr;
|
| 185 |
+
if(local!=0)
|
| 186 |
+
(*local)(evnt, name);
|
| 187 |
+
#endif /*NVTX_DISABLE*/
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
#ifdef __cplusplus
|
| 191 |
+
} /* extern "C" */
|
| 192 |
+
#endif /* __cplusplus */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxInit.h
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* This file was procedurally generated! Do not modify this file by hand. */
|
| 2 |
+
|
| 3 |
+
/*
|
| 4 |
+
* Copyright 2009-2016 NVIDIA Corporation. All rights reserved.
|
| 5 |
+
*
|
| 6 |
+
* NOTICE TO USER:
|
| 7 |
+
*
|
| 8 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 9 |
+
* international Copyright laws.
|
| 10 |
+
*
|
| 11 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 12 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 13 |
+
* of a form of NVIDIA software license agreement.
|
| 14 |
+
*
|
| 15 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 16 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 17 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 18 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 19 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 20 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 21 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 22 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 23 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 24 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 25 |
+
*
|
| 26 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 27 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 28 |
+
* "commercial computer software" and "commercial computer software
|
| 29 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 30 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 31 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 32 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 33 |
+
* source code with only those rights set forth herein.
|
| 34 |
+
*
|
| 35 |
+
* Any use of this source code in individual and commercial software must
|
| 36 |
+
* include, in the user documentation and internal comments to the code,
|
| 37 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 38 |
+
*/
|
| 39 |
+
|
| 40 |
+
#ifndef NVTX_IMPL_GUARD
|
| 41 |
+
#error Never include this file directly -- it is automatically included by nvToolsExt.h (except when NVTX_NO_IMPL is defined).
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
/* ---- Platform-independent helper definitions and functions ---- */
|
| 45 |
+
|
| 46 |
+
/* Prefer macros over inline functions to reduce symbol resolution at link time */
|
| 47 |
+
|
| 48 |
+
#if defined(_WIN32)
|
| 49 |
+
#define NVTX_PATHCHAR wchar_t
|
| 50 |
+
#define NVTX_STR(x) L##x
|
| 51 |
+
#define NVTX_GETENV _wgetenv
|
| 52 |
+
#define NVTX_BUFSIZE MAX_PATH
|
| 53 |
+
#define NVTX_DLLHANDLE HMODULE
|
| 54 |
+
#define NVTX_DLLOPEN(x) LoadLibraryW(x)
|
| 55 |
+
#define NVTX_DLLFUNC GetProcAddress
|
| 56 |
+
#define NVTX_DLLCLOSE FreeLibrary
|
| 57 |
+
#define NVTX_YIELD() SwitchToThread()
|
| 58 |
+
#define NVTX_MEMBAR() MemoryBarrier()
|
| 59 |
+
#define NVTX_ATOMIC_WRITE_32(address, value) InterlockedExchange((volatile LONG*)address, value)
|
| 60 |
+
#define NVTX_ATOMIC_CAS_32(old, address, exchange, comparand) old = InterlockedCompareExchange((volatile LONG*)address, exchange, comparand)
|
| 61 |
+
#elif defined(__GNUC__)
|
| 62 |
+
#define NVTX_PATHCHAR char
|
| 63 |
+
#define NVTX_STR(x) x
|
| 64 |
+
#define NVTX_GETENV getenv
|
| 65 |
+
#define NVTX_BUFSIZE PATH_MAX
|
| 66 |
+
#define NVTX_DLLHANDLE void*
|
| 67 |
+
#define NVTX_DLLOPEN(x) dlopen(x, RTLD_LAZY)
|
| 68 |
+
#define NVTX_DLLFUNC dlsym
|
| 69 |
+
#define NVTX_DLLCLOSE dlclose
|
| 70 |
+
#define NVTX_YIELD() sched_yield()
|
| 71 |
+
#define NVTX_MEMBAR() __sync_synchronize()
|
| 72 |
+
/* Ensure full memory barrier for atomics, to match Windows functions */
|
| 73 |
+
#define NVTX_ATOMIC_WRITE_32(address, value) __sync_synchronize(); __sync_lock_test_and_set(address, value)
|
| 74 |
+
#define NVTX_ATOMIC_CAS_32(old, address, exchange, comparand) __sync_synchronize(); old = __sync_val_compare_and_swap(address, exchange, comparand)
|
| 75 |
+
#else
|
| 76 |
+
#error The library does not support your configuration!
|
| 77 |
+
#endif
|
| 78 |
+
|
| 79 |
+
/* Define this to 1 for platforms that where pre-injected libraries can be discovered. */
|
| 80 |
+
#if defined(_WIN32)
|
| 81 |
+
/* TODO */
|
| 82 |
+
#define NVTX_SUPPORT_ALREADY_INJECTED_LIBRARY 0
|
| 83 |
+
#else
|
| 84 |
+
#define NVTX_SUPPORT_ALREADY_INJECTED_LIBRARY 0
|
| 85 |
+
#endif
|
| 86 |
+
|
| 87 |
+
/* Define this to 1 for platforms that support environment variables */
|
| 88 |
+
/* TODO: Detect UWP, a.k.a. Windows Store app, and set this to 0. */
|
| 89 |
+
/* Try: #if defined(WINAPI_FAMILY_PARTITION) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
|
| 90 |
+
#define NVTX_SUPPORT_ENV_VARS 1
|
| 91 |
+
|
| 92 |
+
/* Define this to 1 for platforms that support dynamic/shared libraries */
|
| 93 |
+
#define NVTX_SUPPORT_DYNAMIC_INJECTION_LIBRARY 1
|
| 94 |
+
|
| 95 |
+
/* Injection libraries implementing InitializeInjectionNvtx2 may be statically linked,
|
| 96 |
+
* and this will override any dynamic injection. Useful for platforms where dynamic
|
| 97 |
+
* injection is not available. Since weak symbols not explicitly marked extern are
|
| 98 |
+
* guaranteed to be initialized to zero if no definitions are found by the linker, the
|
| 99 |
+
* dynamic injection process proceeds normally if pfnInitializeInjectionNvtx2 is 0. */
|
| 100 |
+
#if defined(__GNUC__) && !defined(_WIN32) && !defined(__CYGWIN__)
|
| 101 |
+
#define NVTX_SUPPORT_STATIC_INJECTION_LIBRARY 1
|
| 102 |
+
/* To statically inject an NVTX library, define InitializeInjectionNvtx2_fnptr as a normal
|
| 103 |
+
* symbol (not weak) pointing to the implementation of InitializeInjectionNvtx2 (which
|
| 104 |
+
* does not need to be named "InitializeInjectionNvtx2" as is necessary in a dynamic
|
| 105 |
+
* injection library. */
|
| 106 |
+
__attribute__((weak)) NvtxInitializeInjectionNvtxFunc_t InitializeInjectionNvtx2_fnptr;
|
| 107 |
+
#else
|
| 108 |
+
#define NVTX_SUPPORT_STATIC_INJECTION_LIBRARY 0
|
| 109 |
+
#endif
|
| 110 |
+
|
| 111 |
+
/* This function tries to find or load an NVTX injection library and get the
|
| 112 |
+
* address of its InitializeInjection2 function. If such a function pointer
|
| 113 |
+
* is found, it is called, and passed the address of this NVTX instance's
|
| 114 |
+
* nvtxGetExportTable function, so the injection can attach to this instance.
|
| 115 |
+
* If the initialization fails for any reason, any dynamic library loaded will
|
| 116 |
+
* be freed, and all NVTX implementation functions will be set to no-ops. If
|
| 117 |
+
* initialization succeeds, NVTX functions not attached to the tool will be set
|
| 118 |
+
* to no-ops. This is implemented as one function instead of several small
|
| 119 |
+
* functions to minimize the number of weak symbols the linker must resolve.
|
| 120 |
+
* Order of search is:
|
| 121 |
+
* - Pre-injected library exporting InitializeInjectionNvtx2
|
| 122 |
+
* - Loadable library exporting InitializeInjectionNvtx2
|
| 123 |
+
* - Path specified by env var NVTX_INJECTION??_PATH (?? is 32 or 64)
|
| 124 |
+
* - On Android, libNvtxInjection??.so within the package (?? is 32 or 64)
|
| 125 |
+
* - Statically-linked injection library defining InitializeInjectionNvtx2_fnptr
|
| 126 |
+
*/
|
| 127 |
+
NVTX_LINKONCE_FWDDECL_FUNCTION int NVTX_VERSIONED_IDENTIFIER(nvtxInitializeInjectionLibrary)(void);
|
| 128 |
+
NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_VERSIONED_IDENTIFIER(nvtxInitializeInjectionLibrary)(void)
|
| 129 |
+
{
|
| 130 |
+
const char* const initFuncName = "InitializeInjectionNvtx2";
|
| 131 |
+
NvtxInitializeInjectionNvtxFunc_t init_fnptr = (NvtxInitializeInjectionNvtxFunc_t)0;
|
| 132 |
+
NVTX_DLLHANDLE injectionLibraryHandle = (NVTX_DLLHANDLE)0;
|
| 133 |
+
int entryPointStatus = 0;
|
| 134 |
+
|
| 135 |
+
#if NVTX_SUPPORT_ALREADY_INJECTED_LIBRARY
|
| 136 |
+
/* Use POSIX global symbol chain to query for init function from any module */
|
| 137 |
+
init_fnptr = (NvtxInitializeInjectionNvtxFunc_t)NVTX_DLLFUNC(0, initFuncName);
|
| 138 |
+
#endif
|
| 139 |
+
|
| 140 |
+
#if NVTX_SUPPORT_DYNAMIC_INJECTION_LIBRARY
|
| 141 |
+
/* Try discovering dynamic injection library to load */
|
| 142 |
+
if (!init_fnptr)
|
| 143 |
+
{
|
| 144 |
+
#if NVTX_SUPPORT_ENV_VARS
|
| 145 |
+
/* If env var NVTX_INJECTION64_PATH is set, it should contain the path
|
| 146 |
+
* to a 64-bit dynamic NVTX injection library (and similar for 32-bit). */
|
| 147 |
+
const NVTX_PATHCHAR* const nvtxEnvVarName = (sizeof(void*) == 4)
|
| 148 |
+
? NVTX_STR("NVTX_INJECTION32_PATH")
|
| 149 |
+
: NVTX_STR("NVTX_INJECTION64_PATH");
|
| 150 |
+
#endif /* NVTX_SUPPORT_ENV_VARS */
|
| 151 |
+
NVTX_PATHCHAR injectionLibraryPathBuf[NVTX_BUFSIZE];
|
| 152 |
+
const NVTX_PATHCHAR* injectionLibraryPath = (const NVTX_PATHCHAR*)0;
|
| 153 |
+
|
| 154 |
+
/* Refer to this variable explicitly in case all references to it are #if'ed out */
|
| 155 |
+
(void)injectionLibraryPathBuf;
|
| 156 |
+
|
| 157 |
+
#if NVTX_SUPPORT_ENV_VARS
|
| 158 |
+
/* Disable the warning for getenv & _wgetenv -- this usage is safe because
|
| 159 |
+
* these functions are not called again before using the returned value. */
|
| 160 |
+
#if defined(_MSC_VER)
|
| 161 |
+
#pragma warning( push )
|
| 162 |
+
#pragma warning( disable : 4996 )
|
| 163 |
+
#endif
|
| 164 |
+
injectionLibraryPath = NVTX_GETENV(nvtxEnvVarName);
|
| 165 |
+
#if defined(_MSC_VER)
|
| 166 |
+
#pragma warning( pop )
|
| 167 |
+
#endif
|
| 168 |
+
#endif
|
| 169 |
+
|
| 170 |
+
#if defined(__ANDROID__)
|
| 171 |
+
if (!injectionLibraryPath)
|
| 172 |
+
{
|
| 173 |
+
const char *bits = (sizeof(void*) == 4) ? "32" : "64";
|
| 174 |
+
char cmdlineBuf[32];
|
| 175 |
+
char pkgName[PATH_MAX];
|
| 176 |
+
int count;
|
| 177 |
+
int pid;
|
| 178 |
+
FILE *fp;
|
| 179 |
+
size_t bytesRead;
|
| 180 |
+
size_t pos;
|
| 181 |
+
|
| 182 |
+
pid = (int)getpid();
|
| 183 |
+
count = snprintf(cmdlineBuf, sizeof(cmdlineBuf), "/proc/%d/cmdline", pid);
|
| 184 |
+
if (count <= 0 || count >= (int)sizeof(cmdlineBuf))
|
| 185 |
+
{
|
| 186 |
+
NVTX_ERR("Path buffer too small for: /proc/%d/cmdline\n", pid);
|
| 187 |
+
return NVTX_ERR_INIT_ACCESS_LIBRARY;
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
fp = fopen(cmdlineBuf, "r");
|
| 191 |
+
if (!fp)
|
| 192 |
+
{
|
| 193 |
+
NVTX_ERR("File couldn't be opened: %s\n", cmdlineBuf);
|
| 194 |
+
return NVTX_ERR_INIT_ACCESS_LIBRARY;
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
bytesRead = fread(pkgName, 1, sizeof(pkgName) - 1, fp);
|
| 198 |
+
fclose(fp);
|
| 199 |
+
if (bytesRead == 0)
|
| 200 |
+
{
|
| 201 |
+
NVTX_ERR("Package name couldn't be read from file: %s\n", cmdlineBuf);
|
| 202 |
+
return NVTX_ERR_INIT_ACCESS_LIBRARY;
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
pkgName[bytesRead] = 0;
|
| 206 |
+
|
| 207 |
+
/* String can contain colon as a process separator. In this case the package name is before the colon. */
|
| 208 |
+
pos = 0;
|
| 209 |
+
while (pos < bytesRead && pkgName[pos] != ':' && pkgName[pos] != '\0')
|
| 210 |
+
{
|
| 211 |
+
++pos;
|
| 212 |
+
}
|
| 213 |
+
pkgName[pos] = 0;
|
| 214 |
+
|
| 215 |
+
count = snprintf(injectionLibraryPathBuf, NVTX_BUFSIZE, "/data/data/%s/files/libNvtxInjection%s.so", pkgName, bits);
|
| 216 |
+
if (count <= 0 || count >= NVTX_BUFSIZE)
|
| 217 |
+
{
|
| 218 |
+
NVTX_ERR("Path buffer too small for: /data/data/%s/files/libNvtxInjection%s.so\n", pkgName, bits);
|
| 219 |
+
return NVTX_ERR_INIT_ACCESS_LIBRARY;
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
/* On Android, verify path is accessible due to aggressive file access restrictions. */
|
| 223 |
+
/* For dlopen, if the filename contains a leading slash, then it is interpreted as a */
|
| 224 |
+
/* relative or absolute pathname; otherwise it will follow the rules in ld.so. */
|
| 225 |
+
if (injectionLibraryPathBuf[0] == '/')
|
| 226 |
+
{
|
| 227 |
+
#if (__ANDROID_API__ < 21)
|
| 228 |
+
int access_err = access(injectionLibraryPathBuf, F_OK | R_OK);
|
| 229 |
+
#else
|
| 230 |
+
int access_err = faccessat(AT_FDCWD, injectionLibraryPathBuf, F_OK | R_OK, 0);
|
| 231 |
+
#endif
|
| 232 |
+
if (access_err != 0)
|
| 233 |
+
{
|
| 234 |
+
NVTX_ERR("Injection library path wasn't accessible [code=%s] [path=%s]\n", strerror(errno), injectionLibraryPathBuf);
|
| 235 |
+
return NVTX_ERR_INIT_ACCESS_LIBRARY;
|
| 236 |
+
}
|
| 237 |
+
}
|
| 238 |
+
injectionLibraryPath = injectionLibraryPathBuf;
|
| 239 |
+
}
|
| 240 |
+
#endif
|
| 241 |
+
|
| 242 |
+
/* At this point, injectionLibraryPath is specified if a dynamic
|
| 243 |
+
* injection library was specified by a tool. */
|
| 244 |
+
if (injectionLibraryPath)
|
| 245 |
+
{
|
| 246 |
+
/* Load the injection library */
|
| 247 |
+
injectionLibraryHandle = NVTX_DLLOPEN(injectionLibraryPath);
|
| 248 |
+
if (!injectionLibraryHandle)
|
| 249 |
+
{
|
| 250 |
+
NVTX_ERR("Failed to load injection library\n");
|
| 251 |
+
return NVTX_ERR_INIT_LOAD_LIBRARY;
|
| 252 |
+
}
|
| 253 |
+
else
|
| 254 |
+
{
|
| 255 |
+
/* Attempt to get the injection library's entry-point */
|
| 256 |
+
init_fnptr = (NvtxInitializeInjectionNvtxFunc_t)NVTX_DLLFUNC(injectionLibraryHandle, initFuncName);
|
| 257 |
+
if (!init_fnptr)
|
| 258 |
+
{
|
| 259 |
+
NVTX_DLLCLOSE(injectionLibraryHandle);
|
| 260 |
+
NVTX_ERR("Failed to get address of function InitializeInjectionNvtx2 from injection library\n");
|
| 261 |
+
return NVTX_ERR_INIT_MISSING_LIBRARY_ENTRY_POINT;
|
| 262 |
+
}
|
| 263 |
+
}
|
| 264 |
+
}
|
| 265 |
+
}
|
| 266 |
+
#endif
|
| 267 |
+
|
| 268 |
+
#if NVTX_SUPPORT_STATIC_INJECTION_LIBRARY
|
| 269 |
+
if (!init_fnptr)
|
| 270 |
+
{
|
| 271 |
+
/* Check weakly-defined function pointer. A statically-linked injection can define this as
|
| 272 |
+
* a normal symbol and it will take precedence over a dynamic injection. */
|
| 273 |
+
if (InitializeInjectionNvtx2_fnptr)
|
| 274 |
+
{
|
| 275 |
+
init_fnptr = InitializeInjectionNvtx2_fnptr;
|
| 276 |
+
}
|
| 277 |
+
}
|
| 278 |
+
#endif
|
| 279 |
+
|
| 280 |
+
/* At this point, if init_fnptr is not set, then no tool has specified
|
| 281 |
+
* an NVTX injection library -- return non-success result so all NVTX
|
| 282 |
+
* API functions will be set to no-ops. */
|
| 283 |
+
if (!init_fnptr)
|
| 284 |
+
{
|
| 285 |
+
return NVTX_ERR_NO_INJECTION_LIBRARY_AVAILABLE;
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
/* Invoke injection library's initialization function. If it returns
|
| 289 |
+
* 0 (failure) and a dynamic injection was loaded, unload it. */
|
| 290 |
+
entryPointStatus = init_fnptr(NVTX_VERSIONED_IDENTIFIER(nvtxGetExportTable));
|
| 291 |
+
if (entryPointStatus == 0)
|
| 292 |
+
{
|
| 293 |
+
NVTX_ERR("Failed to initialize injection library -- initialization function returned 0\n");
|
| 294 |
+
if (injectionLibraryHandle)
|
| 295 |
+
{
|
| 296 |
+
NVTX_DLLCLOSE(injectionLibraryHandle);
|
| 297 |
+
}
|
| 298 |
+
return NVTX_ERR_INIT_FAILED_LIBRARY_ENTRY_POINT;
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
return NVTX_SUCCESS;
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(void)
|
| 305 |
+
{
|
| 306 |
+
unsigned int old;
|
| 307 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).initState == NVTX_INIT_STATE_COMPLETE)
|
| 308 |
+
{
|
| 309 |
+
return;
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
NVTX_ATOMIC_CAS_32(
|
| 313 |
+
old,
|
| 314 |
+
&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).initState,
|
| 315 |
+
NVTX_INIT_STATE_STARTED,
|
| 316 |
+
NVTX_INIT_STATE_FRESH);
|
| 317 |
+
if (old == NVTX_INIT_STATE_FRESH)
|
| 318 |
+
{
|
| 319 |
+
int result;
|
| 320 |
+
int forceAllToNoops;
|
| 321 |
+
|
| 322 |
+
/* Load & initialize injection library -- it will assign the function pointers */
|
| 323 |
+
result = NVTX_VERSIONED_IDENTIFIER(nvtxInitializeInjectionLibrary)();
|
| 324 |
+
|
| 325 |
+
/* Set all pointers not assigned by the injection to null */
|
| 326 |
+
forceAllToNoops = result != NVTX_SUCCESS; /* Set all to null if injection init failed */
|
| 327 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxSetInitFunctionsToNoops)(forceAllToNoops);
|
| 328 |
+
|
| 329 |
+
/* Signal that initialization has finished, so now the assigned function pointers will be used */
|
| 330 |
+
NVTX_ATOMIC_WRITE_32(
|
| 331 |
+
&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).initState,
|
| 332 |
+
NVTX_INIT_STATE_COMPLETE);
|
| 333 |
+
}
|
| 334 |
+
else /* Spin-wait until initialization has finished */
|
| 335 |
+
{
|
| 336 |
+
NVTX_MEMBAR();
|
| 337 |
+
while (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).initState != NVTX_INIT_STATE_COMPLETE)
|
| 338 |
+
{
|
| 339 |
+
NVTX_YIELD();
|
| 340 |
+
NVTX_MEMBAR();
|
| 341 |
+
}
|
| 342 |
+
}
|
| 343 |
+
}
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxInitDefs.h
ADDED
|
@@ -0,0 +1,565 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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TX_NO_IMPL is defined).
|
| 3 |
+
#endif
|
| 4 |
+
|
| 5 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxMarkEx_impl_init)(const nvtxEventAttributes_t* eventAttrib){
|
| 6 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 7 |
+
nvtxMarkEx(eventAttrib);
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxMarkA_impl_init)(const char* message){
|
| 11 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 12 |
+
nvtxMarkA(message);
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxMarkW_impl_init)(const wchar_t* message){
|
| 16 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 17 |
+
nvtxMarkW(message);
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
NVTX_LINKONCE_DEFINE_FUNCTION nvtxRangeId_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartEx_impl_init)(const nvtxEventAttributes_t* eventAttrib){
|
| 21 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 22 |
+
return nvtxRangeStartEx(eventAttrib);
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
NVTX_LINKONCE_DEFINE_FUNCTION nvtxRangeId_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartA_impl_init)(const char* message){
|
| 26 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 27 |
+
return nvtxRangeStartA(message);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
NVTX_LINKONCE_DEFINE_FUNCTION nvtxRangeId_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartW_impl_init)(const wchar_t* message){
|
| 31 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 32 |
+
return nvtxRangeStartW(message);
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangeEnd_impl_init)(nvtxRangeId_t id){
|
| 36 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 37 |
+
nvtxRangeEnd(id);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangePushEx_impl_init)(const nvtxEventAttributes_t* eventAttrib){
|
| 41 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 42 |
+
return nvtxRangePushEx(eventAttrib);
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangePushA_impl_init)(const char* message){
|
| 46 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 47 |
+
return nvtxRangePushA(message);
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangePushW_impl_init)(const wchar_t* message){
|
| 51 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 52 |
+
return nvtxRangePushW(message);
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangePop_impl_init)(void){
|
| 56 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 57 |
+
return nvtxRangePop();
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryA_impl_init)(uint32_t category, const char* name){
|
| 61 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 62 |
+
nvtxNameCategoryA(category, name);
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryW_impl_init)(uint32_t category, const wchar_t* name){
|
| 66 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 67 |
+
nvtxNameCategoryW(category, name);
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadA_impl_init)(uint32_t threadId, const char* name){
|
| 71 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 72 |
+
nvtxNameOsThreadA(threadId, name);
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadW_impl_init)(uint32_t threadId, const wchar_t* name){
|
| 76 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 77 |
+
nvtxNameOsThreadW(threadId, name);
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainMarkEx_impl_init)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib){
|
| 81 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 82 |
+
nvtxDomainMarkEx(domain, eventAttrib);
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
NVTX_LINKONCE_DEFINE_FUNCTION nvtxRangeId_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeStartEx_impl_init)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib){
|
| 86 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 87 |
+
return nvtxDomainRangeStartEx(domain, eventAttrib);
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeEnd_impl_init)(nvtxDomainHandle_t domain, nvtxRangeId_t id){
|
| 91 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 92 |
+
nvtxDomainRangeEnd(domain, id);
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePushEx_impl_init)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib){
|
| 96 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 97 |
+
return nvtxDomainRangePushEx(domain, eventAttrib);
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePop_impl_init)(nvtxDomainHandle_t domain){
|
| 101 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 102 |
+
return nvtxDomainRangePop(domain);
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
NVTX_LINKONCE_DEFINE_FUNCTION nvtxResourceHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceCreate_impl_init)(nvtxDomainHandle_t domain, nvtxResourceAttributes_t* attribs){
|
| 106 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 107 |
+
return nvtxDomainResourceCreate(domain, attribs);
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceDestroy_impl_init)(nvtxResourceHandle_t resource){
|
| 111 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 112 |
+
nvtxDomainResourceDestroy(resource);
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryA_impl_init)(nvtxDomainHandle_t domain, uint32_t category, const char* name){
|
| 116 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 117 |
+
nvtxDomainNameCategoryA(domain, category, name);
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryW_impl_init)(nvtxDomainHandle_t domain, uint32_t category, const wchar_t* name){
|
| 121 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 122 |
+
nvtxDomainNameCategoryW(domain, category, name);
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
NVTX_LINKONCE_DEFINE_FUNCTION nvtxStringHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringA_impl_init)(nvtxDomainHandle_t domain, const char* string){
|
| 126 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 127 |
+
return nvtxDomainRegisterStringA(domain, string);
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
NVTX_LINKONCE_DEFINE_FUNCTION nvtxStringHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringW_impl_init)(nvtxDomainHandle_t domain, const wchar_t* string){
|
| 131 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 132 |
+
return nvtxDomainRegisterStringW(domain, string);
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
NVTX_LINKONCE_DEFINE_FUNCTION nvtxDomainHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateA_impl_init)(const char* message){
|
| 136 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 137 |
+
return nvtxDomainCreateA(message);
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
NVTX_LINKONCE_DEFINE_FUNCTION nvtxDomainHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateW_impl_init)(const wchar_t* message){
|
| 141 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 142 |
+
return nvtxDomainCreateW(message);
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainDestroy_impl_init)(nvtxDomainHandle_t domain){
|
| 146 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 147 |
+
nvtxDomainDestroy(domain);
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxInitialize_impl_init)(const void* reserved){
|
| 151 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 152 |
+
nvtxInitialize(reserved);
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceA_impl_init)(nvtx_CUdevice device, const char* name){
|
| 156 |
+
nvtxNameCuDeviceA_fakeimpl_fntype local;
|
| 157 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 158 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceA_impl_fnptr;
|
| 159 |
+
if (local)
|
| 160 |
+
local(device, name);
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceW_impl_init)(nvtx_CUdevice device, const wchar_t* name){
|
| 164 |
+
nvtxNameCuDeviceW_fakeimpl_fntype local;
|
| 165 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 166 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceW_impl_fnptr;
|
| 167 |
+
if (local)
|
| 168 |
+
local(device, name);
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextA_impl_init)(nvtx_CUcontext context, const char* name){
|
| 172 |
+
nvtxNameCuContextA_fakeimpl_fntype local;
|
| 173 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 174 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextA_impl_fnptr;
|
| 175 |
+
if (local)
|
| 176 |
+
local(context, name);
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextW_impl_init)(nvtx_CUcontext context, const wchar_t* name){
|
| 180 |
+
nvtxNameCuContextW_fakeimpl_fntype local;
|
| 181 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 182 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextW_impl_fnptr;
|
| 183 |
+
if (local)
|
| 184 |
+
local(context, name);
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamA_impl_init)(nvtx_CUstream stream, const char* name){
|
| 188 |
+
nvtxNameCuStreamA_fakeimpl_fntype local;
|
| 189 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 190 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamA_impl_fnptr;
|
| 191 |
+
if (local)
|
| 192 |
+
local(stream, name);
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamW_impl_init)(nvtx_CUstream stream, const wchar_t* name){
|
| 196 |
+
nvtxNameCuStreamW_fakeimpl_fntype local;
|
| 197 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 198 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamW_impl_fnptr;
|
| 199 |
+
if (local)
|
| 200 |
+
local(stream, name);
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventA_impl_init)(nvtx_CUevent event, const char* name){
|
| 204 |
+
nvtxNameCuEventA_fakeimpl_fntype local;
|
| 205 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 206 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventA_impl_fnptr;
|
| 207 |
+
if (local)
|
| 208 |
+
local(event, name);
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventW_impl_init)(nvtx_CUevent event, const wchar_t* name){
|
| 212 |
+
nvtxNameCuEventW_fakeimpl_fntype local;
|
| 213 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 214 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventW_impl_fnptr;
|
| 215 |
+
if (local)
|
| 216 |
+
local(event, name);
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceA_impl_init)(int device, const char* name){
|
| 220 |
+
nvtxNameCudaDeviceA_impl_fntype local;
|
| 221 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 222 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceA_impl_fnptr;
|
| 223 |
+
if (local)
|
| 224 |
+
local(device, name);
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceW_impl_init)(int device, const wchar_t* name){
|
| 228 |
+
nvtxNameCudaDeviceW_impl_fntype local;
|
| 229 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 230 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceW_impl_fnptr;
|
| 231 |
+
if (local)
|
| 232 |
+
local(device, name);
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamA_impl_init)(nvtx_cudaStream_t stream, const char* name){
|
| 236 |
+
nvtxNameCudaStreamA_fakeimpl_fntype local;
|
| 237 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 238 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamA_impl_fnptr;
|
| 239 |
+
if (local)
|
| 240 |
+
local(stream, name);
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamW_impl_init)(nvtx_cudaStream_t stream, const wchar_t* name){
|
| 244 |
+
nvtxNameCudaStreamW_fakeimpl_fntype local;
|
| 245 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 246 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamW_impl_fnptr;
|
| 247 |
+
if (local)
|
| 248 |
+
local(stream, name);
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventA_impl_init)(nvtx_cudaEvent_t event, const char* name){
|
| 252 |
+
nvtxNameCudaEventA_fakeimpl_fntype local;
|
| 253 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 254 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventA_impl_fnptr;
|
| 255 |
+
if (local)
|
| 256 |
+
local(event, name);
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventW_impl_init)(nvtx_cudaEvent_t event, const wchar_t* name){
|
| 260 |
+
nvtxNameCudaEventW_fakeimpl_fntype local;
|
| 261 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 262 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventW_impl_fnptr;
|
| 263 |
+
if (local)
|
| 264 |
+
local(event, name);
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceA_impl_init)(nvtx_cl_device_id device, const char* name){
|
| 268 |
+
nvtxNameClDeviceA_fakeimpl_fntype local;
|
| 269 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 270 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceA_impl_fnptr;
|
| 271 |
+
if (local)
|
| 272 |
+
local(device, name);
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceW_impl_init)(nvtx_cl_device_id device, const wchar_t* name){
|
| 276 |
+
nvtxNameClDeviceW_fakeimpl_fntype local;
|
| 277 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 278 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceW_impl_fnptr;
|
| 279 |
+
if (local)
|
| 280 |
+
local(device, name);
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextA_impl_init)(nvtx_cl_context context, const char* name){
|
| 284 |
+
nvtxNameClContextA_fakeimpl_fntype local;
|
| 285 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 286 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextA_impl_fnptr;
|
| 287 |
+
if (local)
|
| 288 |
+
local(context, name);
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextW_impl_init)(nvtx_cl_context context, const wchar_t* name){
|
| 292 |
+
nvtxNameClContextW_fakeimpl_fntype local;
|
| 293 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 294 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextW_impl_fnptr;
|
| 295 |
+
if (local)
|
| 296 |
+
local(context, name);
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueA_impl_init)(nvtx_cl_command_queue command_queue, const char* name){
|
| 300 |
+
nvtxNameClCommandQueueA_fakeimpl_fntype local;
|
| 301 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 302 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueA_impl_fnptr;
|
| 303 |
+
if (local)
|
| 304 |
+
local(command_queue, name);
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueW_impl_init)(nvtx_cl_command_queue command_queue, const wchar_t* name){
|
| 308 |
+
nvtxNameClCommandQueueW_fakeimpl_fntype local;
|
| 309 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 310 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueW_impl_fnptr;
|
| 311 |
+
if (local)
|
| 312 |
+
local(command_queue, name);
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectA_impl_init)(nvtx_cl_mem memobj, const char* name){
|
| 316 |
+
nvtxNameClMemObjectA_fakeimpl_fntype local;
|
| 317 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 318 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectA_impl_fnptr;
|
| 319 |
+
if (local)
|
| 320 |
+
local(memobj, name);
|
| 321 |
+
}
|
| 322 |
+
|
| 323 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectW_impl_init)(nvtx_cl_mem memobj, const wchar_t* name){
|
| 324 |
+
nvtxNameClMemObjectW_fakeimpl_fntype local;
|
| 325 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 326 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectW_impl_fnptr;
|
| 327 |
+
if (local)
|
| 328 |
+
local(memobj, name);
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerA_impl_init)(nvtx_cl_sampler sampler, const char* name){
|
| 332 |
+
nvtxNameClSamplerA_fakeimpl_fntype local;
|
| 333 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 334 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerA_impl_fnptr;
|
| 335 |
+
if (local)
|
| 336 |
+
local(sampler, name);
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerW_impl_init)(nvtx_cl_sampler sampler, const wchar_t* name){
|
| 340 |
+
nvtxNameClSamplerW_fakeimpl_fntype local;
|
| 341 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 342 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerW_impl_fnptr;
|
| 343 |
+
if (local)
|
| 344 |
+
local(sampler, name);
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramA_impl_init)(nvtx_cl_program program, const char* name){
|
| 348 |
+
nvtxNameClProgramA_fakeimpl_fntype local;
|
| 349 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 350 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramA_impl_fnptr;
|
| 351 |
+
if (local)
|
| 352 |
+
local(program, name);
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramW_impl_init)(nvtx_cl_program program, const wchar_t* name){
|
| 356 |
+
nvtxNameClProgramW_fakeimpl_fntype local;
|
| 357 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 358 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramW_impl_fnptr;
|
| 359 |
+
if (local)
|
| 360 |
+
local(program, name);
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventA_impl_init)(nvtx_cl_event evnt, const char* name){
|
| 364 |
+
nvtxNameClEventA_fakeimpl_fntype local;
|
| 365 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 366 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventA_impl_fnptr;
|
| 367 |
+
if (local)
|
| 368 |
+
local(evnt, name);
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventW_impl_init)(nvtx_cl_event evnt, const wchar_t* name){
|
| 372 |
+
nvtxNameClEventW_fakeimpl_fntype local;
|
| 373 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 374 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventW_impl_fnptr;
|
| 375 |
+
if (local)
|
| 376 |
+
local(evnt, name);
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
NVTX_LINKONCE_DEFINE_FUNCTION nvtxSyncUser_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserCreate_impl_init)(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t* attribs){
|
| 380 |
+
nvtxDomainSyncUserCreate_impl_fntype local;
|
| 381 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 382 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserCreate_impl_fnptr;
|
| 383 |
+
if (local) {
|
| 384 |
+
return local(domain, attribs);
|
| 385 |
+
}
|
| 386 |
+
return (nvtxSyncUser_t)0;
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserDestroy_impl_init)(nvtxSyncUser_t handle){
|
| 390 |
+
nvtxDomainSyncUserDestroy_impl_fntype local;
|
| 391 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 392 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserDestroy_impl_fnptr;
|
| 393 |
+
if (local)
|
| 394 |
+
local(handle);
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireStart_impl_init)(nvtxSyncUser_t handle){
|
| 398 |
+
nvtxDomainSyncUserAcquireStart_impl_fntype local;
|
| 399 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 400 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireStart_impl_fnptr;
|
| 401 |
+
if (local)
|
| 402 |
+
local(handle);
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireFailed_impl_init)(nvtxSyncUser_t handle){
|
| 406 |
+
nvtxDomainSyncUserAcquireFailed_impl_fntype local;
|
| 407 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 408 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireFailed_impl_fnptr;
|
| 409 |
+
if (local)
|
| 410 |
+
local(handle);
|
| 411 |
+
}
|
| 412 |
+
|
| 413 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireSuccess_impl_init)(nvtxSyncUser_t handle){
|
| 414 |
+
nvtxDomainSyncUserAcquireSuccess_impl_fntype local;
|
| 415 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 416 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireSuccess_impl_fnptr;
|
| 417 |
+
if (local)
|
| 418 |
+
local(handle);
|
| 419 |
+
}
|
| 420 |
+
|
| 421 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserReleasing_impl_init)(nvtxSyncUser_t handle){
|
| 422 |
+
nvtxDomainSyncUserReleasing_impl_fntype local;
|
| 423 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)();
|
| 424 |
+
local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserReleasing_impl_fnptr;
|
| 425 |
+
if (local)
|
| 426 |
+
local(handle);
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_VERSIONED_IDENTIFIER(nvtxSetInitFunctionsToNoops)(int forceAllToNoops);
|
| 430 |
+
NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_VERSIONED_IDENTIFIER(nvtxSetInitFunctionsToNoops)(int forceAllToNoops)
|
| 431 |
+
{
|
| 432 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkEx_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxMarkEx_impl_init) || forceAllToNoops)
|
| 433 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkEx_impl_fnptr = NULL;
|
| 434 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxMarkA_impl_init) || forceAllToNoops)
|
| 435 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkA_impl_fnptr = NULL;
|
| 436 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxMarkW_impl_init) || forceAllToNoops)
|
| 437 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkW_impl_fnptr = NULL;
|
| 438 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartEx_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartEx_impl_init) || forceAllToNoops)
|
| 439 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartEx_impl_fnptr = NULL;
|
| 440 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartA_impl_init) || forceAllToNoops)
|
| 441 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartA_impl_fnptr = NULL;
|
| 442 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartW_impl_init) || forceAllToNoops)
|
| 443 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartW_impl_fnptr = NULL;
|
| 444 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeEnd_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangeEnd_impl_init) || forceAllToNoops)
|
| 445 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeEnd_impl_fnptr = NULL;
|
| 446 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushEx_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangePushEx_impl_init) || forceAllToNoops)
|
| 447 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushEx_impl_fnptr = NULL;
|
| 448 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangePushA_impl_init) || forceAllToNoops)
|
| 449 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushA_impl_fnptr = NULL;
|
| 450 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangePushW_impl_init) || forceAllToNoops)
|
| 451 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushW_impl_fnptr = NULL;
|
| 452 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePop_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangePop_impl_init) || forceAllToNoops)
|
| 453 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePop_impl_fnptr = NULL;
|
| 454 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryA_impl_init) || forceAllToNoops)
|
| 455 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryA_impl_fnptr = NULL;
|
| 456 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryW_impl_init) || forceAllToNoops)
|
| 457 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryW_impl_fnptr = NULL;
|
| 458 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadA_impl_init) || forceAllToNoops)
|
| 459 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadA_impl_fnptr = NULL;
|
| 460 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadW_impl_init) || forceAllToNoops)
|
| 461 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadW_impl_fnptr = NULL;
|
| 462 |
+
|
| 463 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceA_impl_init) || forceAllToNoops)
|
| 464 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceA_impl_fnptr = NULL;
|
| 465 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceW_impl_init) || forceAllToNoops)
|
| 466 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceW_impl_fnptr = NULL;
|
| 467 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextA_impl_init) || forceAllToNoops)
|
| 468 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextA_impl_fnptr = NULL;
|
| 469 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextW_impl_init) || forceAllToNoops)
|
| 470 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextW_impl_fnptr = NULL;
|
| 471 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamA_impl_init) || forceAllToNoops)
|
| 472 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamA_impl_fnptr = NULL;
|
| 473 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamW_impl_init) || forceAllToNoops)
|
| 474 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamW_impl_fnptr = NULL;
|
| 475 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventA_impl_init) || forceAllToNoops)
|
| 476 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventA_impl_fnptr = NULL;
|
| 477 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventW_impl_init) || forceAllToNoops)
|
| 478 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventW_impl_fnptr = NULL;
|
| 479 |
+
|
| 480 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceA_impl_init) || forceAllToNoops)
|
| 481 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceA_impl_fnptr = NULL;
|
| 482 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceW_impl_init) || forceAllToNoops)
|
| 483 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceW_impl_fnptr = NULL;
|
| 484 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextA_impl_init) || forceAllToNoops)
|
| 485 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextA_impl_fnptr = NULL;
|
| 486 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextW_impl_init) || forceAllToNoops)
|
| 487 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextW_impl_fnptr = NULL;
|
| 488 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueA_impl_init) || forceAllToNoops)
|
| 489 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueA_impl_fnptr = NULL;
|
| 490 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueW_impl_init) || forceAllToNoops)
|
| 491 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueW_impl_fnptr = NULL;
|
| 492 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectA_impl_init) || forceAllToNoops)
|
| 493 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectA_impl_fnptr = NULL;
|
| 494 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectW_impl_init) || forceAllToNoops)
|
| 495 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectW_impl_fnptr = NULL;
|
| 496 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerA_impl_init) || forceAllToNoops)
|
| 497 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerA_impl_fnptr = NULL;
|
| 498 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerW_impl_init) || forceAllToNoops)
|
| 499 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerW_impl_fnptr = NULL;
|
| 500 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramA_impl_init) || forceAllToNoops)
|
| 501 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramA_impl_fnptr = NULL;
|
| 502 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramW_impl_init) || forceAllToNoops)
|
| 503 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramW_impl_fnptr = NULL;
|
| 504 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventA_impl_init) || forceAllToNoops)
|
| 505 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventA_impl_fnptr = NULL;
|
| 506 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventW_impl_init) || forceAllToNoops)
|
| 507 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventW_impl_fnptr = NULL;
|
| 508 |
+
|
| 509 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceA_impl_init) || forceAllToNoops)
|
| 510 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceA_impl_fnptr = NULL;
|
| 511 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceW_impl_init) || forceAllToNoops)
|
| 512 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceW_impl_fnptr = NULL;
|
| 513 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamA_impl_init) || forceAllToNoops)
|
| 514 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamA_impl_fnptr = NULL;
|
| 515 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamW_impl_init) || forceAllToNoops)
|
| 516 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamW_impl_fnptr = NULL;
|
| 517 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventA_impl_init) || forceAllToNoops)
|
| 518 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventA_impl_fnptr = NULL;
|
| 519 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventW_impl_init) || forceAllToNoops)
|
| 520 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventW_impl_fnptr = NULL;
|
| 521 |
+
|
| 522 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainMarkEx_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainMarkEx_impl_init) || forceAllToNoops)
|
| 523 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainMarkEx_impl_fnptr = NULL;
|
| 524 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeStartEx_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeStartEx_impl_init) || forceAllToNoops)
|
| 525 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeStartEx_impl_fnptr = NULL;
|
| 526 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeEnd_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeEnd_impl_init) || forceAllToNoops)
|
| 527 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeEnd_impl_fnptr = NULL;
|
| 528 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePushEx_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePushEx_impl_init) || forceAllToNoops)
|
| 529 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePushEx_impl_fnptr = NULL;
|
| 530 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePop_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePop_impl_init) || forceAllToNoops)
|
| 531 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePop_impl_fnptr = NULL;
|
| 532 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceCreate_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceCreate_impl_init) || forceAllToNoops)
|
| 533 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceCreate_impl_fnptr = NULL;
|
| 534 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceDestroy_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceDestroy_impl_init) || forceAllToNoops)
|
| 535 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceDestroy_impl_fnptr = NULL;
|
| 536 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryA_impl_init) || forceAllToNoops)
|
| 537 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryA_impl_fnptr = NULL;
|
| 538 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryW_impl_init) || forceAllToNoops)
|
| 539 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryW_impl_fnptr = NULL;
|
| 540 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringA_impl_init) || forceAllToNoops)
|
| 541 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringA_impl_fnptr = NULL;
|
| 542 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringW_impl_init) || forceAllToNoops)
|
| 543 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringW_impl_fnptr = NULL;
|
| 544 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateA_impl_init) || forceAllToNoops)
|
| 545 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateA_impl_fnptr = NULL;
|
| 546 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateW_impl_init) || forceAllToNoops)
|
| 547 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateW_impl_fnptr = NULL;
|
| 548 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainDestroy_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainDestroy_impl_init) || forceAllToNoops)
|
| 549 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainDestroy_impl_fnptr = NULL;
|
| 550 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxInitialize_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxInitialize_impl_init) || forceAllToNoops)
|
| 551 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxInitialize_impl_fnptr = NULL;
|
| 552 |
+
|
| 553 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserCreate_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserCreate_impl_init) || forceAllToNoops)
|
| 554 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserCreate_impl_fnptr = NULL;
|
| 555 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserDestroy_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserDestroy_impl_init) || forceAllToNoops)
|
| 556 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserDestroy_impl_fnptr = NULL;
|
| 557 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireStart_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireStart_impl_init) || forceAllToNoops)
|
| 558 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireStart_impl_fnptr = NULL;
|
| 559 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireFailed_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireFailed_impl_init) || forceAllToNoops)
|
| 560 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireFailed_impl_fnptr = NULL;
|
| 561 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireSuccess_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireSuccess_impl_init) || forceAllToNoops)
|
| 562 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireSuccess_impl_fnptr = NULL;
|
| 563 |
+
if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserReleasing_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserReleasing_impl_init) || forceAllToNoops)
|
| 564 |
+
NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserReleasing_impl_fnptr = NULL;
|
| 565 |
+
}
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxLinkOnce.h
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef __NVTX_LINKONCE_H__
|
| 2 |
+
#define __NVTX_LINKONCE_H__
|
| 3 |
+
|
| 4 |
+
/* This header defines macros to permit making definitions of global variables
|
| 5 |
+
* and functions in C/C++ header files which may be included multiple times in
|
| 6 |
+
* a translation unit or linkage unit. It allows authoring header-only libraries
|
| 7 |
+
* which can be used by multiple other header-only libraries (either as the same
|
| 8 |
+
* copy or multiple copies), and does not require any build changes, such as
|
| 9 |
+
* adding another .c file, linking a static library, or deploying a dynamic
|
| 10 |
+
* library. Globals defined with these macros have the property that they have
|
| 11 |
+
* the same address, pointing to a single instance, for the entire linkage unit.
|
| 12 |
+
* It is expected but not guaranteed that each linkage unit will have a separate
|
| 13 |
+
* instance.
|
| 14 |
+
*
|
| 15 |
+
* In some situations it is desirable to declare a variable without initializing
|
| 16 |
+
* it, refer to it in code or other variables' initializers, and then initialize
|
| 17 |
+
* it later. Similarly, functions can be prototyped, have their address taken,
|
| 18 |
+
* and then have their body defined later. In such cases, use the FWDDECL macros
|
| 19 |
+
* when forward-declaring LINKONCE global variables without initializers and
|
| 20 |
+
* function prototypes, and then use the DEFINE macros when later defining them.
|
| 21 |
+
* Although in many cases the FWDDECL macro is equivalent to the DEFINE macro,
|
| 22 |
+
* following this pattern makes code maximally portable.
|
| 23 |
+
*/
|
| 24 |
+
|
| 25 |
+
#if defined(__MINGW32__) /* MinGW */
|
| 26 |
+
#define NVTX_LINKONCE_WEAK __attribute__((section(".gnu.linkonce.0.")))
|
| 27 |
+
#if defined(__cplusplus)
|
| 28 |
+
#define NVTX_LINKONCE_DEFINE_GLOBAL __declspec(selectany)
|
| 29 |
+
#define NVTX_LINKONCE_DEFINE_FUNCTION extern "C" inline NVTX_LINKONCE_WEAK
|
| 30 |
+
#else
|
| 31 |
+
#define NVTX_LINKONCE_DEFINE_GLOBAL __declspec(selectany)
|
| 32 |
+
#define NVTX_LINKONCE_DEFINE_FUNCTION NVTX_LINKONCE_WEAK
|
| 33 |
+
#endif
|
| 34 |
+
#elif defined(_MSC_VER) /* MSVC */
|
| 35 |
+
#if defined(__cplusplus)
|
| 36 |
+
#define NVTX_LINKONCE_DEFINE_GLOBAL extern "C" __declspec(selectany)
|
| 37 |
+
#define NVTX_LINKONCE_DEFINE_FUNCTION extern "C" inline
|
| 38 |
+
#else
|
| 39 |
+
#define NVTX_LINKONCE_DEFINE_GLOBAL __declspec(selectany)
|
| 40 |
+
#define NVTX_LINKONCE_DEFINE_FUNCTION __inline
|
| 41 |
+
#endif
|
| 42 |
+
#elif defined(__CYGWIN__) && defined(__clang__) /* Clang on Cygwin */
|
| 43 |
+
#define NVTX_LINKONCE_WEAK __attribute__((section(".gnu.linkonce.0.")))
|
| 44 |
+
#if defined(__cplusplus)
|
| 45 |
+
#define NVTX_LINKONCE_DEFINE_GLOBAL NVTX_LINKONCE_WEAK
|
| 46 |
+
#define NVTX_LINKONCE_DEFINE_FUNCTION extern "C" NVTX_LINKONCE_WEAK
|
| 47 |
+
#else
|
| 48 |
+
#define NVTX_LINKONCE_DEFINE_GLOBAL NVTX_LINKONCE_WEAK
|
| 49 |
+
#define NVTX_LINKONCE_DEFINE_FUNCTION NVTX_LINKONCE_WEAK
|
| 50 |
+
#endif
|
| 51 |
+
#elif defined(__CYGWIN__) /* Assume GCC or compatible */
|
| 52 |
+
#define NVTX_LINKONCE_WEAK __attribute__((weak))
|
| 53 |
+
#if defined(__cplusplus)
|
| 54 |
+
#define NVTX_LINKONCE_DEFINE_GLOBAL __declspec(selectany)
|
| 55 |
+
#define NVTX_LINKONCE_DEFINE_FUNCTION extern "C" inline
|
| 56 |
+
#else
|
| 57 |
+
#define NVTX_LINKONCE_DEFINE_GLOBAL NVTX_LINKONCE_WEAK
|
| 58 |
+
#define NVTX_LINKONCE_DEFINE_FUNCTION NVTX_LINKONCE_WEAK
|
| 59 |
+
#endif
|
| 60 |
+
#else /* All others: Assume GCC, clang, or compatible */
|
| 61 |
+
#define NVTX_LINKONCE_WEAK __attribute__((weak))
|
| 62 |
+
#define NVTX_LINKONCE_HIDDEN __attribute__((visibility("hidden")))
|
| 63 |
+
#if defined(__cplusplus)
|
| 64 |
+
#define NVTX_LINKONCE_DEFINE_GLOBAL NVTX_LINKONCE_HIDDEN NVTX_LINKONCE_WEAK
|
| 65 |
+
#define NVTX_LINKONCE_DEFINE_FUNCTION extern "C" NVTX_LINKONCE_HIDDEN inline
|
| 66 |
+
#else
|
| 67 |
+
#define NVTX_LINKONCE_DEFINE_GLOBAL NVTX_LINKONCE_HIDDEN NVTX_LINKONCE_WEAK
|
| 68 |
+
#define NVTX_LINKONCE_DEFINE_FUNCTION NVTX_LINKONCE_HIDDEN NVTX_LINKONCE_WEAK
|
| 69 |
+
#endif
|
| 70 |
+
#endif
|
| 71 |
+
|
| 72 |
+
#define NVTX_LINKONCE_FWDDECL_GLOBAL NVTX_LINKONCE_DEFINE_GLOBAL extern
|
| 73 |
+
#define NVTX_LINKONCE_FWDDECL_FUNCTION NVTX_LINKONCE_DEFINE_FUNCTION
|
| 74 |
+
|
| 75 |
+
#endif /* __NVTX_LINKONCE_H__ */
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/include/nvtx3/nvtxDetail/nvtxTypes.h
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2009-2016 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO USER:
|
| 5 |
+
*
|
| 6 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 11 |
+
* of a form of NVIDIA software license agreement.
|
| 12 |
+
*
|
| 13 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 14 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 15 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 16 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 17 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 18 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 19 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 20 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 21 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 22 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 23 |
+
*
|
| 24 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 25 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 26 |
+
* "commercial computer software" and "commercial computer software
|
| 27 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 28 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 29 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 30 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 31 |
+
* source code with only those rights set forth herein.
|
| 32 |
+
*
|
| 33 |
+
* Any use of this source code in individual and commercial software must
|
| 34 |
+
* include, in the user documentation and internal comments to the code,
|
| 35 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
/* This header defines types which are used by the internal implementation
|
| 39 |
+
* of NVTX and callback subscribers. API clients do not use these types,
|
| 40 |
+
* so they are defined here instead of in nvToolsExt.h to clarify they are
|
| 41 |
+
* not part of the NVTX client API. */
|
| 42 |
+
|
| 43 |
+
#ifndef NVTX_IMPL_GUARD
|
| 44 |
+
#error Never include this file directly -- it is automatically included by nvToolsExt.h.
|
| 45 |
+
#endif
|
| 46 |
+
|
| 47 |
+
/* ------ Dependency-free types binary-compatible with real types ------- */
|
| 48 |
+
|
| 49 |
+
/* In order to avoid having the NVTX core API headers depend on non-NVTX
|
| 50 |
+
* headers like cuda.h, NVTX defines binary-compatible types to use for
|
| 51 |
+
* safely making the initialization versions of all NVTX functions without
|
| 52 |
+
* needing to have definitions for the real types. */
|
| 53 |
+
|
| 54 |
+
typedef int nvtx_CUdevice;
|
| 55 |
+
typedef void* nvtx_CUcontext;
|
| 56 |
+
typedef void* nvtx_CUstream;
|
| 57 |
+
typedef void* nvtx_CUevent;
|
| 58 |
+
|
| 59 |
+
typedef void* nvtx_cudaStream_t;
|
| 60 |
+
typedef void* nvtx_cudaEvent_t;
|
| 61 |
+
|
| 62 |
+
typedef void* nvtx_cl_platform_id;
|
| 63 |
+
typedef void* nvtx_cl_device_id;
|
| 64 |
+
typedef void* nvtx_cl_context;
|
| 65 |
+
typedef void* nvtx_cl_command_queue;
|
| 66 |
+
typedef void* nvtx_cl_mem;
|
| 67 |
+
typedef void* nvtx_cl_program;
|
| 68 |
+
typedef void* nvtx_cl_kernel;
|
| 69 |
+
typedef void* nvtx_cl_event;
|
| 70 |
+
typedef void* nvtx_cl_sampler;
|
| 71 |
+
|
| 72 |
+
typedef struct nvtxSyncUser* nvtxSyncUser_t;
|
| 73 |
+
struct nvtxSyncUserAttributes_v0;
|
| 74 |
+
typedef struct nvtxSyncUserAttributes_v0 nvtxSyncUserAttributes_t;
|
| 75 |
+
|
| 76 |
+
/* --------- Types for function pointers (with fake API types) ---------- */
|
| 77 |
+
|
| 78 |
+
typedef void (NVTX_API * nvtxMarkEx_impl_fntype)(const nvtxEventAttributes_t* eventAttrib);
|
| 79 |
+
typedef void (NVTX_API * nvtxMarkA_impl_fntype)(const char* message);
|
| 80 |
+
typedef void (NVTX_API * nvtxMarkW_impl_fntype)(const wchar_t* message);
|
| 81 |
+
typedef nvtxRangeId_t (NVTX_API * nvtxRangeStartEx_impl_fntype)(const nvtxEventAttributes_t* eventAttrib);
|
| 82 |
+
typedef nvtxRangeId_t (NVTX_API * nvtxRangeStartA_impl_fntype)(const char* message);
|
| 83 |
+
typedef nvtxRangeId_t (NVTX_API * nvtxRangeStartW_impl_fntype)(const wchar_t* message);
|
| 84 |
+
typedef void (NVTX_API * nvtxRangeEnd_impl_fntype)(nvtxRangeId_t id);
|
| 85 |
+
typedef int (NVTX_API * nvtxRangePushEx_impl_fntype)(const nvtxEventAttributes_t* eventAttrib);
|
| 86 |
+
typedef int (NVTX_API * nvtxRangePushA_impl_fntype)(const char* message);
|
| 87 |
+
typedef int (NVTX_API * nvtxRangePushW_impl_fntype)(const wchar_t* message);
|
| 88 |
+
typedef int (NVTX_API * nvtxRangePop_impl_fntype)(void);
|
| 89 |
+
typedef void (NVTX_API * nvtxNameCategoryA_impl_fntype)(uint32_t category, const char* name);
|
| 90 |
+
typedef void (NVTX_API * nvtxNameCategoryW_impl_fntype)(uint32_t category, const wchar_t* name);
|
| 91 |
+
typedef void (NVTX_API * nvtxNameOsThreadA_impl_fntype)(uint32_t threadId, const char* name);
|
| 92 |
+
typedef void (NVTX_API * nvtxNameOsThreadW_impl_fntype)(uint32_t threadId, const wchar_t* name);
|
| 93 |
+
|
| 94 |
+
/* Real impl types are defined in nvtxImplCuda_v3.h, where CUDA headers are included */
|
| 95 |
+
typedef void (NVTX_API * nvtxNameCuDeviceA_fakeimpl_fntype)(nvtx_CUdevice device, const char* name);
|
| 96 |
+
typedef void (NVTX_API * nvtxNameCuDeviceW_fakeimpl_fntype)(nvtx_CUdevice device, const wchar_t* name);
|
| 97 |
+
typedef void (NVTX_API * nvtxNameCuContextA_fakeimpl_fntype)(nvtx_CUcontext context, const char* name);
|
| 98 |
+
typedef void (NVTX_API * nvtxNameCuContextW_fakeimpl_fntype)(nvtx_CUcontext context, const wchar_t* name);
|
| 99 |
+
typedef void (NVTX_API * nvtxNameCuStreamA_fakeimpl_fntype)(nvtx_CUstream stream, const char* name);
|
| 100 |
+
typedef void (NVTX_API * nvtxNameCuStreamW_fakeimpl_fntype)(nvtx_CUstream stream, const wchar_t* name);
|
| 101 |
+
typedef void (NVTX_API * nvtxNameCuEventA_fakeimpl_fntype)(nvtx_CUevent event, const char* name);
|
| 102 |
+
typedef void (NVTX_API * nvtxNameCuEventW_fakeimpl_fntype)(nvtx_CUevent event, const wchar_t* name);
|
| 103 |
+
|
| 104 |
+
/* Real impl types are defined in nvtxImplOpenCL_v3.h, where OPENCL headers are included */
|
| 105 |
+
typedef void (NVTX_API * nvtxNameClDeviceA_fakeimpl_fntype)(nvtx_cl_device_id device, const char* name);
|
| 106 |
+
typedef void (NVTX_API * nvtxNameClDeviceW_fakeimpl_fntype)(nvtx_cl_device_id device, const wchar_t* name);
|
| 107 |
+
typedef void (NVTX_API * nvtxNameClContextA_fakeimpl_fntype)(nvtx_cl_context context, const char* name);
|
| 108 |
+
typedef void (NVTX_API * nvtxNameClContextW_fakeimpl_fntype)(nvtx_cl_context context, const wchar_t* name);
|
| 109 |
+
typedef void (NVTX_API * nvtxNameClCommandQueueA_fakeimpl_fntype)(nvtx_cl_command_queue command_queue, const char* name);
|
| 110 |
+
typedef void (NVTX_API * nvtxNameClCommandQueueW_fakeimpl_fntype)(nvtx_cl_command_queue command_queue, const wchar_t* name);
|
| 111 |
+
typedef void (NVTX_API * nvtxNameClMemObjectA_fakeimpl_fntype)(nvtx_cl_mem memobj, const char* name);
|
| 112 |
+
typedef void (NVTX_API * nvtxNameClMemObjectW_fakeimpl_fntype)(nvtx_cl_mem memobj, const wchar_t* name);
|
| 113 |
+
typedef void (NVTX_API * nvtxNameClSamplerA_fakeimpl_fntype)(nvtx_cl_sampler sampler, const char* name);
|
| 114 |
+
typedef void (NVTX_API * nvtxNameClSamplerW_fakeimpl_fntype)(nvtx_cl_sampler sampler, const wchar_t* name);
|
| 115 |
+
typedef void (NVTX_API * nvtxNameClProgramA_fakeimpl_fntype)(nvtx_cl_program program, const char* name);
|
| 116 |
+
typedef void (NVTX_API * nvtxNameClProgramW_fakeimpl_fntype)(nvtx_cl_program program, const wchar_t* name);
|
| 117 |
+
typedef void (NVTX_API * nvtxNameClEventA_fakeimpl_fntype)(nvtx_cl_event evnt, const char* name);
|
| 118 |
+
typedef void (NVTX_API * nvtxNameClEventW_fakeimpl_fntype)(nvtx_cl_event evnt, const wchar_t* name);
|
| 119 |
+
|
| 120 |
+
/* Real impl types are defined in nvtxImplCudaRt_v3.h, where CUDART headers are included */
|
| 121 |
+
typedef void (NVTX_API * nvtxNameCudaDeviceA_impl_fntype)(int device, const char* name);
|
| 122 |
+
typedef void (NVTX_API * nvtxNameCudaDeviceW_impl_fntype)(int device, const wchar_t* name);
|
| 123 |
+
typedef void (NVTX_API * nvtxNameCudaStreamA_fakeimpl_fntype)(nvtx_cudaStream_t stream, const char* name);
|
| 124 |
+
typedef void (NVTX_API * nvtxNameCudaStreamW_fakeimpl_fntype)(nvtx_cudaStream_t stream, const wchar_t* name);
|
| 125 |
+
typedef void (NVTX_API * nvtxNameCudaEventA_fakeimpl_fntype)(nvtx_cudaEvent_t event, const char* name);
|
| 126 |
+
typedef void (NVTX_API * nvtxNameCudaEventW_fakeimpl_fntype)(nvtx_cudaEvent_t event, const wchar_t* name);
|
| 127 |
+
|
| 128 |
+
typedef void (NVTX_API * nvtxDomainMarkEx_impl_fntype)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib);
|
| 129 |
+
typedef nvtxRangeId_t (NVTX_API * nvtxDomainRangeStartEx_impl_fntype)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib);
|
| 130 |
+
typedef void (NVTX_API * nvtxDomainRangeEnd_impl_fntype)(nvtxDomainHandle_t domain, nvtxRangeId_t id);
|
| 131 |
+
typedef int (NVTX_API * nvtxDomainRangePushEx_impl_fntype)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib);
|
| 132 |
+
typedef int (NVTX_API * nvtxDomainRangePop_impl_fntype)(nvtxDomainHandle_t domain);
|
| 133 |
+
typedef nvtxResourceHandle_t (NVTX_API * nvtxDomainResourceCreate_impl_fntype)(nvtxDomainHandle_t domain, nvtxResourceAttributes_t* attribs);
|
| 134 |
+
typedef void (NVTX_API * nvtxDomainResourceDestroy_impl_fntype)(nvtxResourceHandle_t resource);
|
| 135 |
+
typedef void (NVTX_API * nvtxDomainNameCategoryA_impl_fntype)(nvtxDomainHandle_t domain, uint32_t category, const char* name);
|
| 136 |
+
typedef void (NVTX_API * nvtxDomainNameCategoryW_impl_fntype)(nvtxDomainHandle_t domain, uint32_t category, const wchar_t* name);
|
| 137 |
+
typedef nvtxStringHandle_t (NVTX_API * nvtxDomainRegisterStringA_impl_fntype)(nvtxDomainHandle_t domain, const char* string);
|
| 138 |
+
typedef nvtxStringHandle_t (NVTX_API * nvtxDomainRegisterStringW_impl_fntype)(nvtxDomainHandle_t domain, const wchar_t* string);
|
| 139 |
+
typedef nvtxDomainHandle_t (NVTX_API * nvtxDomainCreateA_impl_fntype)(const char* message);
|
| 140 |
+
typedef nvtxDomainHandle_t (NVTX_API * nvtxDomainCreateW_impl_fntype)(const wchar_t* message);
|
| 141 |
+
typedef void (NVTX_API * nvtxDomainDestroy_impl_fntype)(nvtxDomainHandle_t domain);
|
| 142 |
+
typedef void (NVTX_API * nvtxInitialize_impl_fntype)(const void* reserved);
|
| 143 |
+
|
| 144 |
+
typedef nvtxSyncUser_t (NVTX_API * nvtxDomainSyncUserCreate_impl_fntype)(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t* attribs);
|
| 145 |
+
typedef void (NVTX_API * nvtxDomainSyncUserDestroy_impl_fntype)(nvtxSyncUser_t handle);
|
| 146 |
+
typedef void (NVTX_API * nvtxDomainSyncUserAcquireStart_impl_fntype)(nvtxSyncUser_t handle);
|
| 147 |
+
typedef void (NVTX_API * nvtxDomainSyncUserAcquireFailed_impl_fntype)(nvtxSyncUser_t handle);
|
| 148 |
+
typedef void (NVTX_API * nvtxDomainSyncUserAcquireSuccess_impl_fntype)(nvtxSyncUser_t handle);
|
| 149 |
+
typedef void (NVTX_API * nvtxDomainSyncUserReleasing_impl_fntype)(nvtxSyncUser_t handle);
|
| 150 |
+
|
| 151 |
+
/* ---------------- Types for callback subscription --------------------- */
|
| 152 |
+
|
| 153 |
+
typedef const void *(NVTX_API * NvtxGetExportTableFunc_t)(uint32_t exportTableId);
|
| 154 |
+
typedef int (NVTX_API * NvtxInitializeInjectionNvtxFunc_t)(NvtxGetExportTableFunc_t exportTable);
|
| 155 |
+
|
| 156 |
+
typedef enum NvtxCallbackModule
|
| 157 |
+
{
|
| 158 |
+
NVTX_CB_MODULE_INVALID = 0,
|
| 159 |
+
NVTX_CB_MODULE_CORE = 1,
|
| 160 |
+
NVTX_CB_MODULE_CUDA = 2,
|
| 161 |
+
NVTX_CB_MODULE_OPENCL = 3,
|
| 162 |
+
NVTX_CB_MODULE_CUDART = 4,
|
| 163 |
+
NVTX_CB_MODULE_CORE2 = 5,
|
| 164 |
+
NVTX_CB_MODULE_SYNC = 6,
|
| 165 |
+
/* --- New constants must only be added directly above this line --- */
|
| 166 |
+
NVTX_CB_MODULE_SIZE,
|
| 167 |
+
NVTX_CB_MODULE_FORCE_INT = 0x7fffffff
|
| 168 |
+
} NvtxCallbackModule;
|
| 169 |
+
|
| 170 |
+
typedef enum NvtxCallbackIdCore
|
| 171 |
+
{
|
| 172 |
+
NVTX_CBID_CORE_INVALID = 0,
|
| 173 |
+
NVTX_CBID_CORE_MarkEx = 1,
|
| 174 |
+
NVTX_CBID_CORE_MarkA = 2,
|
| 175 |
+
NVTX_CBID_CORE_MarkW = 3,
|
| 176 |
+
NVTX_CBID_CORE_RangeStartEx = 4,
|
| 177 |
+
NVTX_CBID_CORE_RangeStartA = 5,
|
| 178 |
+
NVTX_CBID_CORE_RangeStartW = 6,
|
| 179 |
+
NVTX_CBID_CORE_RangeEnd = 7,
|
| 180 |
+
NVTX_CBID_CORE_RangePushEx = 8,
|
| 181 |
+
NVTX_CBID_CORE_RangePushA = 9,
|
| 182 |
+
NVTX_CBID_CORE_RangePushW = 10,
|
| 183 |
+
NVTX_CBID_CORE_RangePop = 11,
|
| 184 |
+
NVTX_CBID_CORE_NameCategoryA = 12,
|
| 185 |
+
NVTX_CBID_CORE_NameCategoryW = 13,
|
| 186 |
+
NVTX_CBID_CORE_NameOsThreadA = 14,
|
| 187 |
+
NVTX_CBID_CORE_NameOsThreadW = 15,
|
| 188 |
+
/* --- New constants must only be added directly above this line --- */
|
| 189 |
+
NVTX_CBID_CORE_SIZE,
|
| 190 |
+
NVTX_CBID_CORE_FORCE_INT = 0x7fffffff
|
| 191 |
+
} NvtxCallbackIdCore;
|
| 192 |
+
|
| 193 |
+
typedef enum NvtxCallbackIdCore2
|
| 194 |
+
{
|
| 195 |
+
NVTX_CBID_CORE2_INVALID = 0,
|
| 196 |
+
NVTX_CBID_CORE2_DomainMarkEx = 1,
|
| 197 |
+
NVTX_CBID_CORE2_DomainRangeStartEx = 2,
|
| 198 |
+
NVTX_CBID_CORE2_DomainRangeEnd = 3,
|
| 199 |
+
NVTX_CBID_CORE2_DomainRangePushEx = 4,
|
| 200 |
+
NVTX_CBID_CORE2_DomainRangePop = 5,
|
| 201 |
+
NVTX_CBID_CORE2_DomainResourceCreate = 6,
|
| 202 |
+
NVTX_CBID_CORE2_DomainResourceDestroy = 7,
|
| 203 |
+
NVTX_CBID_CORE2_DomainNameCategoryA = 8,
|
| 204 |
+
NVTX_CBID_CORE2_DomainNameCategoryW = 9,
|
| 205 |
+
NVTX_CBID_CORE2_DomainRegisterStringA = 10,
|
| 206 |
+
NVTX_CBID_CORE2_DomainRegisterStringW = 11,
|
| 207 |
+
NVTX_CBID_CORE2_DomainCreateA = 12,
|
| 208 |
+
NVTX_CBID_CORE2_DomainCreateW = 13,
|
| 209 |
+
NVTX_CBID_CORE2_DomainDestroy = 14,
|
| 210 |
+
NVTX_CBID_CORE2_Initialize = 15,
|
| 211 |
+
/* --- New constants must only be added directly above this line --- */
|
| 212 |
+
NVTX_CBID_CORE2_SIZE,
|
| 213 |
+
NVTX_CBID_CORE2_FORCE_INT = 0x7fffffff
|
| 214 |
+
} NvtxCallbackIdCore2;
|
| 215 |
+
|
| 216 |
+
typedef enum NvtxCallbackIdCuda
|
| 217 |
+
{
|
| 218 |
+
NVTX_CBID_CUDA_INVALID = 0,
|
| 219 |
+
NVTX_CBID_CUDA_NameCuDeviceA = 1,
|
| 220 |
+
NVTX_CBID_CUDA_NameCuDeviceW = 2,
|
| 221 |
+
NVTX_CBID_CUDA_NameCuContextA = 3,
|
| 222 |
+
NVTX_CBID_CUDA_NameCuContextW = 4,
|
| 223 |
+
NVTX_CBID_CUDA_NameCuStreamA = 5,
|
| 224 |
+
NVTX_CBID_CUDA_NameCuStreamW = 6,
|
| 225 |
+
NVTX_CBID_CUDA_NameCuEventA = 7,
|
| 226 |
+
NVTX_CBID_CUDA_NameCuEventW = 8,
|
| 227 |
+
/* --- New constants must only be added directly above this line --- */
|
| 228 |
+
NVTX_CBID_CUDA_SIZE,
|
| 229 |
+
NVTX_CBID_CUDA_FORCE_INT = 0x7fffffff
|
| 230 |
+
} NvtxCallbackIdCuda;
|
| 231 |
+
|
| 232 |
+
typedef enum NvtxCallbackIdCudaRt
|
| 233 |
+
{
|
| 234 |
+
NVTX_CBID_CUDART_INVALID = 0,
|
| 235 |
+
NVTX_CBID_CUDART_NameCudaDeviceA = 1,
|
| 236 |
+
NVTX_CBID_CUDART_NameCudaDeviceW = 2,
|
| 237 |
+
NVTX_CBID_CUDART_NameCudaStreamA = 3,
|
| 238 |
+
NVTX_CBID_CUDART_NameCudaStreamW = 4,
|
| 239 |
+
NVTX_CBID_CUDART_NameCudaEventA = 5,
|
| 240 |
+
NVTX_CBID_CUDART_NameCudaEventW = 6,
|
| 241 |
+
/* --- New constants must only be added directly above this line --- */
|
| 242 |
+
NVTX_CBID_CUDART_SIZE,
|
| 243 |
+
NVTX_CBID_CUDART_FORCE_INT = 0x7fffffff
|
| 244 |
+
} NvtxCallbackIdCudaRt;
|
| 245 |
+
|
| 246 |
+
typedef enum NvtxCallbackIdOpenCL
|
| 247 |
+
{
|
| 248 |
+
NVTX_CBID_OPENCL_INVALID = 0,
|
| 249 |
+
NVTX_CBID_OPENCL_NameClDeviceA = 1,
|
| 250 |
+
NVTX_CBID_OPENCL_NameClDeviceW = 2,
|
| 251 |
+
NVTX_CBID_OPENCL_NameClContextA = 3,
|
| 252 |
+
NVTX_CBID_OPENCL_NameClContextW = 4,
|
| 253 |
+
NVTX_CBID_OPENCL_NameClCommandQueueA = 5,
|
| 254 |
+
NVTX_CBID_OPENCL_NameClCommandQueueW = 6,
|
| 255 |
+
NVTX_CBID_OPENCL_NameClMemObjectA = 7,
|
| 256 |
+
NVTX_CBID_OPENCL_NameClMemObjectW = 8,
|
| 257 |
+
NVTX_CBID_OPENCL_NameClSamplerA = 9,
|
| 258 |
+
NVTX_CBID_OPENCL_NameClSamplerW = 10,
|
| 259 |
+
NVTX_CBID_OPENCL_NameClProgramA = 11,
|
| 260 |
+
NVTX_CBID_OPENCL_NameClProgramW = 12,
|
| 261 |
+
NVTX_CBID_OPENCL_NameClEventA = 13,
|
| 262 |
+
NVTX_CBID_OPENCL_NameClEventW = 14,
|
| 263 |
+
/* --- New constants must only be added directly above this line --- */
|
| 264 |
+
NVTX_CBID_OPENCL_SIZE,
|
| 265 |
+
NVTX_CBID_OPENCL_FORCE_INT = 0x7fffffff
|
| 266 |
+
} NvtxCallbackIdOpenCL;
|
| 267 |
+
|
| 268 |
+
typedef enum NvtxCallbackIdSync
|
| 269 |
+
{
|
| 270 |
+
NVTX_CBID_SYNC_INVALID = 0,
|
| 271 |
+
NVTX_CBID_SYNC_DomainSyncUserCreate = 1,
|
| 272 |
+
NVTX_CBID_SYNC_DomainSyncUserDestroy = 2,
|
| 273 |
+
NVTX_CBID_SYNC_DomainSyncUserAcquireStart = 3,
|
| 274 |
+
NVTX_CBID_SYNC_DomainSyncUserAcquireFailed = 4,
|
| 275 |
+
NVTX_CBID_SYNC_DomainSyncUserAcquireSuccess = 5,
|
| 276 |
+
NVTX_CBID_SYNC_DomainSyncUserReleasing = 6,
|
| 277 |
+
/* --- New constants must only be added directly above this line --- */
|
| 278 |
+
NVTX_CBID_SYNC_SIZE,
|
| 279 |
+
NVTX_CBID_SYNC_FORCE_INT = 0x7fffffff
|
| 280 |
+
} NvtxCallbackIdSync;
|
| 281 |
+
|
| 282 |
+
/* IDs for NVTX Export Tables */
|
| 283 |
+
typedef enum NvtxExportTableID
|
| 284 |
+
{
|
| 285 |
+
NVTX_ETID_INVALID = 0,
|
| 286 |
+
NVTX_ETID_CALLBACKS = 1,
|
| 287 |
+
NVTX_ETID_RESERVED0 = 2,
|
| 288 |
+
NVTX_ETID_VERSIONINFO = 3,
|
| 289 |
+
/* --- New constants must only be added directly above this line --- */
|
| 290 |
+
NVTX_ETID_SIZE,
|
| 291 |
+
NVTX_ETID_FORCE_INT = 0x7fffffff
|
| 292 |
+
} NvtxExportTableID;
|
| 293 |
+
|
| 294 |
+
typedef void (* NvtxFunctionPointer)(void); /* generic uncallable function pointer, must be casted to appropriate function type */
|
| 295 |
+
typedef NvtxFunctionPointer** NvtxFunctionTable; /* double pointer because array(1) of pointers(2) to function pointers */
|
| 296 |
+
|
| 297 |
+
typedef struct NvtxExportTableCallbacks
|
| 298 |
+
{
|
| 299 |
+
size_t struct_size;
|
| 300 |
+
|
| 301 |
+
/* returns an array of pointer to function pointers*/
|
| 302 |
+
int (NVTX_API *GetModuleFunctionTable)(
|
| 303 |
+
NvtxCallbackModule module,
|
| 304 |
+
NvtxFunctionTable* out_table,
|
| 305 |
+
unsigned int* out_size);
|
| 306 |
+
} NvtxExportTableCallbacks;
|
| 307 |
+
|
| 308 |
+
typedef struct NvtxExportTableVersionInfo
|
| 309 |
+
{
|
| 310 |
+
/* sizeof(NvtxExportTableVersionInfo) */
|
| 311 |
+
size_t struct_size;
|
| 312 |
+
|
| 313 |
+
/* The API version comes from the NVTX library linked to the app. The
|
| 314 |
+
* injection library is can use this info to make some assumptions */
|
| 315 |
+
uint32_t version;
|
| 316 |
+
|
| 317 |
+
/* Reserved for alignment, do not use */
|
| 318 |
+
uint32_t reserved0;
|
| 319 |
+
|
| 320 |
+
/* This must be set by tools when attaching to provide applications
|
| 321 |
+
* the ability to, in emergency situations, detect problematic tools
|
| 322 |
+
* versions and modify the NVTX source to prevent attaching anything
|
| 323 |
+
* that causes trouble in the app. Currently, this value is ignored. */
|
| 324 |
+
void (NVTX_API *SetInjectionNvtxVersion)(
|
| 325 |
+
uint32_t version);
|
| 326 |
+
} NvtxExportTableVersionInfo;
|
| 327 |
+
|
| 328 |
+
|
| 329 |
+
|
| 330 |
+
|
| 331 |
+
|
| 332 |
+
|
| 333 |
+
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/lib/__init__.py
ADDED
|
File without changes
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/lib/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (165 Bytes). View file
|
|
|
wemm/lib/python3.10/site-packages/nvidia/nvtx/lib/libnvToolsExt.so.1
ADDED
|
Binary file (40.1 kB). View file
|
|
|
wemm/lib/python3.10/site-packages/pytorch_lightning/loggers/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (876 Bytes). View file
|
|
|
wemm/lib/python3.10/site-packages/pytorch_lightning/loggers/__pycache__/csv_logs.cpython-310.pyc
ADDED
|
Binary file (5.55 kB). View file
|
|
|
wemm/lib/python3.10/site-packages/pytorch_lightning/loggers/__pycache__/neptune.cpython-310.pyc
ADDED
|
Binary file (18.7 kB). View file
|
|
|
wemm/lib/python3.10/site-packages/pytorch_lightning/loggers/__pycache__/utilities.cpython-310.pyc
ADDED
|
Binary file (2.99 kB). View file
|
|
|
wemm/lib/python3.10/site-packages/pytorch_lightning/loggers/__pycache__/wandb.cpython-310.pyc
ADDED
|
Binary file (19.7 kB). View file
|
|
|
wemm/lib/python3.10/site-packages/pytorch_lightning/loggers/neptune.py
ADDED
|
@@ -0,0 +1,545 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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1 |
+
# Copyright The Lightning AI team.
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
"""
|
| 15 |
+
Neptune Logger
|
| 16 |
+
--------------
|
| 17 |
+
"""
|
| 18 |
+
__all__ = [
|
| 19 |
+
"NeptuneLogger",
|
| 20 |
+
]
|
| 21 |
+
|
| 22 |
+
import logging
|
| 23 |
+
import os
|
| 24 |
+
from argparse import Namespace
|
| 25 |
+
from typing import Any, Dict, Generator, List, Optional, Set, Union
|
| 26 |
+
|
| 27 |
+
from lightning_utilities.core.imports import RequirementCache
|
| 28 |
+
from torch import Tensor
|
| 29 |
+
|
| 30 |
+
import pytorch_lightning as pl
|
| 31 |
+
from lightning_fabric.utilities.logger import _add_prefix, _convert_params, _sanitize_callable_params
|
| 32 |
+
from pytorch_lightning.callbacks import Checkpoint
|
| 33 |
+
from pytorch_lightning.loggers.logger import Logger, rank_zero_experiment
|
| 34 |
+
from pytorch_lightning.utilities.model_summary import ModelSummary
|
| 35 |
+
from pytorch_lightning.utilities.rank_zero import rank_zero_only
|
| 36 |
+
|
| 37 |
+
_NEPTUNE_AVAILABLE = RequirementCache("neptune-client")
|
| 38 |
+
if _NEPTUNE_AVAILABLE:
|
| 39 |
+
from neptune import new as neptune
|
| 40 |
+
from neptune.new.run import Run
|
| 41 |
+
else:
|
| 42 |
+
# needed for test mocks, and function signatures
|
| 43 |
+
neptune, Run = None, None
|
| 44 |
+
|
| 45 |
+
log = logging.getLogger(__name__)
|
| 46 |
+
|
| 47 |
+
_INTEGRATION_VERSION_KEY = "source_code/integrations/pytorch-lightning"
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
class NeptuneLogger(Logger):
|
| 51 |
+
r"""
|
| 52 |
+
Log using `Neptune <https://neptune.ai>`_.
|
| 53 |
+
|
| 54 |
+
Install it with pip:
|
| 55 |
+
|
| 56 |
+
.. code-block:: bash
|
| 57 |
+
|
| 58 |
+
pip install neptune-client
|
| 59 |
+
|
| 60 |
+
or conda:
|
| 61 |
+
|
| 62 |
+
.. code-block:: bash
|
| 63 |
+
|
| 64 |
+
conda install -c conda-forge neptune-client
|
| 65 |
+
|
| 66 |
+
**Quickstart**
|
| 67 |
+
|
| 68 |
+
Pass NeptuneLogger instance to the Trainer to log metadata with Neptune:
|
| 69 |
+
|
| 70 |
+
.. code-block:: python
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
from pytorch_lightning import Trainer
|
| 74 |
+
from pytorch_lightning.loggers import NeptuneLogger
|
| 75 |
+
|
| 76 |
+
neptune_logger = NeptuneLogger(
|
| 77 |
+
api_key="ANONYMOUS", # replace with your own
|
| 78 |
+
project="common/pytorch-lightning-integration", # format "<WORKSPACE/PROJECT>"
|
| 79 |
+
tags=["training", "resnet"], # optional
|
| 80 |
+
)
|
| 81 |
+
trainer = Trainer(max_epochs=10, logger=neptune_logger)
|
| 82 |
+
|
| 83 |
+
**How to use NeptuneLogger?**
|
| 84 |
+
|
| 85 |
+
Use the logger anywhere in your :class:`~pytorch_lightning.core.module.LightningModule` as follows:
|
| 86 |
+
|
| 87 |
+
.. code-block:: python
|
| 88 |
+
|
| 89 |
+
from neptune.new.types import File
|
| 90 |
+
from pytorch_lightning import LightningModule
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
class LitModel(LightningModule):
|
| 94 |
+
def training_step(self, batch, batch_idx):
|
| 95 |
+
# log metrics
|
| 96 |
+
acc = ...
|
| 97 |
+
self.log("train/loss", loss)
|
| 98 |
+
|
| 99 |
+
def any_lightning_module_function_or_hook(self):
|
| 100 |
+
# log images
|
| 101 |
+
img = ...
|
| 102 |
+
self.logger.experiment["train/misclassified_images"].log(File.as_image(img))
|
| 103 |
+
|
| 104 |
+
# generic recipe
|
| 105 |
+
metadata = ...
|
| 106 |
+
self.logger.experiment["your/metadata/structure"].log(metadata)
|
| 107 |
+
|
| 108 |
+
Note that syntax: ``self.logger.experiment["your/metadata/structure"].log(metadata)`` is specific to Neptune
|
| 109 |
+
and it extends logger capabilities. Specifically, it allows you to log various types of metadata
|
| 110 |
+
like scores, files, images, interactive visuals, CSVs, etc.
|
| 111 |
+
Refer to the `Neptune docs <https://docs.neptune.ai/you-should-know/logging-metadata#essential-logging-methods>`_
|
| 112 |
+
for more detailed explanations.
|
| 113 |
+
You can also use regular logger methods ``log_metrics()``, and ``log_hyperparams()`` with NeptuneLogger
|
| 114 |
+
as these are also supported.
|
| 115 |
+
|
| 116 |
+
**Log after fitting or testing is finished**
|
| 117 |
+
|
| 118 |
+
You can log objects after the fitting or testing methods are finished:
|
| 119 |
+
|
| 120 |
+
.. code-block:: python
|
| 121 |
+
|
| 122 |
+
neptune_logger = NeptuneLogger(project="common/pytorch-lightning-integration")
|
| 123 |
+
|
| 124 |
+
trainer = pl.Trainer(logger=neptune_logger)
|
| 125 |
+
model = ...
|
| 126 |
+
datamodule = ...
|
| 127 |
+
trainer.fit(model, datamodule=datamodule)
|
| 128 |
+
trainer.test(model, datamodule=datamodule)
|
| 129 |
+
|
| 130 |
+
# Log objects after `fit` or `test` methods
|
| 131 |
+
# model summary
|
| 132 |
+
neptune_logger.log_model_summary(model=model, max_depth=-1)
|
| 133 |
+
|
| 134 |
+
# generic recipe
|
| 135 |
+
metadata = ...
|
| 136 |
+
neptune_logger.experiment["your/metadata/structure"].log(metadata)
|
| 137 |
+
|
| 138 |
+
**Log model checkpoints**
|
| 139 |
+
|
| 140 |
+
If you have :class:`~pytorch_lightning.callbacks.ModelCheckpoint` configured,
|
| 141 |
+
Neptune logger automatically logs model checkpoints.
|
| 142 |
+
Model weights will be uploaded to the: "model/checkpoints" namespace in the Neptune Run.
|
| 143 |
+
You can disable this option:
|
| 144 |
+
|
| 145 |
+
.. code-block:: python
|
| 146 |
+
|
| 147 |
+
neptune_logger = NeptuneLogger(project="common/pytorch-lightning-integration", log_model_checkpoints=False)
|
| 148 |
+
|
| 149 |
+
**Pass additional parameters to the Neptune run**
|
| 150 |
+
|
| 151 |
+
You can also pass ``neptune_run_kwargs`` to specify the run in the greater detail, like ``tags`` or ``description``:
|
| 152 |
+
|
| 153 |
+
.. testcode::
|
| 154 |
+
:skipif: not _NEPTUNE_AVAILABLE
|
| 155 |
+
|
| 156 |
+
from pytorch_lightning import Trainer
|
| 157 |
+
from pytorch_lightning.loggers import NeptuneLogger
|
| 158 |
+
|
| 159 |
+
neptune_logger = NeptuneLogger(
|
| 160 |
+
project="common/pytorch-lightning-integration",
|
| 161 |
+
name="lightning-run",
|
| 162 |
+
description="mlp quick run with pytorch-lightning",
|
| 163 |
+
tags=["mlp", "quick-run"],
|
| 164 |
+
)
|
| 165 |
+
trainer = Trainer(max_epochs=3, logger=neptune_logger)
|
| 166 |
+
|
| 167 |
+
Check `run documentation <https://docs.neptune.ai/essentials/api-reference/run>`_
|
| 168 |
+
for more info about additional run parameters.
|
| 169 |
+
|
| 170 |
+
**Details about Neptune run structure**
|
| 171 |
+
|
| 172 |
+
Runs can be viewed as nested dictionary-like structures that you can define in your code.
|
| 173 |
+
Thanks to this you can easily organize your metadata in a way that is most convenient for you.
|
| 174 |
+
|
| 175 |
+
The hierarchical structure that you apply to your metadata will be reflected later in the UI.
|
| 176 |
+
|
| 177 |
+
You can organize this way any type of metadata - images, parameters, metrics, model checkpoint, CSV files, etc.
|
| 178 |
+
|
| 179 |
+
See Also:
|
| 180 |
+
- Read about
|
| 181 |
+
`what object you can log to Neptune <https://docs.neptune.ai/you-should-know/what-can-you-log-and-display>`_.
|
| 182 |
+
- Check `example run <https://app.neptune.ai/o/common/org/pytorch-lightning-integration/e/PTL-1/all>`_
|
| 183 |
+
with multiple types of metadata logged.
|
| 184 |
+
- For more detailed info check
|
| 185 |
+
`user guide <https://docs.neptune.ai/integrations-and-supported-tools/model-training/pytorch-lightning>`_.
|
| 186 |
+
|
| 187 |
+
Args:
|
| 188 |
+
api_key: Optional.
|
| 189 |
+
Neptune API token, found on https://neptune.ai upon registration.
|
| 190 |
+
Read: `how to find and set Neptune API token <https://docs.neptune.ai/administration/security-and-privacy/
|
| 191 |
+
how-to-find-and-set-neptune-api-token>`_.
|
| 192 |
+
It is recommended to keep it in the `NEPTUNE_API_TOKEN`
|
| 193 |
+
environment variable and then you can drop ``api_key=None``.
|
| 194 |
+
project: Optional.
|
| 195 |
+
Name of a project in a form of "my_workspace/my_project" for example "tom/mask-rcnn".
|
| 196 |
+
If ``None``, the value of `NEPTUNE_PROJECT` environment variable will be taken.
|
| 197 |
+
You need to create the project in https://neptune.ai first.
|
| 198 |
+
name: Optional. Editable name of the run.
|
| 199 |
+
Run name appears in the "all metadata/sys" section in Neptune UI.
|
| 200 |
+
run: Optional. Default is ``None``. The Neptune ``Run`` object.
|
| 201 |
+
If specified, this `Run`` will be used for logging, instead of a new Run.
|
| 202 |
+
When run object is passed you can't specify other neptune properties.
|
| 203 |
+
log_model_checkpoints: Optional. Default is ``True``. Log model checkpoint to Neptune.
|
| 204 |
+
Works only if ``ModelCheckpoint`` is passed to the ``Trainer``.
|
| 205 |
+
prefix: Optional. Default is ``"training"``. Root namespace for all metadata logging.
|
| 206 |
+
\**neptune_run_kwargs: Additional arguments like ``tags``, ``description``, ``capture_stdout``, etc.
|
| 207 |
+
used when run is created.
|
| 208 |
+
|
| 209 |
+
Raises:
|
| 210 |
+
ModuleNotFoundError:
|
| 211 |
+
If required Neptune package is not installed.
|
| 212 |
+
ValueError:
|
| 213 |
+
If argument passed to the logger's constructor is incorrect.
|
| 214 |
+
"""
|
| 215 |
+
|
| 216 |
+
LOGGER_JOIN_CHAR = "/"
|
| 217 |
+
PARAMETERS_KEY = "hyperparams"
|
| 218 |
+
ARTIFACTS_KEY = "artifacts"
|
| 219 |
+
|
| 220 |
+
def __init__(
|
| 221 |
+
self,
|
| 222 |
+
*, # force users to call `NeptuneLogger` initializer with `kwargs`
|
| 223 |
+
api_key: Optional[str] = None,
|
| 224 |
+
project: Optional[str] = None,
|
| 225 |
+
name: Optional[str] = None,
|
| 226 |
+
run: Optional["Run"] = None,
|
| 227 |
+
log_model_checkpoints: Optional[bool] = True,
|
| 228 |
+
prefix: str = "training",
|
| 229 |
+
**neptune_run_kwargs: Any,
|
| 230 |
+
):
|
| 231 |
+
if not _NEPTUNE_AVAILABLE:
|
| 232 |
+
raise ModuleNotFoundError(str(_NEPTUNE_AVAILABLE))
|
| 233 |
+
# verify if user passed proper init arguments
|
| 234 |
+
self._verify_input_arguments(api_key, project, name, run, neptune_run_kwargs)
|
| 235 |
+
super().__init__()
|
| 236 |
+
self._log_model_checkpoints = log_model_checkpoints
|
| 237 |
+
self._prefix = prefix
|
| 238 |
+
self._run_name = name
|
| 239 |
+
self._project_name = project
|
| 240 |
+
self._api_key = api_key
|
| 241 |
+
self._run_instance = run
|
| 242 |
+
self._neptune_run_kwargs = neptune_run_kwargs
|
| 243 |
+
self._run_short_id: Optional[str] = None
|
| 244 |
+
|
| 245 |
+
if self._run_instance is not None:
|
| 246 |
+
self._retrieve_run_data()
|
| 247 |
+
|
| 248 |
+
# make sure that we've log integration version for outside `Run` instances
|
| 249 |
+
self._run_instance[_INTEGRATION_VERSION_KEY] = pl.__version__
|
| 250 |
+
|
| 251 |
+
def _retrieve_run_data(self) -> None:
|
| 252 |
+
assert self._run_instance is not None
|
| 253 |
+
self._run_instance.wait()
|
| 254 |
+
|
| 255 |
+
if self._run_instance.exists("sys/id"):
|
| 256 |
+
self._run_short_id = self._run_instance["sys/id"].fetch()
|
| 257 |
+
self._run_name = self._run_instance["sys/name"].fetch()
|
| 258 |
+
else:
|
| 259 |
+
self._run_short_id = "OFFLINE"
|
| 260 |
+
self._run_name = "offline-name"
|
| 261 |
+
|
| 262 |
+
@property
|
| 263 |
+
def _neptune_init_args(self) -> Dict:
|
| 264 |
+
args: Dict = {}
|
| 265 |
+
# Backward compatibility in case of previous version retrieval
|
| 266 |
+
try:
|
| 267 |
+
args = self._neptune_run_kwargs
|
| 268 |
+
except AttributeError:
|
| 269 |
+
pass
|
| 270 |
+
|
| 271 |
+
if self._project_name is not None:
|
| 272 |
+
args["project"] = self._project_name
|
| 273 |
+
|
| 274 |
+
if self._api_key is not None:
|
| 275 |
+
args["api_token"] = self._api_key
|
| 276 |
+
|
| 277 |
+
if self._run_short_id is not None:
|
| 278 |
+
args["run"] = self._run_short_id
|
| 279 |
+
|
| 280 |
+
# Backward compatibility in case of previous version retrieval
|
| 281 |
+
try:
|
| 282 |
+
if self._run_name is not None:
|
| 283 |
+
args["name"] = self._run_name
|
| 284 |
+
except AttributeError:
|
| 285 |
+
pass
|
| 286 |
+
|
| 287 |
+
return args
|
| 288 |
+
|
| 289 |
+
def _construct_path_with_prefix(self, *keys: str) -> str:
|
| 290 |
+
"""Return sequence of keys joined by `LOGGER_JOIN_CHAR`, started with `_prefix` if defined."""
|
| 291 |
+
if self._prefix:
|
| 292 |
+
return self.LOGGER_JOIN_CHAR.join([self._prefix, *keys])
|
| 293 |
+
return self.LOGGER_JOIN_CHAR.join(keys)
|
| 294 |
+
|
| 295 |
+
@staticmethod
|
| 296 |
+
def _verify_input_arguments(
|
| 297 |
+
api_key: Optional[str],
|
| 298 |
+
project: Optional[str],
|
| 299 |
+
name: Optional[str],
|
| 300 |
+
run: Optional["Run"],
|
| 301 |
+
neptune_run_kwargs: dict,
|
| 302 |
+
) -> None:
|
| 303 |
+
# check if user passed the client `Run` object
|
| 304 |
+
if run is not None and not isinstance(run, Run):
|
| 305 |
+
raise ValueError("Run parameter expected to be of type `neptune.new.Run`.")
|
| 306 |
+
# check if user passed redundant neptune.init_run arguments when passed run
|
| 307 |
+
any_neptune_init_arg_passed = any(arg is not None for arg in [api_key, project, name]) or neptune_run_kwargs
|
| 308 |
+
if run is not None and any_neptune_init_arg_passed:
|
| 309 |
+
raise ValueError(
|
| 310 |
+
"When an already initialized run object is provided"
|
| 311 |
+
" you can't provide other neptune.init_run() parameters.\n"
|
| 312 |
+
)
|
| 313 |
+
|
| 314 |
+
def __getstate__(self) -> Dict[str, Any]:
|
| 315 |
+
state = self.__dict__.copy()
|
| 316 |
+
# Run instance can't be pickled
|
| 317 |
+
state["_run_instance"] = None
|
| 318 |
+
return state
|
| 319 |
+
|
| 320 |
+
def __setstate__(self, state: Dict[str, Any]) -> None:
|
| 321 |
+
self.__dict__ = state
|
| 322 |
+
self._run_instance = neptune.init_run(**self._neptune_init_args)
|
| 323 |
+
|
| 324 |
+
@property
|
| 325 |
+
@rank_zero_experiment
|
| 326 |
+
def experiment(self) -> Run:
|
| 327 |
+
r"""
|
| 328 |
+
Actual Neptune run object. Allows you to use neptune logging features in your
|
| 329 |
+
:class:`~pytorch_lightning.core.module.LightningModule`.
|
| 330 |
+
|
| 331 |
+
Example::
|
| 332 |
+
|
| 333 |
+
class LitModel(LightningModule):
|
| 334 |
+
def training_step(self, batch, batch_idx):
|
| 335 |
+
# log metrics
|
| 336 |
+
acc = ...
|
| 337 |
+
self.logger.experiment["train/acc"].log(acc)
|
| 338 |
+
|
| 339 |
+
# log images
|
| 340 |
+
img = ...
|
| 341 |
+
self.logger.experiment["train/misclassified_images"].log(File.as_image(img))
|
| 342 |
+
|
| 343 |
+
Note that syntax: ``self.logger.experiment["your/metadata/structure"].log(metadata)``
|
| 344 |
+
is specific to Neptune and it extends logger capabilities.
|
| 345 |
+
Specifically, it allows you to log various types of metadata like scores, files,
|
| 346 |
+
images, interactive visuals, CSVs, etc. Refer to the
|
| 347 |
+
`Neptune docs <https://docs.neptune.ai/you-should-know/logging-metadata#essential-logging-methods>`_
|
| 348 |
+
for more detailed explanations.
|
| 349 |
+
You can also use regular logger methods ``log_metrics()``, and ``log_hyperparams()``
|
| 350 |
+
with NeptuneLogger as these are also supported.
|
| 351 |
+
"""
|
| 352 |
+
return self.run
|
| 353 |
+
|
| 354 |
+
@property
|
| 355 |
+
@rank_zero_experiment
|
| 356 |
+
def run(self) -> Run:
|
| 357 |
+
if not self._run_instance:
|
| 358 |
+
self._run_instance = neptune.init_run(**self._neptune_init_args)
|
| 359 |
+
self._retrieve_run_data()
|
| 360 |
+
# make sure that we've log integration version for newly created
|
| 361 |
+
self._run_instance[_INTEGRATION_VERSION_KEY] = pl.__version__
|
| 362 |
+
|
| 363 |
+
return self._run_instance
|
| 364 |
+
|
| 365 |
+
@rank_zero_only
|
| 366 |
+
def log_hyperparams(self, params: Union[Dict[str, Any], Namespace]) -> None: # skipcq: PYL-W0221
|
| 367 |
+
r"""
|
| 368 |
+
Log hyper-parameters to the run.
|
| 369 |
+
|
| 370 |
+
Hyperparams will be logged under the "<prefix>/hyperparams" namespace.
|
| 371 |
+
|
| 372 |
+
Note:
|
| 373 |
+
|
| 374 |
+
You can also log parameters by directly using the logger instance:
|
| 375 |
+
``neptune_logger.experiment["model/hyper-parameters"] = params_dict``.
|
| 376 |
+
|
| 377 |
+
In this way you can keep hierarchical structure of the parameters.
|
| 378 |
+
|
| 379 |
+
Args:
|
| 380 |
+
params: `dict`.
|
| 381 |
+
Python dictionary structure with parameters.
|
| 382 |
+
|
| 383 |
+
Example::
|
| 384 |
+
|
| 385 |
+
from pytorch_lightning.loggers import NeptuneLogger
|
| 386 |
+
|
| 387 |
+
PARAMS = {
|
| 388 |
+
"batch_size": 64,
|
| 389 |
+
"lr": 0.07,
|
| 390 |
+
"decay_factor": 0.97
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
neptune_logger = NeptuneLogger(
|
| 394 |
+
api_key="ANONYMOUS",
|
| 395 |
+
project="common/pytorch-lightning-integration"
|
| 396 |
+
)
|
| 397 |
+
|
| 398 |
+
neptune_logger.log_hyperparams(PARAMS)
|
| 399 |
+
"""
|
| 400 |
+
params = _convert_params(params)
|
| 401 |
+
params = _sanitize_callable_params(params)
|
| 402 |
+
|
| 403 |
+
parameters_key = self.PARAMETERS_KEY
|
| 404 |
+
parameters_key = self._construct_path_with_prefix(parameters_key)
|
| 405 |
+
|
| 406 |
+
self.run[parameters_key] = params
|
| 407 |
+
|
| 408 |
+
@rank_zero_only
|
| 409 |
+
def log_metrics(self, metrics: Dict[str, Union[Tensor, float]], step: Optional[int] = None) -> None:
|
| 410 |
+
"""Log metrics (numeric values) in Neptune runs.
|
| 411 |
+
|
| 412 |
+
Args:
|
| 413 |
+
metrics: Dictionary with metric names as keys and measured quantities as values.
|
| 414 |
+
step: Step number at which the metrics should be recorded, currently ignored.
|
| 415 |
+
"""
|
| 416 |
+
if rank_zero_only.rank != 0:
|
| 417 |
+
raise ValueError("run tried to log from global_rank != 0")
|
| 418 |
+
|
| 419 |
+
metrics = _add_prefix(metrics, self._prefix, self.LOGGER_JOIN_CHAR)
|
| 420 |
+
|
| 421 |
+
for key, val in metrics.items():
|
| 422 |
+
# `step` is ignored because Neptune expects strictly increasing step values which
|
| 423 |
+
# Lightning does not always guarantee.
|
| 424 |
+
self.run[key].log(val)
|
| 425 |
+
|
| 426 |
+
@rank_zero_only
|
| 427 |
+
def finalize(self, status: str) -> None:
|
| 428 |
+
if not self._run_instance:
|
| 429 |
+
# When using multiprocessing, finalize() should be a no-op on the main process, as no experiment has been
|
| 430 |
+
# initialized there
|
| 431 |
+
return
|
| 432 |
+
if status:
|
| 433 |
+
self.run[self._construct_path_with_prefix("status")] = status
|
| 434 |
+
|
| 435 |
+
super().finalize(status)
|
| 436 |
+
|
| 437 |
+
@property
|
| 438 |
+
def save_dir(self) -> Optional[str]:
|
| 439 |
+
"""Gets the save directory of the experiment which in this case is ``None`` because Neptune does not save
|
| 440 |
+
locally.
|
| 441 |
+
|
| 442 |
+
Returns:
|
| 443 |
+
the root directory where experiment logs get saved
|
| 444 |
+
"""
|
| 445 |
+
return os.path.join(os.getcwd(), ".neptune")
|
| 446 |
+
|
| 447 |
+
@rank_zero_only
|
| 448 |
+
def log_model_summary(self, model: "pl.LightningModule", max_depth: int = -1) -> None:
|
| 449 |
+
model_str = str(ModelSummary(model=model, max_depth=max_depth))
|
| 450 |
+
self.run[self._construct_path_with_prefix("model/summary")] = neptune.types.File.from_content(
|
| 451 |
+
content=model_str, extension="txt"
|
| 452 |
+
)
|
| 453 |
+
|
| 454 |
+
@rank_zero_only
|
| 455 |
+
def after_save_checkpoint(self, checkpoint_callback: Checkpoint) -> None:
|
| 456 |
+
"""Automatically log checkpointed model. Called after model checkpoint callback saves a new checkpoint.
|
| 457 |
+
|
| 458 |
+
Args:
|
| 459 |
+
checkpoint_callback: the model checkpoint callback instance
|
| 460 |
+
"""
|
| 461 |
+
if not self._log_model_checkpoints:
|
| 462 |
+
return
|
| 463 |
+
|
| 464 |
+
file_names = set()
|
| 465 |
+
checkpoints_namespace = self._construct_path_with_prefix("model/checkpoints")
|
| 466 |
+
|
| 467 |
+
# save last model
|
| 468 |
+
if hasattr(checkpoint_callback, "last_model_path") and checkpoint_callback.last_model_path:
|
| 469 |
+
model_last_name = self._get_full_model_name(checkpoint_callback.last_model_path, checkpoint_callback)
|
| 470 |
+
file_names.add(model_last_name)
|
| 471 |
+
self.run[f"{checkpoints_namespace}/{model_last_name}"].upload(checkpoint_callback.last_model_path)
|
| 472 |
+
|
| 473 |
+
# save best k models
|
| 474 |
+
if hasattr(checkpoint_callback, "best_k_models"):
|
| 475 |
+
for key in checkpoint_callback.best_k_models.keys():
|
| 476 |
+
model_name = self._get_full_model_name(key, checkpoint_callback)
|
| 477 |
+
file_names.add(model_name)
|
| 478 |
+
self.run[f"{checkpoints_namespace}/{model_name}"].upload(key)
|
| 479 |
+
|
| 480 |
+
# log best model path and checkpoint
|
| 481 |
+
if hasattr(checkpoint_callback, "best_model_path") and checkpoint_callback.best_model_path:
|
| 482 |
+
self.run[self._construct_path_with_prefix("model/best_model_path")] = checkpoint_callback.best_model_path
|
| 483 |
+
|
| 484 |
+
model_name = self._get_full_model_name(checkpoint_callback.best_model_path, checkpoint_callback)
|
| 485 |
+
file_names.add(model_name)
|
| 486 |
+
self.run[f"{checkpoints_namespace}/{model_name}"].upload(checkpoint_callback.best_model_path)
|
| 487 |
+
|
| 488 |
+
# remove old models logged to experiment if they are not part of best k models at this point
|
| 489 |
+
if self.run.exists(checkpoints_namespace):
|
| 490 |
+
exp_structure = self.run.get_structure()
|
| 491 |
+
uploaded_model_names = self._get_full_model_names_from_exp_structure(exp_structure, checkpoints_namespace)
|
| 492 |
+
|
| 493 |
+
for file_to_drop in list(uploaded_model_names - file_names):
|
| 494 |
+
del self.run[f"{checkpoints_namespace}/{file_to_drop}"]
|
| 495 |
+
|
| 496 |
+
# log best model score
|
| 497 |
+
if hasattr(checkpoint_callback, "best_model_score") and checkpoint_callback.best_model_score:
|
| 498 |
+
self.run[self._construct_path_with_prefix("model/best_model_score")] = (
|
| 499 |
+
checkpoint_callback.best_model_score.cpu().detach().numpy()
|
| 500 |
+
)
|
| 501 |
+
|
| 502 |
+
@staticmethod
|
| 503 |
+
def _get_full_model_name(model_path: str, checkpoint_callback: Checkpoint) -> str:
|
| 504 |
+
"""Returns model name which is string `model_path` appended to `checkpoint_callback.dirpath`."""
|
| 505 |
+
if hasattr(checkpoint_callback, "dirpath"):
|
| 506 |
+
expected_model_path = f"{checkpoint_callback.dirpath}{os.path.sep}"
|
| 507 |
+
if not model_path.startswith(expected_model_path):
|
| 508 |
+
raise ValueError(f"{model_path} was expected to start with {expected_model_path}.")
|
| 509 |
+
# Remove extension from filepath
|
| 510 |
+
filepath, _ = os.path.splitext(model_path[len(expected_model_path) :])
|
| 511 |
+
else:
|
| 512 |
+
filepath = model_path
|
| 513 |
+
|
| 514 |
+
return filepath
|
| 515 |
+
|
| 516 |
+
@classmethod
|
| 517 |
+
def _get_full_model_names_from_exp_structure(cls, exp_structure: Dict[str, Any], namespace: str) -> Set[str]:
|
| 518 |
+
"""Returns all paths to properties which were already logged in `namespace`"""
|
| 519 |
+
structure_keys: List[str] = namespace.split(cls.LOGGER_JOIN_CHAR)
|
| 520 |
+
for key in structure_keys:
|
| 521 |
+
exp_structure = exp_structure[key]
|
| 522 |
+
uploaded_models_dict = exp_structure
|
| 523 |
+
return set(cls._dict_paths(uploaded_models_dict))
|
| 524 |
+
|
| 525 |
+
@classmethod
|
| 526 |
+
def _dict_paths(cls, d: Dict[str, Any], path_in_build: Optional[str] = None) -> Generator:
|
| 527 |
+
for k, v in d.items():
|
| 528 |
+
path = f"{path_in_build}/{k}" if path_in_build is not None else k
|
| 529 |
+
if not isinstance(v, dict):
|
| 530 |
+
yield path
|
| 531 |
+
else:
|
| 532 |
+
yield from cls._dict_paths(v, path)
|
| 533 |
+
|
| 534 |
+
@property
|
| 535 |
+
def name(self) -> Optional[str]:
|
| 536 |
+
"""Return the experiment name or 'offline-name' when exp is run in offline mode."""
|
| 537 |
+
return self._run_name
|
| 538 |
+
|
| 539 |
+
@property
|
| 540 |
+
def version(self) -> Optional[str]:
|
| 541 |
+
"""Return the experiment version.
|
| 542 |
+
|
| 543 |
+
It's Neptune Run's short_id
|
| 544 |
+
"""
|
| 545 |
+
return self._run_short_id
|
wemm/lib/python3.10/site-packages/pytorch_lightning/profilers/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (665 Bytes). View file
|
|
|
wemm/lib/python3.10/site-packages/pytorch_lightning/profilers/__pycache__/base.cpython-310.pyc
ADDED
|
Binary file (922 Bytes). View file
|
|
|
wemm/lib/python3.10/site-packages/pytorch_lightning/profilers/__pycache__/pytorch.cpython-310.pyc
ADDED
|
Binary file (17.2 kB). View file
|
|
|