NVTX  v3
NVIDIA Tools Extension Library
nvToolsExtJson.h
1 /*
2 * Copyright 2009-2020 NVIDIA Corporation. All rights reserved.
3 *
4 * Licensed under the Apache License v2.0 with LLVM Exceptions.
5 * See https://llvm.org/LICENSE.txt for license information.
6 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 */
8 
9 #ifndef NVTOOLSEXT_EXTENSION_JSON_V3
10 #define NVTOOLSEXT_EXTENSION_JSON_V3
11 
12 /* Use the same pattern as nvToolsExt.h for including stdint.h and stddef.h */
13 #ifndef NVTX_STDINT_TYPES_ALREADY_DEFINED
14 #include <stdint.h>
15 #endif
16 #include "stddef.h" /* For uintptr_t definition */
17 
18 /* ------------------------------------------------------------------------- */
32 typedef enum nvtxPayloadTypeExtensionJson_t
33 {
34  /* Additional values for the enum nvtxMessageType_t */
35  NVTX_PAYLOAD_TYPE_JSON = 7,
44  NVTX_PAYLOAD_TYPE_JSON_REGISTERED = 8
52 } nvtxPayloadTypeExtensionJson_t;
53 
54 /* Helper macros for safe double-cast of pointer to uint64_t value */
55 #ifdef __cplusplus
56 #define NVTX_POINTER_AS_PAYLOAD_ULLVALUE(p) static_cast<uint64_t>(reinterpret_cast<uintptr_t>(p))
57 #else
58 #define NVTX_POINTER_AS_PAYLOAD_ULLVALUE(p) ((uint64_t)(uintptr_t)p)
59 #endif
60 #define NVTX_STRING_HANDLE_AS_PAYLOAD_ULLVALUE(h) NVTX_POINTER_AS_PAYLOAD_ULLVALUE(h)
61 
62 #endif /* NVTOOLSEXT_EXTENSION_JSON_V3 */